Java Doc for MBeanServerFactory.java in  » JMX » jfoxmx » javax » management » 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 » jfoxmx » javax.management 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.management.MBeanServerFactory

MBeanServerFactory
public class MBeanServerFactory (Code)

Provides MBean server references. There are no instances of this class.

Since JMX 1.2 this class makes it possible to replace the default MBeanServer implementation. This is done using the javax.management.MBeanServerBuilder class. The class of the initial MBeanServerBuilder to be instantiated can be specified through the javax.management.builder.initial system property. The specified class must be a public subclass of javax.management.MBeanServerBuilder , and must have a public empty constructor.

By default, if no value for that property is specified, an instance of javax.management.MBeanServerBuilder javax.management.MBeanServerBuilder is created. Otherwise, the MBeanServerFactory attempts to load the specified class using java.lang.Thread.getContextClassLoaderThread.currentThread().getContextClassLoader() , or if that is null, java.lang.Class.forName(java.lang.String) Class.forName() . Then it creates an initial instance of that Class using java.lang.Class.newInstance . If any checked exception is raised during this process (e.g. java.lang.ClassNotFoundException , java.lang.InstantiationException ) the MBeanServerFactory will propagate this exception from within a RuntimeException.

The javax.management.builder.initial system property is consulted every time a new MBeanServer needs to be created, and the class pointed to by that property is loaded. If that class is different from that of the current MBeanServerBuilder, then a new MBeanServerBuilder is created. Otherwise, the MBeanServerFactory may doCreate a new MBeanServerBuilder or reuse the current one.

If the class pointed to by the property cannot be loaded, or does not correspond to a valid subclass of MBeanServerBuilder then an exception is propagated, and no MBeanServer can be created until the javax.management.builder.initial system property is reset to valid value.

The MBeanServerBuilder makes it possible to wrap the MBeanServers returned by the default MBeanServerBuilder implementation, for the purpose of e.g. adding an additional security layer.


author:
   Young Yang




Method Summary
public static  MBeanServercreateMBeanServer()
    

Return a new object implementing the MBeanServer interface with a standard default domain name.

public static synchronized  MBeanServercreateMBeanServer(String domain)
    

Return a new object implementing the MBeanServer interface with the specified default domain name.

public static synchronized  ArrayListfindMBeanServer(String agentId)
    

Return a list of registered MBeanServer objects.

public static  ClassLoaderRepositorygetClassLoaderRepository(MBeanServer mbeanServer)
     Return the ClassLoaderRepository used by the given MBeanServer. This method is equivalent to MBeanServer.getClassLoaderRepository server.getClassLoaderRepository() .
Parameters:
  mbeanServer - The MBeanServer under examination.
public static  MBeanServernewMBeanServer()
    

Return a new object implementing the MBeanServer interface with a standard default domain name, without keeping an internal reference to this new object.

public static synchronized  MBeanServernewMBeanServer(String domain)
    

Return a new object implementing the MBeanServer interface with the specified default domain name, without keeping an internal reference to this new object.

public static synchronized  voidreleaseMBeanServer(MBeanServer mbeanServer)
     Remove internal MBeanServerFactory references to a created MBeanServer.



Method Detail
createMBeanServer
public static MBeanServer createMBeanServer()(Code)

Return a new object implementing the MBeanServer interface with a standard default domain name. The default domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.

The standard default domain name is defined in com.sun.jmx.defaults.ServiceName.DOMAIN ServiceName.DOMAIN .

The MBeanServer reference is internally kept. This will allow findMBeanServer to return a reference to this MBeanServer object.

This method is equivalent to createMBeanServer(null). the newly created MBeanServer.
exception:
  SecurityException - if there is a SecurityManager and thecaller's permissions do not include or imply MBeanServerPermission("createMBeanServer").
exception:
  JMRuntimeException - if the propertyjavax.management.builder.initial exists but theclass it names cannot be instantiated through a publicno-argument constructor; or if the instantiated builder returnsnull from its MBeanServerBuilder.newMBeanServerDelegatenewMBeanServerDelegate or MBeanServerBuilder.newMBeanServer newMBeanServer methods.
exception:
  ClassCastException - if the propertyjavax.management.builder.initial exists and can beinstantiated but is not assignment compatible with MBeanServerBuilder.




createMBeanServer
public static synchronized MBeanServer createMBeanServer(String domain)(Code)

Return a new object implementing the MBeanServer interface with the specified default domain name. The given domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.

The MBeanServer reference is internally kept. This will allow findMBeanServer to return a reference to this MBeanServer object.


Parameters:
  domain - the default domain name for the createdMBeanServer. This is the value that will be returned by MBeanServer.getDefaultDomain. the newly created MBeanServer.
exception:
  SecurityException - if there is a SecurityManager andthe caller's permissions do not include or imply MBeanServerPermission("createMBeanServer").
exception:
  JMRuntimeException - if the propertyjavax.management.builder.initial exists but theclass it names cannot be instantiated through a publicno-argument constructor; or if the instantiated builder returnsnull from its MBeanServerBuilder.newMBeanServerDelegatenewMBeanServerDelegate or MBeanServerBuilder.newMBeanServer newMBeanServer methods.
exception:
  ClassCastException - if the propertyjavax.management.builder.initial exists and can beinstantiated but is not assignment compatible with MBeanServerBuilder.



findMBeanServer
public static synchronized ArrayList findMBeanServer(String agentId)(Code)

Return a list of registered MBeanServer objects. A registered MBeanServer object is one that was created by one of the createMBeanServer methods and not subsequently released with releaseMBeanServer.


Parameters:
  agentId - The agent identifier of the MBeanServer toretrieve. If this parameter is null, all registeredMBeanServers in this JVM are returned. Otherwise, onlyMBeanServers whose id is equal to agentId arereturned. The id of an MBeanServer is theMBeanServerId attribute of its delegate MBean. A list of MBeanServer objects.
exception:
  SecurityException - if there is a SecurityManager and thecaller's permissions do not include or imply MBeanServerPermission("findMBeanServer").



getClassLoaderRepository
public static ClassLoaderRepository getClassLoaderRepository(MBeanServer mbeanServer)(Code)
Return the ClassLoaderRepository used by the given MBeanServer. This method is equivalent to MBeanServer.getClassLoaderRepository server.getClassLoaderRepository() .
Parameters:
  mbeanServer - The MBeanServer under examination. Since JMX 1.2,if server is null, the result is aNullPointerException. This behaviour differs from whatwas implemented in JMX 1.1 - where the possibility to usenull was deprecated. The Class Loader Repository used by the given MBeanServer.
exception:
  SecurityException - if there is a SecurityManager andthe caller's permissions do not include or imply MBeanPermission("getClassLoaderRepository").
exception:
  NullPointerException - if server is null.



newMBeanServer
public static MBeanServer newMBeanServer()(Code)

Return a new object implementing the MBeanServer interface with a standard default domain name, without keeping an internal reference to this new object. The default domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.

The standard default domain name is defined in com.sun.jmx.defaults.ServiceName.DOMAIN ServiceName.DOMAIN .

No reference is kept. findMBeanServer will not be able to return a reference to this MBeanServer object, but the garbage collector will be able to remove the MBeanServer object when it is no longer referenced.

This method is equivalent to newMBeanServer(null).

the newly created MBeanServer.
exception:
  SecurityException - if there is a SecurityManager and thecaller's permissions do not include or imply MBeanServerPermission("newMBeanServer").
exception:
  JMRuntimeException - if the propertyjavax.management.builder.initial exists but theclass it names cannot be instantiated through a publicno-argument constructor; or if the instantiated builder returnsnull from its MBeanServerBuilder.newMBeanServerDelegatenewMBeanServerDelegate or MBeanServerBuilder.newMBeanServer newMBeanServer methods.
exception:
  ClassCastException - if the propertyjavax.management.builder.initial exists and can beinstantiated but is not assignment compatible with MBeanServerBuilder.



newMBeanServer
public static synchronized MBeanServer newMBeanServer(String domain)(Code)

Return a new object implementing the MBeanServer interface with the specified default domain name, without keeping an internal reference to this new object. The given domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.

No reference is kept. findMBeanServer will not be able to return a reference to this MBeanServer object, but the garbage collector will be able to remove the MBeanServer object when it is no longer referenced.


Parameters:
  domain - the default domain name for the createdMBeanServer. This is the value that will be returned by MBeanServer.getDefaultDomain. the newly created MBeanServer.
exception:
  SecurityException - if there is a SecurityManager and thecaller's permissions do not include or imply MBeanServerPermission("newMBeanServer").
exception:
  JMRuntimeException - if the propertyjavax.management.builder.initial exists but theclass it names cannot be instantiated through a publicno-argument constructor; or if the instantiated builder returnsnull from its MBeanServerBuilder.newMBeanServerDelegatenewMBeanServerDelegate or MBeanServerBuilder.newMBeanServer newMBeanServer methods.
exception:
  ClassCastException - if the propertyjavax.management.builder.initial exists and can beinstantiated but is not assignment compatible with MBeanServerBuilder.



releaseMBeanServer
public static synchronized void releaseMBeanServer(MBeanServer mbeanServer)(Code)
Remove internal MBeanServerFactory references to a created MBeanServer. This allows the garbage collector to remove the MBeanServer object.
Parameters:
  mbeanServer - the MBeanServer object to remove.
exception:
  java.lang.IllegalArgumentException - ifmbeanServer was not generated by one of thecreateMBeanServer methods, or ifreleaseMBeanServer was already called on it.
exception:
  SecurityException - if there is a SecurityManager andthe caller's permissions do not include or imply MBeanServerPermission("releaseMBeanServer").



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.