com.tivoli.twg.engine
Class TWGSnapInManager

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGSnapInManager
All Implemented Interfaces:
CommandReceivedListener

public class TWGSnapInManager
extends java.lang.Object
implements CommandReceivedListener

This class is used to manage snap-in's for the Director server. Tasks and extensions may register, de-register or query snap-in information using this class.


Field Summary
static int GET_SNAPIN_APPEND_PATH
           
static int GET_SNAPIN_LIST_CMD
           
static int GET_SNAPIN_RESOURCE_CMD
           
static java.lang.String SnapInServiceNodeName
          The name of the TWGSnapInManager service node
 
Method Summary
static boolean appendClassPath(java.lang.String path)
          This method is used to add a new path to the CLASSPATH used when searching for resources and classes.
 boolean CommandReceived(ServiceNode sn, Command cmd)
          This method is used internally to process commands received from the TWGRemoteSnapInManager running on the console.
static boolean DeregisterSnapIn(java.lang.String siType, java.lang.String siSubType, java.lang.String siClassName)
          This method is used to deregister a snap-in from the server using a type, sub-type and class name.
static boolean DeregisterSnapIn(TWGSnapIn snapIn)
          This method is used to deregister a snap-in from the server using a TWGSnapIn object.
static TWGSnapIn getSnapInForSubType(java.lang.String siType, java.lang.String siSubType)
          This static method is used to get a snap-in that has been registered for a specific type and sub-type.
static Vect getSnapInListForType(java.lang.String siType)
          This static method is used to get a list of snap-in's that have been registered for a specific type.
static void initialize()
          This method is used to initialize the snap-in manager.
static java.lang.Object loadSnapIn(TWGSnapIn si)
          This method is used to return an instance of a snap-in.
static java.lang.Object loadSnapInForSubType(java.lang.String siType, java.lang.String siSubType)
          This method is used to return an instance of a snap-in that has been registered for a specific type and sub-type.
static boolean RegisterSnapIn(java.lang.String siType, java.lang.String siSubType, java.lang.String siClassName)
          This method is used to register a new snap-in with the server using a type, sub-type and class name.
static boolean RegisterSnapIn(TWGSnapIn snapIn)
          This method is used to register a new snap-in with the server using a TWGSnapIn object.
static void terminate()
          This method is used by the Director server engine to clean-up the snap-in manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SnapInServiceNodeName

public static final java.lang.String SnapInServiceNodeName
The name of the TWGSnapInManager service node

See Also:
Constant Field Values

GET_SNAPIN_LIST_CMD

public static final int GET_SNAPIN_LIST_CMD
See Also:
Constant Field Values

GET_SNAPIN_RESOURCE_CMD

public static final int GET_SNAPIN_RESOURCE_CMD
See Also:
Constant Field Values

GET_SNAPIN_APPEND_PATH

public static final int GET_SNAPIN_APPEND_PATH
See Also:
Constant Field Values
Method Detail

RegisterSnapIn

public static boolean RegisterSnapIn(java.lang.String siType,
                                     java.lang.String siSubType,
                                     java.lang.String siClassName)
This method is used to register a new snap-in with the server using a type, sub-type and class name. Snap-in's are not persistent, so each time the Director server is started, the snap-in will need to be registered. If another snap-in has already been registered for the same type and sub-type, this function will return false.


RegisterSnapIn

public static boolean RegisterSnapIn(TWGSnapIn snapIn)
This method is used to register a new snap-in with the server using a TWGSnapIn object. Snap-in's are not persistent, so each time the Director server is started, the snap-in will need to be registered. If another snap-in has already been registered for the same type and sub-type, this function will return false.


DeregisterSnapIn

public static boolean DeregisterSnapIn(java.lang.String siType,
                                       java.lang.String siSubType,
                                       java.lang.String siClassName)
This method is used to deregister a snap-in from the server using a type, sub-type and class name. If a snap-in with the same type, sub-type and class name has not been registered, this function will return false.


DeregisterSnapIn

public static boolean DeregisterSnapIn(TWGSnapIn snapIn)
This method is used to deregister a snap-in from the server using a TWGSnapIn object. If a snap-in with the same type, sub-type and class name has not been registered, this function will return false.


initialize

public static void initialize()
This method is used to initialize the snap-in manager. It is called by the Director server engine during startup.


terminate

public static void terminate()
This method is used by the Director server engine to clean-up the snap-in manager.


getSnapInListForType

public static Vect getSnapInListForType(java.lang.String siType)
This static method is used to get a list of snap-in's that have been registered for a specific type. The returned Vect object is a collection of TWGSnapIn objects.


getSnapInForSubType

public static TWGSnapIn getSnapInForSubType(java.lang.String siType,
                                            java.lang.String siSubType)
This static method is used to get a snap-in that has been registered for a specific type and sub-type. If a snap-in has been registred for the given type and sub-type, the TWGSnapIn object will be returned. If a snap-in has not been registered for the give type and sub-type, then this function returns null.


loadSnapInForSubType

public static java.lang.Object loadSnapInForSubType(java.lang.String siType,
                                                    java.lang.String siSubType)
This method is used to return an instance of a snap-in that has been registered for a specific type and sub-type. If a snap-in has been registred for the given type and sub-type, the snap-in class is loaded, newInstance is called and the resulting object is returned. If a snap-in has not been registered for the give type and sub-type, then this function returns null;


loadSnapIn

public static java.lang.Object loadSnapIn(TWGSnapIn si)
This method is used to return an instance of a snap-in. The snap-in class is loaded, newInstance is called and the resulting object is returned. If an instance of the snap-in cannot be created, then this function returns null.


CommandReceived

public boolean CommandReceived(ServiceNode sn,
                               Command cmd)
This method is used internally to process commands received from the TWGRemoteSnapInManager running on the console.

Specified by:
CommandReceived in interface CommandReceivedListener
Parameters:
sn - - ServiceNode instance which received Command
cmd - - Instance of Command received
Returns:
true if ServiceNode should stay active, false if it should terminate

appendClassPath

public static boolean appendClassPath(java.lang.String path)
This method is used to add a new path to the CLASSPATH used when searching for resources and classes. If the new path is already in the CLASSPATH, then this function returns null. The new CLASSPATH is only used when loading and creating instances of snap-in objects.