Java Doc for MLet.java in  » JMX » XMOJO » javax » management » loading » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » JMX » XMOJO » javax.management.loading 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.net.URLClassLoader
   javax.management.loading.MLet

MLet
public class MLet extends URLClassLoader implements MLetMBean,MBeanRegistration(Code)
This MLet service allows to instantiate and register one or several MBeans in the MBean server coming from a remote URL. M-let is a shortcut for management applet. The m-let service does this by loading an m-let text file, which specifies information on the MBeans to be obtained. The information on each MBean is specified in a single instance of a tag, called the MLET tag. The location of the m-let text file is specified by a URL.

The MLET tag has the following syntax:

<MLET
CODE = class | OBJECT = serfile
ARCHIVE = "archiveList"
[CODEBASE = codebaseURL]
[NAME = mbeanname]
[VERSION = version]
>
[arglist]
</MLET>

where:

CODE = class
This attribute specifies the full Java class name, including package name, of the MBean to be obtained. The compiled .class file of the MBean must be contained in one of the .jar files specified by the ARCHIVE attribute. Either CODE or OBJECT must be present.
OBJECT = serfile
This attribute specifies the .ser file that contains a serialized representation of the MBean to be obtained. This file must be contained in one of the .jar files specified by the ARCHIVE attribute. If the .jar file contains a directory hierarchy, specify the path of the file within this hierarchy. Otherwise a match will not be found. Either CODE or OBJECT must be present.
ARCHIVE = "archiveList"
This mandatory attribute specifies one or more .jar files containing MBeans or other resources used by the MBean to be obtained. One of the .jar files must contain the file specified by the CODE or OBJECT attribute. If archivelist contains more than one file:
  • Each file must be separated from the one that follows it by a comma (,).
  • archivelist must be enclosed in double quote marks.
All .jar files in archivelist must be stored in the directory specified by the code base URL.
CODEBASE = codebaseURL
This optional attribute specifies the code base URL of the MBean to be obtained. It identifies the directory that contains the .jar files specified by the ARCHIVE attribute. Specify this attribute only if the .jar files are not in the same directory as the m-let text file. If this attribute is not specified, the base URL of the m-let text file is used.
NAME = mbeanname
This optional attribute specifies the object name to be assigned to the MBean instance when the m-let service registers it. If mbeanname starts with the colon character (:), the domain part of the object name is the domain of the agent. The m-let service invokes the getDomain() method of the Framework class to obtain this information.
VERSION = version
This optional attribute specifies the version number of the MBean and associated .jar files to be obtained. This version number can be used to specify that the .jar files are loaded from the server to update those stored locally in the cache the next time the m-let text file is loaded. version must be a series of non-negative decimal integers each separated by a period from the one that precedes it.
arglist
This optional attribute specifies a list of one or more parameters for the MBean to be instantiated. This list describes the parameters to be passed the MBean's constructor. Use the following syntax to specify each item in arglist:

<ARG TYPE=argumentType VALUE=value>

where:
  • argumentType is the type of the argument that will be passed as parameter to the MBean's constructor.

The arguments' type in the argument list should be a Java primitive type or a Java basic type (java.lang.Boolean, java.lang.Byte, java.lang.Short, java.lang.Long, java.lang.Integer, java.lang.Float, java.lang.Double, java.lang.String).

When an m-let text file is loaded, an instance of each MBean specified in the file is created and registered.

The m-let Service extends the java.net.URLClassLoader and can be used to load remote classes and jar files in the VM of the agent.

Note - The MLet class loader uses the javax.management.loading.DefaultLoaderRepository DefaultLoaderRepository to load classes that could not be found in the loaded jar files.



Field Summary
protected  VectormletList
    
protected  MBeanServerserver
    
 booleanuseDefaultLoader
    

Constructor Summary
public  MLet()
     Constructs a new MLet using the default delegation parent ClassLoader.
public  MLet(URL[] urls)
     Constructs a new MLet for the specified URLs using the default delegation parent ClassLoader.
public  MLet(URL[] urls, ClassLoader parent)
     Constructs a new MLet for the given URLs.
public  MLet(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory)
     Constructs a new MLet for the specified URLs, parent class loader, and URLStreamHandlerFactory.

Method Summary
public  voidaddURL(String url)
     Appends the specified URL to the list of URLs to search for classes and resources.
public  voidaddURL(URL url)
     Appends the specified URL to the list of URLs to search for classes and resources.
protected synchronized  java.lang.ClassfindClass(java.lang.String name)
     This is the main method for class loaders that is being redefined.
Parameters:
  name - The name of the class.
synchronized  ClassfindClassInMLet(String name)
    
protected  StringfindLibrary(String libname)
     Returns the absolute path name of a native library.
public  StringgetLibraryDirectory()
     Gets the current directory used by the library loader for storing native libraries before they are loaded into memory.
public  SetgetMBeansFromURL(String url)
     Loads a text file containing MLET tags that define the MBeans to be added to the agent.
public  SetgetMBeansFromURL(URL url)
     Loads a text file containing MLET tags that define the MBeans to be added to the agent.
public  URL[]getURLs()
     Returns the search path of URLs for loading classes and resources.
public  voidpostDeregister()
     Allows the m-let to perform any operations needed after having been de-registered in the MBeanServer.
public  voidpostRegister(Boolean registrationDone)
     Allows the m-let to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.
Parameters:
  registrationDone - - Indicates whether or not the m-let has beensuccessfully registered in the MBeanServer.
public  voidpreDeregister()
     Allows the m-let to perform any operations it needs before being de-registered by the MBeanServer.
public  ObjectNamepreRegister(MBeanServer server, ObjectName name)
     This method allows the m-let to perform any operations it needs before being registered in the MBeanServer.
public  voidreadExternal(java.io.ObjectInput in)
     This method reads the objects contents during Object Serialization.
public  voidsetLibraryDirectory(String libDir)
     Sets the directory used by the library loader for storing native libraries before they are loaded into memory.
 voidsetUseDefaultLoader(boolean flag)
    
public  voidwriteExternal(java.io.ObjectOutput out)
     This method saves the objects contents during Object Serialization.

Field Detail
mletList
protected Vector mletList(Code)



server
protected MBeanServer server(Code)



useDefaultLoader
boolean useDefaultLoader(Code)




Constructor Detail
MLet
public MLet()(Code)
Constructs a new MLet using the default delegation parent ClassLoader.



MLet
public MLet(URL[] urls)(Code)
Constructs a new MLet for the specified URLs using the default delegation parent ClassLoader. The URLs will be searched in the order specified for classes and resources after first searching in the parent class loader.
Parameters:
  urls - the URLs from which to load classes and resources



MLet
public MLet(URL[] urls, ClassLoader parent)(Code)
Constructs a new MLet for the given URLs. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader. URLStreamHandlerFactory. The parent argument will be used as the parent class loader for delegation. The factory argument will be used as the stream handler factory to obtain protocol handlers when creating new URLs.
Parameters:
  urls - the URLs from which to load classes and resources
Parameters:
  parent - the parent class loader for delegation



MLet
public MLet(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory)(Code)
Constructs a new MLet for the specified URLs, parent class loader, and URLStreamHandlerFactory. The parent argument will be used as the parent class loader for delegation. The factory argument will be used as the stream handler factory to obtain protocol handlers when creating new URLs.
Parameters:
  urls - - the URLs from which to load classes and resources
Parameters:
  parent - - the parent class loader for delegation
Parameters:
  factory - - the URLStreamHandlerFactory to use when creating URLs




Method Detail
addURL
public void addURL(String url) throws ServiceNotFoundException(Code)
Appends the specified URL to the list of URLs to search for classes and resources.
Parameters:
  url - The url from which to load the MBeans in a string format.
exception:
  javax.management.ServiceNotFoundException - - The specifiedURL is malformed.



addURL
public void addURL(URL url)(Code)
Appends the specified URL to the list of URLs to search for classes and resources.
Parameters:
  url - The url from which to load the MBeans in a string format.



findClass
protected synchronized java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundException(Code)
This is the main method for class loaders that is being redefined.
Parameters:
  name - The name of the class. The resulting Class object.
exception:
  java.lang.ClassNotFoundException - The specified classcould not be found.



findClassInMLet
synchronized Class findClassInMLet(String name) throws ClassNotFoundException(Code)



findLibrary
protected String findLibrary(String libname)(Code)
Returns the absolute path name of a native library. The VM invokes this method to locate the native libraries that belong to classes loaded with this class loader. Libraries are searched in the JAR files using first just the native library name and if not found the native library name together with the architecture-specific path name (OSName/OSArch/OSVersion/lib/nativelibname), i.e.

the library stat on Solaris SPARC 5.7 will be searched in the JAR file as:

  1. libstat.so
  2. SunOS/sparc/5.7/lib/libstat.so
the library stat on Windows NT 4.0 will be searched in the JAR file as:
  1. stat.dll
  2. WindowsNT/x86/4.0/lib/stat.dll
If this method returns null, i.e. the libraries were not found in any of the JAR files loaded with this class loader, the VM searches the library along the path specified as the java.library.path property.
Parameters:
  libname - the library name. The absolute path of the native library.



getLibraryDirectory
public String getLibraryDirectory()(Code)
Gets the current directory used by the library loader for storing native libraries before they are loaded into memory. The current directory used by the library loader.



getMBeansFromURL
public Set getMBeansFromURL(String url) throws ServiceNotFoundException(Code)
Loads a text file containing MLET tags that define the MBeans to be added to the agent. The location of the text file is specified by a URL. The MBeans specified in the MLET file will be instantiated and registered by the MBeanServer.
Parameters:
  url - - The URL of the text file to be loaded as String object. A set containing one entry per MLET tag in the m-let text fileloaded. Each entry specifies either the ObjectInstance forthe created MBean, or a throwable object (that is, an erroror an exception) if the MBean could not be created.
exception:
  javax.management.ServiceNotFoundException - - One of thefollowing errors has occurred:The m-let text file does not contain an MLET tag,the m-let text file is not found,a mandatory attribute of the MLET tag is not specified,the url is malformed.
See Also:   MLetMBean.getMBeansFromURL(String)



getMBeansFromURL
public Set getMBeansFromURL(URL url) throws ServiceNotFoundException(Code)
Loads a text file containing MLET tags that define the MBeans to be added to the agent. The location of the text file is specified by a URL. The MBeans specified in the MLET file will be instantiated and registered by the MBeanServer.
Parameters:
  url - - The URL of the text file to be loaded as URL object. A set containing one entry per MLET tag in the m-let text fileloaded. Each entry specifies either the ObjectInstance forthe created MBean, or a throwable object (that is, anerror or an exception) if the MBean could not be created.
exception:
  javax.management.ServiceNotFoundException - - One of thefollowing errors has occurred:The m-let text file does not contain an MLET tag,the m-let text file is not found,a mandatory attribute of the MLET tag is not specified,the value of url is null.
See Also:   MLetMBean.getMBeansFromURL(URL)



getURLs
public URL[] getURLs()(Code)
Returns the search path of URLs for loading classes and resources. This includes the original list of URLs specified to the constructor, along with any URLs subsequently appended by the addURL() method. This returns the search path of URLs for loading classesand resources
See Also:   MLetMBean.getURLs



postDeregister
public void postDeregister()(Code)
Allows the m-let to perform any operations needed after having been de-registered in the MBeanServer.
See Also:   MBeanRegistration.postDeregister



postRegister
public void postRegister(Boolean registrationDone)(Code)
Allows the m-let to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.
Parameters:
  registrationDone - - Indicates whether or not the m-let has beensuccessfully registered in the MBeanServer. The valuefalse means that either the registration phase has failed.
See Also:   MBeanRegistration.postRegister(Boolean)



preDeregister
public void preDeregister() throws Exception(Code)
Allows the m-let to perform any operations it needs before being de-registered by the MBeanServer.
exception:
  java.langException - - This exception should be caught by theMBeanServer and re-thrown as an MBeanRegistrationException.
See Also:   MBeanRegistration.preDeregister



preRegister
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code)
This method allows the m-let to perform any operations it needs before being registered in the MBeanServer. If the ObjectName is null, the m-let provides a default name for its registration :service=MLet
Parameters:
  server - - The MBeanServer in which the m-let will be registered.
Parameters:
  name - - The object name of the m-let. The name of the m-let registered.
exception:
  java.lang.Exception - - This exception should be caught by theMBeanServer and re-thrown as an MBeanRegistrationException.
See Also:   MBeanRegistration.preRegister(MBeanServerObjectName)



readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException(Code)
This method reads the objects contents during Object Serialization.
Parameters:
  in - The serialization input stream.
exception:
  java.io.IOException - Signals that an I/O exception of somesort has occurred.
exception:
  java.lang.ClassNotFoundException - The class for an objectbeing restored cannot be found.



setLibraryDirectory
public void setLibraryDirectory(String libDir)(Code)
Sets the directory used by the library loader for storing native libraries before they are loaded into memory.
Parameters:
  libDir - The directory used by the library loader.



setUseDefaultLoader
void setUseDefaultLoader(boolean flag)(Code)



writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException(Code)
This method saves the objects contents during Object Serialization.
Parameters:
  out - The serialization output stream.
exception:
  java.io.IOException - Signals that an I/O exception of somesort has occurred.



Methods inherited from java.net.URLClassLoader
protected void addURL(URL url)(Code)(Java Doc)
protected Package definePackage(String name, Manifest man, URL url) throws IllegalArgumentException(Code)(Java Doc)
protected Class findClass(String name) throws ClassNotFoundException(Code)(Java Doc)
public URL findResource(String name)(Code)(Java Doc)
public Enumeration<URL> findResources(String name) throws IOException(Code)(Java Doc)
protected PermissionCollection getPermissions(CodeSource codesource)(Code)(Java Doc)
public URL[] getURLs()(Code)(Java Doc)
public static URLClassLoader newInstance(URL[] urls, ClassLoader parent)(Code)(Java Doc)
public static URLClassLoader newInstance(URL[] urls)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.