All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.sun.jaw.impl.agent.services.bootstrap.BootstrapSrv
The Bootstrap Service must be run as a standalone application and enables the loading and instantiation of an agent/manager located in a remote server by specifying a URL that contains an m-let document file.
This service makes a restricted use of the MLET tag, the parameters used by this service are the following:
<MLET
CODE = agent/manager classfile
ARCHIVE = archiveList
[CODEBASE = codebaseURL]
>
</MLET>
where:
CODE = agent/manager classfileARCHIVE = "archivelist"CODEBASE = codebaseURL
In order to be able to run the agent/manager after loading it from the remote server, the agent/manager
itself needs to implement the java.lang.Runnable interface, therefore, the Bootstrap Service
can load the class, create one instance of the class and invoke the run() method provided by
the interface. The method run() will be responsible for instantiating the framework and adding
the adaptor servers and services required by the agent being loaded or instantiating the adaptor clients
required by the manager being loaded.
Besides implementing the java.lang.Runnable interface, other thing required by a bootstrapped agent
is setting the Core Management Framework classloader to the classloader that has loaded the agent, i.e.
...
// Create an instance of Framework
Framework cmf = new Framework((MoRepSrvIf)rep, null);
// Set classloader for Framework
cmf.setClassLoader(this.getClass().getClassLoader());
...
Besides implementing the java.lang.Runnable interface, other thing required by a bootstrapped manager
is setting the adaptor client classloader to the classloader that has loaded the manager, i.e.
...
// Create an instance of AdaptorClient
AdaptorClient adaptor = new AdaptorClient();
// Set classloader for AdaptorClient
adaptor.setClassLoader(this.getClass().getClassLoader());
...
Another interesting feature of this service is that it is possible to load Java DMK, contained in a jar file, at the same time that we load and run an agent. In order to do that specify the jar file containing Java DMK as one of the jar files in the MLet tag. If we want to do this the only files needed in the machine that invokes this service are the ones contained in these packages:
if we want to use the bootstrap's built-in library loader mechanism the files contained in the following packages are also required:
and if we want to use the RMI adaptor the files contained in the following packages are also required:
NOTE: None of the files specified above can be part of the jar file containing Java Dynamic Management Kit. Remove all of them before creating the corresponding jar file for Java Dynamic Management Kit. Also note that we cannot use the persistent repository with the bootstart service.
To invoke this standalone application enter the following command in your command-line:
java com.sun.jaw.impl.agent.services.bootstrap.BootstrapSrv secure agent-URL [local-libdir]
where secure is a flag that specifies if this service is to be run in secure (true) or
unsecure (false) mode, agent-URL specifies the URL location of the m-let document file
containing the information for loading the agent and local-libdir specifies the local directory for
storing native libraries before they are loaded into memory.
If this service runs in secure mode, then only signed JAR files coming from trusted sources will be loaded. If this service runs in unsecure mode, then any JAR file signed/not-signed by a trusted/not-trusted signer will be loaded.
public BootstrapSrv(Boolean secure)
true) or unsecure (false) mode.
public static void main(String args[])
public void performLoadURL(String url)
public static String getClassVersion()
public String getLibraryDirectory()
The value of the directory defaults to /tmp (Solaris)
or <installDir>\SUNWconn\jaw\tmp (Windows NT).
public void setLibraryDirectory(String libdir)
The value of the directory defaults to /tmp (Solaris)
or <installDir>\SUNWconn\jaw\tmp (Windows NT).
All Packages Class Hierarchy This Package Previous Next Index