|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sun.jaw.impl.agent.services.mlet.MLetSrv
This class provides an implementation of the management applet or m-let
service. The m-let service enables an agent to obtain m-beans remotely. The agent
does this by loading a text file stored remotely that specifies information on
the m-beans to be obtained. The location of the text file is specified by a URL.
The information on each m-bean to be obtained is specified in a single instance of a
tag, called the MLET tag. When a text file is loaded,
each m-bean specified in the file is instantiated.
Registering an m-bean with the Core Management Framework
An m-bean instantiated by the m-let service is registered in one of the following ways:
initCmf method is defined for the
m-bean, the m-let service invokes it to register the m-bean. The value of the NAME
attribute in the MLET tag is passed to this method as the ObjectName
argument.
initCmf method is not defined for the
m-bean, but the NAME attribute of the MLET tag is specified,
the m-let service invokes the addObject or addDBObject method of the
framework class to
register the m-bean depending on the value of the PERSISTENT attribute in the MLET tag.
initCmf method is not defined for the
m-bean, and the NAME attribute of the MLET tag is not specified,
the m-let service does not invoke a method for registering the m-bean. In this case, it is
still possible to register the m-bean. To do this, invoke the addObject or
addDBObject method of the
framework class for each
entry in the vector returned by the performLocalLoadURL method.
This is possible only within the code of an agent, not within the
code of a manager.Remote Library Loading
The library loader uses the local file system to copy the libraries coming from the remote server before they are loaded into memory.
The default value for the library directory is specified in the following order:
jaw.mlet.library.dir property.
getTmpDir() in class DefaultPaths.
MLet, Serialized Form| Field Summary | |
protected Framework |
cmf
The reference to the core management framework. |
protected java.util.Vector |
mletList
The list of instances of the MLet class found at the specified URL. |
| Constructor Summary | |
MLetSrv()
Instantiates the m-let service. |
|
| Method Summary | |
protected java.net.URL |
check(java.lang.String version,
java.net.URL codebase,
java.lang.String jarfile,
MLet mlet)
This method is to be overridden when extending this service to support caching and versioning. |
void |
deleteCmf()
Removes all the MLetClassLoaders from the framework and deletes the m-let service. |
static java.lang.String |
getClassVersion()
Gets the version of this class. |
java.lang.String |
getLibraryDirectory()
Gets the current directory used by the library loader for storing native libraries before they are loaded into memory. |
void |
initCmf(Framework cmf,
ObjectName name,
boolean db,
ModificationList list)
Initializes the m-let service and registers it with the core management framework. |
java.net.URL |
performGetResource(java.lang.String codebase,
java.lang.String resource)
Gets the URL of a resource. |
java.net.URL |
performGetResource(java.net.URL codebase,
java.lang.String resource)
Gets the URL of a resource. |
java.io.InputStream |
performGetResourceAsStream(java.lang.String codebase,
java.lang.String resource)
Gets an input stream for a resource. |
java.io.InputStream |
performGetResourceAsStream(java.net.URL codebase,
java.lang.String resource)
Gets an input stream for a resource. |
void |
performLoadURL(java.lang.String url)
Loads a text file containing MLET tags that define the m-beans to be added to the agent. |
void |
performLoadURL(java.net.URL url)
Loads a text file containing MLET tags that define the m-beans to be added to the agent. |
java.util.Vector |
performLocalLoadURL(java.lang.String url)
Loads a text file containing MLET tags that define the m-beans to be added to the agent. |
java.util.Vector |
performLocalLoadURL(java.net.URL url)
Loads a text file containing MLET tags that define the m-beans to be added to the agent. |
java.util.Vector |
performRemoteLoadURL(java.lang.String url)
Loads a text file containing MLET tags that define the m-beans to be added to the agent. |
java.util.Vector |
performRemoteLoadURL(java.net.URL url)
Loads a text file containing MLET tags that define the m-beans to be added to the agent. |
void |
setLibraryDirectory(java.lang.String libdir)
Sets the directory used by the library loader for storing native libraries before they are loaded into memory. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Framework cmf
protected java.util.Vector mletList
MLet class found at the specified URL.| Constructor Detail |
public MLetSrv()
| Method Detail |
public void initCmf(Framework cmf,
ObjectName name,
boolean db,
ModificationList list)
throws InstanceAlreadyExistException
This method is not intent to be called directly by the user.
cmf - The core management framework to register the service with.name - The object name.db - Indicates if persistent storage is required.list - The modification list to use for setting up parameters.public void deleteCmf()
MLetClassLoaders from the framework and deletes the m-let service.
This method is not intent to be called directly by the user.
public void performLoadURL(java.net.URL url)
throws ServiceNotFoundException
MLET tags that define the m-beans to be added to the agent.
The location of the text file is specified by a URL.
This method is allowed in the code of an agent or a manager.
It is similar to performLocalLoadURL (allowed only in agent code)
or performRemoteLoadURL (allowed only in manager code) except that it does
not return a value.
url - The URL of the text file to be loaded.MLET tag.
MLET tag is not specified.
null.
public void performLoadURL(java.lang.String url)
throws ServiceNotFoundException
MLET tags that define the m-beans to be added to the agent.
The location of the text file is specified by a string representation of its URL.
This method is allowed in the code of an agent or a manager.
It is similar to performLocalLoadURL (allowed only in agent code)
or performRemoteLoadURL (allowed only in manager code) except that it does
not return a value.
url - A string representation of the URL of the text file to be loaded.MLET tag.
MLET tag is not specified.
null.
public java.util.Vector performLocalLoadURL(java.net.URL url)
throws ServiceNotFoundException
MLET tags that define the m-beans to be added to the agent.
The location of the text file is specified by a URL.
This method is allowed only in the code of an agent.
url - The URL of the text file to be loaded.MLET tag in the m-let text file loaded.
Each entry specifies either the reference of the m-bean instantiated, or a throwable object
(that is, an error or an exception) if the m-bean could not be instantiated.MLET tag.
MLET tag is not specified.
null.
public java.util.Vector performLocalLoadURL(java.lang.String url)
throws ServiceNotFoundException
MLET tags that define the m-beans to be added to the agent.
The location of the text file is specified by a string representation of its URL.
This method is allowed only in the code of an agent.
url - A string representation of the URL of the text file to be loaded.MLET tag in the m-let text file loaded.
Each entry specifies either the reference of the m-bean instantiated, or a throwable object
(that is, an error or an exception) if the m-bean could not be instantiated.MLET tag.
MLET tag is not specified.
null.
public java.util.Vector performRemoteLoadURL(java.net.URL url)
throws ServiceNotFoundException
MLET tags that define the m-beans to be added to the agent.
The location of the text file is specified by a URL.
This method is allowed only in the code of a manager.
url - The URL of the text file to be loaded.MLET tag in the m-let text file loaded.
Each entry specifies either an instance of class MLet
representing the parameters of the MLET tag for the m-bean instantiated, or a throwable object
(that is, an error or an exception) if the m-bean could not be instantiated.MLET tag.
MLET tag is not specified.
null.
public java.util.Vector performRemoteLoadURL(java.lang.String url)
throws ServiceNotFoundException
MLET tags that define the m-beans to be added to the agent.
The location of the text file is specified by a string representation of its URL.
This method is allowed only in the code of a manager.
url - A string representation of the URL of the text file to be loaded.MLET tag in the m-let text file loaded.
Each entry specifies either an instance of class MLet
representing the parameters of the MLET tag for the m-bean instantiated, or a throwable object
(that is, an error or an exception) if the m-bean could not be instantiated.MLET tag.
MLET tag is not specified.
null.
protected java.net.URL check(java.lang.String version,
java.net.URL codebase,
java.lang.String jarfile,
MLet mlet)
version - The version number of the .jar file stored locally.codebase - The base URL of the remote .jar file.jarfile - The name of the .jar file to be loaded.mlet - The MLet instance that represents the MLET tag..jar file is to be loaded from.
public java.net.URL performGetResource(java.net.URL codebase,
java.lang.String resource)
codebase - A URL that identifies the code base of the m-let class loader to be used.resource - The name of the resource.
public java.net.URL performGetResource(java.lang.String codebase,
java.lang.String resource)
codebase - A string that identifies the code base of the m-let class loader to be used.resource - The name of the resource.
public java.io.InputStream performGetResourceAsStream(java.net.URL codebase,
java.lang.String resource)
codebase - A URL that identifies the code base of the m-let class loader to be used.resource - The name of the resource.
public java.io.InputStream performGetResourceAsStream(java.lang.String codebase,
java.lang.String resource)
codebase - A string that identifies the code base of the m-let class loader to be used.resource - The name of the resource.public java.lang.String getLibraryDirectory()
public void setLibraryDirectory(java.lang.String libdir)
libdir - The directory used by the library loader.public static java.lang.String getClassVersion()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||