com.sun.jaw.impl.agent.services.mlet
Class LauncherSrv

java.lang.Object
  |
  +--com.sun.jaw.impl.agent.services.mlet.LauncherSrv

public class LauncherSrv
extends java.lang.Object
implements java.io.Serializable

This class will demand the MLet Service to load all the HTML files contained in a specific directory. If the initCmf method of the object is called, the MLet Service used will be the one registered within the repository with the following ObjectName:

The default path used by the service to look for files is specified in the following order:

  1. The value of the path property in the object name you give to the service.
  2. The value of the jaw.launcher.path property.
  3. The returned value of getEtcDir("launch") in class DefaultPaths.

The service will load the files using alphanumeric ordering.

It is possible to specify a path containing several directories. To do so, use the path separator specific to the platform on which you are running the agent (check the path.separator property).

See Also:
Serialized Form

Constructor Summary
LauncherSrv()
          Default constructor.
LauncherSrv(MLetSrv mletSrv)
          Creates a launching service.
LauncherSrv(MLetSrv mletSrv, java.lang.String path)
          Creates a launching service with a specific path.
 
Method Summary
static java.lang.String getClassVersion()
          Gets the version of this class.
 MLetSrv getMLetSrv()
          Gets the reference to the mlet service invoked for loading.
 java.lang.String getMLetSrvObjectName()
          Gets the String representing the ObjectName of the mlet service invoked for loading.
 java.lang.String getPath()
          Gets the path used by the service for loading the HTML files.
 java.lang.ThreadGroup getThreadGroup()
          Gets the thread group used for creating the threads.
 void initCmf(Framework cmf, ObjectName name, boolean db, ModificationList list)
          Initializes the Launcher Service.
 void performLaunch()
          Loads the content of the path.
 void setMLetSrv(MLetSrv mlet)
          Sets direct reference to the mlet service to use.
 void setMLetSrvObjectName(java.lang.String mlet)
          Sets the String representing the ObjectName of the mlet service to use.
 void setPath(java.lang.String path)
          Sets the path used by the service for loading the HTML files.
 void setThreadGroup(java.lang.ThreadGroup threadGroup)
          Sets the thread group to use when creating the threads for loading.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LauncherSrv

public LauncherSrv()
Default constructor. Default path will be used.

LauncherSrv

public LauncherSrv(MLetSrv mletSrv)
Creates a launching service.
Parameters:
mletSrv - The reference to the mlet service to invoke.

LauncherSrv

public LauncherSrv(MLetSrv mletSrv,
                   java.lang.String path)
Creates a launching service with a specific path.
Parameters:
mletSrv - The reference to the mlet service to invoke.
path - The path to look for the HTML files.
Method Detail

initCmf

public void initCmf(Framework cmf,
                    ObjectName name,
                    boolean db,
                    ModificationList list)
             throws InstanceAlreadyExistException
Initializes the Launcher Service. The method will declare the object to the Core Management Framework.
This method is not intent to be called directly by the user.
Parameters:
cmf - The core management framework to register the service with.
name - The object name containing configuration information.
db - Indicates if persistent storage is required.
list - The modification list to use for setting up parameters.
Throws:
InstanceAlreadyExistException - The m-bean is already registered in the repository.

performLaunch

public void performLaunch()
                   throws ServiceNotFoundException
Loads the content of the path. The method will ask the mlet service associated to the launcher to load all the files contained in a given path.
If there is no mlet service associated, a ServiceNotFoundException is thrown. If an objet name for the mlet is given, it has precedence over a direct reference to a mlet object.
Every single loading is invoked in a separate thread. All the created threads are created in the same ThreadGroup. They are named using the directory name currently loaded.
Throws:
ServiceNotFoundException - The MLet Service couldn't be found.
See Also:
getThreadGroup(), setThreadGroup(java.lang.ThreadGroup)

getPath

public java.lang.String getPath()
Gets the path used by the service for loading the HTML files.
Returns:
The path used by the service.

setPath

public void setPath(java.lang.String path)
Sets the path used by the service for loading the HTML files.
Parameters:
path - The path string.

getMLetSrvObjectName

public java.lang.String getMLetSrvObjectName()
Gets the String representing the ObjectName of the mlet service invoked for loading. If the mlet to use was specified using a direct reference to the service through the setMLetSrv method, this method will return null.
Returns:
The String representing the ObjectName of the mlet service.

setMLetSrvObjectName

public void setMLetSrvObjectName(java.lang.String mlet)
Sets the String representing the ObjectName of the mlet service to use. Such a mlet has precedence over an mlet service registered using the setMLetSrv method.
Parameters:
mlet - The String representing the ObjectName of the mlet service.

getMLetSrv

public MLetSrv getMLetSrv()
Gets the reference to the mlet service invoked for loading.
Returns:
The reference to the mlet service.

setMLetSrv

public void setMLetSrv(MLetSrv mlet)
Sets direct reference to the mlet service to use.
Parameters:
mlet - The mlet service.
See Also:
setMLetSrvObjectName(java.lang.String)

getClassVersion

public static java.lang.String getClassVersion()
Gets the version of this class.
Returns:
The version of this class.

getThreadGroup

public java.lang.ThreadGroup getThreadGroup()
Gets the thread group used for creating the threads.
Returns:
The thread group.

setThreadGroup

public void setThreadGroup(java.lang.ThreadGroup threadGroup)
Sets the thread group to use when creating the threads for loading.
Parameters:
threadGroup - The thread group to use.