Java Doc for JMXConnectorFactory.java in  » 6.0-JDK-Core » management » javax » management » remote » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » management » javax.management.remote 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.management.remote.JMXConnectorFactory

JMXConnectorFactory
public class JMXConnectorFactory (Code)

Factory to create JMX API connector clients. There are no instances of this class.

Connections are usually made using the JMXConnectorFactory.connect(JMXServiceURL) connect method of this class. More advanced applications can separate the creation of the connector client, using JMXConnectorFactory.newJMXConnector(JMXServiceURL,Map)newJMXConnector and the establishment of the connection itself, using JMXConnector.connect(Map) .

Each client is created by an instance of JMXConnectorProvider . This instance is found as follows. Suppose the given JMXServiceURL looks like "service:jmx:protocol:remainder". Then the factory will attempt to find the appropriate JMXConnectorProvider for protocol. Each occurrence of the character + or - in protocol is replaced by . or _, respectively.

A provider package list is searched for as follows:

  1. If the environment parameter to JMXConnectorFactory.newJMXConnector(JMXServiceURL,Map) newJMXConnector contains the key jmx.remote.protocol.provider.pkgs then the associated value is the provider package list.
  2. Otherwise, if the system property jmx.remote.protocol.provider.pkgs exists, then its value is the provider package list.
  3. Otherwise, there is no provider package list.

The provider package list is a string that is interpreted as a list of non-empty Java package names separated by vertical bars (|). If the string is empty, then so is the provider package list. If the provider package list is not a String, or if it contains an element that is an empty string, a JMXProviderException is thrown.

If the provider package list exists and is not empty, then for each element pkg of the list, the factory will attempt to load the class

pkg.protocol.ClientProvider

If the environment parameter to JMXConnectorFactory.newJMXConnector(JMXServiceURL,Map) newJMXConnector contains the key jmx.remote.protocol.provider.class.loader then the associated value is the class loader to use to load the provider. If the associated value is not an instance of java.lang.ClassLoader , an java.lang.IllegalArgumentException is thrown.

If the jmx.remote.protocol.provider.class.loader key is not present in the environment parameter, the calling thread's context class loader is used.

If the attempt to load this class produces a ClassNotFoundException , the search for a handler continues with the next element of the list.

Otherwise, a problem with the provider found is signalled by a JMXProviderException whose JMXProviderException.getCause cause indicates the underlying exception, as follows:

  • if the attempt to load the class produces an exception other than ClassNotFoundException, that is the cause;
  • if Class.newInstance for the class produces an exception, that is the cause.

If no provider is found by the above steps, including the default case where there is no provider package list, then the implementation will use its own provider for protocol, or it will throw a MalformedURLException if there is none. An implementation may choose to find providers by other means. For example, it may support the JAR conventions for service providers, where the service interface is JMXConnectorProvider.

Every implementation must support the RMI connector protocols, specified with the string rmi or iiop.

Once a provider is found, the result of the newJMXConnector method is the result of calling JMXConnectorProvider.newJMXConnector(JMXServiceURLMap) newJMXConnector on the provider.

The Map parameter passed to the JMXConnectorProvider is a new read-only Map that contains all the entries that were in the environment parameter to JMXConnectorFactory.newJMXConnector(JMXServiceURL,Map)JMXConnectorFactory.newJMXConnector , if there was one. Additionally, if the jmx.remote.protocol.provider.class.loader key is not present in the environment parameter, it is added to the new read-only Map. The associated value is the calling thread's context class loader.


since:
   1.5


Field Summary
final public static  StringDEFAULT_CLASS_LOADER
    

Name of the attribute that specifies the default class loader.

final public static  StringPROTOCOL_PROVIDER_CLASS_LOADER
    

Name of the attribute that specifies the class loader for loading protocol providers.

final public static  StringPROTOCOL_PROVIDER_PACKAGES
    

Name of the attribute that specifies the provider packages that are consulted when looking for the handler for a protocol.



Method Summary
public static  JMXConnectorconnect(JMXServiceURL serviceURL)
    

Creates a connection to the connector server at the given address.

This method is equivalent to JMXConnectorFactory.connect(JMXServiceURL,Map) connect(serviceURL, null) .


Parameters:
  serviceURL - the address of the connector server toconnect to.
public static  JMXConnectorconnect(JMXServiceURL serviceURL, Map<String, ?> environment)
    

Creates a connection to the connector server at the given address.

This method is equivalent to:

 JMXConnector conn = JMXConnectorFactory.newJMXConnector(serviceURL,
 environment);
 conn.connect(environment);
 

Parameters:
  serviceURL - the address of the connector server to connect to.
Parameters:
  environment - a set of attributes to determine how theconnection is made.
static  TgetProvider(JMXServiceURL serviceURL, Map<String, Object> environment, String providerClassName, Class<T> targetInterface, ClassLoader loader)
    
static  TgetProvider(String protocol, String pkgs, ClassLoader loader, String providerClassName, Class<T> targetInterface)
    
static  Iterator<T>getProviderIterator(Class<T> providerClass, ClassLoader loader)
    
public static  JMXConnectornewJMXConnector(JMXServiceURL serviceURL, Map<String, ?> environment)
    

Creates a connector client for the connector server at the given address.

static  ClassLoaderresolveClassLoader(Map environment)
    

Field Detail
DEFAULT_CLASS_LOADER
final public static String DEFAULT_CLASS_LOADER(Code)

Name of the attribute that specifies the default class loader. This class loader is used to deserialize return values and exceptions from remote MBeanServerConnection calls. The value associated with this attribute is an instance of ClassLoader .




PROTOCOL_PROVIDER_CLASS_LOADER
final public static String PROTOCOL_PROVIDER_CLASS_LOADER(Code)

Name of the attribute that specifies the class loader for loading protocol providers. The value associated with this attribute is an instance of ClassLoader .




PROTOCOL_PROVIDER_PACKAGES
final public static String PROTOCOL_PROVIDER_PACKAGES(Code)

Name of the attribute that specifies the provider packages that are consulted when looking for the handler for a protocol. The value associated with this attribute is a string with package names separated by vertical bars (|).






Method Detail
connect
public static JMXConnector connect(JMXServiceURL serviceURL) throws IOException(Code)

Creates a connection to the connector server at the given address.

This method is equivalent to JMXConnectorFactory.connect(JMXServiceURL,Map) connect(serviceURL, null) .


Parameters:
  serviceURL - the address of the connector server toconnect to. a JMXConnector whose JMXConnector.connect connect method has been called.
exception:
  NullPointerException - if serviceURL is null.
exception:
  IOException - if the connector client or theconnection cannot be made because of a communication problem.
exception:
  SecurityException - if the connection cannot be madefor security reasons.



connect
public static JMXConnector connect(JMXServiceURL serviceURL, Map<String, ?> environment) throws IOException(Code)

Creates a connection to the connector server at the given address.

This method is equivalent to:

 JMXConnector conn = JMXConnectorFactory.newJMXConnector(serviceURL,
 environment);
 conn.connect(environment);
 

Parameters:
  serviceURL - the address of the connector server to connect to.
Parameters:
  environment - a set of attributes to determine how theconnection is made. This parameter can be null. Keys in thismap must be Strings. The appropriate type of each associatedvalue depends on the attribute. The contents ofenvironment are not changed by this call. a JMXConnector representing the newly-madeconnection. Each successful call to this method produces adifferent object.
exception:
  NullPointerException - if serviceURL is null.
exception:
  IOException - if the connector client or theconnection cannot be made because of a communication problem.
exception:
  SecurityException - if the connection cannot be madefor security reasons.



getProvider
static T getProvider(JMXServiceURL serviceURL, Map<String, Object> environment, String providerClassName, Class<T> targetInterface, ClassLoader loader) throws IOException(Code)



getProvider
static T getProvider(String protocol, String pkgs, ClassLoader loader, String providerClassName, Class<T> targetInterface) throws IOException(Code)



getProviderIterator
static Iterator<T> getProviderIterator(Class<T> providerClass, ClassLoader loader)(Code)



newJMXConnector
public static JMXConnector newJMXConnector(JMXServiceURL serviceURL, Map<String, ?> environment) throws IOException(Code)

Creates a connector client for the connector server at the given address. The resultant client is not connected until its JMXConnector.connect(Map) connect method is called.


Parameters:
  serviceURL - the address of the connector server to connect to.
Parameters:
  environment - a set of attributes to determine how theconnection is made. This parameter can be null. Keys in thismap must be Strings. The appropriate type of each associatedvalue depends on the attribute. The contents ofenvironment are not changed by this call. a JMXConnector representing the newconnector client. Each successful call to this method producesa different object.
exception:
  NullPointerException - if serviceURL is null.
exception:
  IOException - if the connector client cannot be madebecause of a communication problem.
exception:
  MalformedURLException - if there is no provider for theprotocol in serviceURL.
exception:
  JMXProviderException - if there is a provider for theprotocol in serviceURL but it cannot be used forsome reason.



resolveClassLoader
static ClassLoader resolveClassLoader(Map environment)(Code)



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.