|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader java.security.SecureClassLoader java.net.URLClassLoader javax.management.loading.MLet
URL classloader capable of parsing an MLet text file adhering to the file format defined in the JMX specification (v1.0).
MLetMBean
,
Serialized FormConstructor Summary | |
MLet()
|
|
MLet(URL[] urls)
|
|
MLet(URL[] urls,
boolean delegateToCLR)
|
|
MLet(URL[] urls,
ClassLoader parent)
|
|
MLet(URL[] urls,
ClassLoader parent,
boolean delegateToCLR)
|
|
MLet(URL[] urls,
ClassLoader parent,
URLStreamHandlerFactory factory)
|
|
MLet(URL[] urls,
ClassLoader parent,
URLStreamHandlerFactory factory,
boolean delegateToCLR)
|
Method Summary | |
void |
addURL(String url)
Adds the given URL to the MLet's classpath. |
void |
addURL(URL url)
Adds the given URL to the MLet's classpath. |
protected URL |
check(String version,
URL codebase,
String jarfile,
javax.management.loading.MLetContent mlet)
This method is to be overridden when extending this service to support caching and versioning. |
protected Class |
findClass(String name)
|
protected String |
findLibrary(String libname)
|
String |
getLibraryDirectory()
|
Set |
getMBeansFromURL(String url)
Loads an MLET text file from a given url. |
Set |
getMBeansFromURL(URL url)
Loads an MLET text file from a given url. |
URL[] |
getURLs()
Returns the search path of URLs for loading classes and resources. |
protected Class |
loadClass(String name,
boolean resolve)
|
Class |
loadClass(String name,
ClassLoaderRepository clr)
Load a class, using the given ClassLoaderRepository if the class is not found in this MLet's URLs. |
void |
postDeregister()
This method is called by the MBeanServer after deregistration takes place. |
void |
postRegister(Boolean registrationDone)
This method is called by the MBeanServer after registration takes place or when registration fails. |
void |
preDeregister()
This method is called by the MBeanServer before deregistration takes place. |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
This method is called by the MBeanServer before registration takes place. |
void |
readExternal(ObjectInput in)
This implementation does not support externalizing an MLet. |
void |
setLibraryDirectory(String libdir)
|
void |
writeExternal(ObjectOutput out)
This implementation does not support externalizing an MLet. |
Methods inherited from class java.net.URLClassLoader |
definePackage, findResource, findResources, getPermissions, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
defineClass |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.management.loading.MLetMBean |
getResource, getResourceAsStream, getResources |
Constructor Detail |
public MLet()
public MLet(URL[] urls)
public MLet(URL[] urls, ClassLoader parent)
public MLet(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory)
public MLet(URL[] urls, boolean delegateToCLR)
public MLet(URL[] urls, ClassLoader parent, boolean delegateToCLR)
public MLet(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory, boolean delegateToCLR)
Method Detail |
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
MBeanRegistration
The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preRegister
in interface MBeanRegistration
Exception
- for any error, the MBean is not registered.public void postRegister(Boolean registrationDone)
MBeanRegistration
postRegister
in interface MBeanRegistration
registrationDone
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws Exception
MBeanRegistration
The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
MBeanRegistration
postDeregister
in interface MBeanRegistration
public Set getMBeansFromURL(String url) throws ServiceNotFoundException
MLetMBean
getMBeansFromURL
in interface MLetMBean
url
- url to load the MLET text file from
ServiceNotFoundException
- if the given URL is malformed, or the
given MLET text file cannot be found, or the given text file
does not contain an <MLET> tag or one of the specified
mandatory attributes (see the JMX specification for a list of
mandatory attributes in an MLET text file).public Set getMBeansFromURL(URL url) throws ServiceNotFoundException
MLetMBean
getMBeansFromURL
in interface MLetMBean
url
- url to load the MLET text file from
ServiceNotFoundException
- if the
given MLET text file cannot be found, or the given text file
does not contain an <MLET> tag or one of the specified
mandatory attributes (see the JMX specification for a list of
mandatory attributes in an MLET text file).public void addURL(URL url)
MLetMBean
public void addURL(String url) throws ServiceNotFoundException
MLetMBean
url
- url
ServiceNotFoundException
- if the given URL is malformedpublic URL[] getURLs()
public String getLibraryDirectory()
getLibraryDirectory
in interface MLetMBean
public void setLibraryDirectory(String libdir)
setLibraryDirectory
in interface MLetMBean
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException, UnsupportedOperationException
readExternal
in interface Externalizable
public void writeExternal(ObjectOutput out) throws IOException, UnsupportedOperationException
writeExternal
in interface Externalizable
public Class loadClass(String name, ClassLoaderRepository clr) throws ClassNotFoundException
name
- clr
-
ClassNotFoundException
protected URL check(String version, URL codebase, String jarfile, javax.management.loading.MLetContent mlet) throws Exception
version
- codebase
- jarfile
- mlet
-
Exception
protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
ClassNotFoundException
protected Class findClass(String name) throws ClassNotFoundException
ClassNotFoundException
protected String findLibrary(String libname)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |