sk.baka.webvm.analyzer.classloader
Enum CLEnum

java.lang.Object
  extended by java.lang.Enum<CLEnum>
      extended by sk.baka.webvm.analyzer.classloader.CLEnum
All Implemented Interfaces:
Serializable, Comparable<CLEnum>

public enum CLEnum
extends Enum<CLEnum>

Auto-detection of the class loader type.

Author:
Martin Vysny

Enum Constant Summary
EAR
          Classloader for the EAR application.
EJBJAR
          A classloader which loads ejb.jar
ROOT
          Root classloader (its parent is null).
SERVER
          An unknown classloader type.
SYSTEM
          A system classloader.
WAR
          The WebVM WAR classloader.
 
Method Summary
static EnumSet<CLEnum> getTypes(ClassLoader cl)
          Detects the type of classes this class loader manages.
protected abstract  boolean matches(ClassLoader cl)
          Checks if this enum constant matches given classloader.
static CLEnum valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CLEnum[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

WAR

public static final CLEnum WAR
The WebVM WAR classloader.


EJBJAR

public static final CLEnum EJBJAR
A classloader which loads ejb.jar


EAR

public static final CLEnum EAR
Classloader for the EAR application.


SYSTEM

public static final CLEnum SYSTEM
A system classloader.


ROOT

public static final CLEnum ROOT
Root classloader (its parent is null).


SERVER

public static final CLEnum SERVER
An unknown classloader type.

Method Detail

values

public static CLEnum[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CLEnum c : CLEnum.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CLEnum valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

matches

protected abstract boolean matches(ClassLoader cl)
Checks if this enum constant matches given classloader.

Parameters:
cl - the classloader to match, not null
Returns:
true if given classloader is of this type.

getTypes

public static EnumSet<CLEnum> getTypes(ClassLoader cl)
Detects the type of classes this class loader manages.

Parameters:
cl - the classloader, not null.
Returns:
class loader type


Copyright © 2010 Baka. All Rights Reserved.