Java Doc for RMIConnectorServer.java in  » 6.0-JDK-Core » management » javax » management » remote » rmi » 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.rmi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.management.remote.JMXConnectorServer
   javax.management.remote.rmi.RMIConnectorServer

RMIConnectorServer
public class RMIConnectorServer extends JMXConnectorServer (Code)

A JMX API connector server that creates RMI-based connections from remote clients. Usually, such connector servers are made using javax.management.remote.JMXConnectorServerFactoryJMXConnectorServerFactory . However, specialized applications can use this class directly, for example with an RMIServerImpl object.


since:
   1.5


Field Summary
final public static  StringJNDI_REBIND_ATTRIBUTE
    

Name of the attribute that specifies whether the RMIServer stub that represents an RMI connector server should override an existing stub at the same address.

final public static  StringRMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE
    

Name of the attribute that specifies the RMIClientSocketFactory for the RMI objects created in conjunction with this connector.

final public static  StringRMI_SERVER_SOCKET_FACTORY_ATTRIBUTE
    

Name of the attribute that specifies the RMIServerSocketFactory for the RMI objects created in conjunction with this connector.


Constructor Summary
public  RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment)
    

Makes an RMIConnectorServer. This is equivalent to calling RMIConnectorServer.RMIConnectorServer(JMXServiceURL,Map,RMIServerImpl,MBeanServer)RMIConnectorServer(directoryURL,environment,null,null)


Parameters:
  url - the URL defining how to create the connector server.Cannot be null.
Parameters:
  environment - attributes governing the creation andstoring of the RMI object.
public  RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment, MBeanServer mbeanServer)
    

Makes an RMIConnectorServer for the given MBean server. This is equivalent to calling RMIConnectorServer.RMIConnectorServer(JMXServiceURL,Map,RMIServerImpl,MBeanServer)RMIConnectorServer(directoryURL,environment,null,mbeanServer)


Parameters:
  url - the URL defining how to create the connector server.Cannot be null.
Parameters:
  environment - attributes governing the creation andstoring of the RMI object.
public  RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment, RMIServerImpl rmiServerImpl, MBeanServer mbeanServer)
    

Makes an RMIConnectorServer for the given MBean server.


Parameters:
  url - the URL defining how to create the connector server.Cannot be null.
Parameters:
  environment - attributes governing the creation andstoring of the RMI object.

Method Summary
 voidbind(String jndiUrl, Hashtable attributes, RMIServer rmiServer, boolean rebind)
     Bind a stub to a registry.
protected  voidconnectionClosed(String connectionId, String message, Object userData)
    
protected  voidconnectionFailed(String connectionId, String message, Object userData)
    
protected  voidconnectionOpened(String connectionId, String message, Object userData)
    
static  StringencodeIIOPStub(RMIServer rmiServer, Map env)
    
static  StringencodeJRMPStub(RMIServer rmiServer, Map env)
    
static  StringencodeStub(RMIServer rmiServer, Map env)
     Returns the IOR of the given rmiServer.
public  JMXServiceURLgetAddress()
    
public  Map<String, ?>getAttributes()
    
public synchronized  booleanisActive()
    
static  booleanisIiopURL(JMXServiceURL directoryURL, boolean strict)
    
 RMIServerImplnewServer()
     Creates a new RMIServerImpl.
public synchronized  voidsetMBeanServerForwarder(MBeanServerForwarder mbsf)
    
public synchronized  voidstart()
    

Activates the connector server, that is starts listening for client connections.

public  voidstop()
    

Deactivates the connector server, that is, stops listening for client connections.

public  JMXConnectortoJMXConnector(Map<String, ?> env)
    

Returns a client stub for this connector server.


Field Detail
JNDI_REBIND_ATTRIBUTE
final public static String JNDI_REBIND_ATTRIBUTE(Code)

Name of the attribute that specifies whether the RMIServer stub that represents an RMI connector server should override an existing stub at the same address. The value associated with this attribute, if any, should be a string that is equal, ignoring case, to "true" or "false". The default value is false.




RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE
final public static String RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE(Code)

Name of the attribute that specifies the RMIClientSocketFactory for the RMI objects created in conjunction with this connector. The value associated with this attribute must be of type RMIClientSocketFactory and can only be specified in the Map argument supplied when creating a connector server.




RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE
final public static String RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE(Code)

Name of the attribute that specifies the RMIServerSocketFactory for the RMI objects created in conjunction with this connector. The value associated with this attribute must be of type RMIServerSocketFactory and can only be specified in the Map argument supplied when creating a connector server.





Constructor Detail
RMIConnectorServer
public RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment) throws IOException(Code)

Makes an RMIConnectorServer. This is equivalent to calling RMIConnectorServer.RMIConnectorServer(JMXServiceURL,Map,RMIServerImpl,MBeanServer)RMIConnectorServer(directoryURL,environment,null,null)


Parameters:
  url - the URL defining how to create the connector server.Cannot be null.
Parameters:
  environment - attributes governing the creation andstoring of the RMI object. Can be null, which is equivalent toan empty Map.
exception:
  IllegalArgumentException - if url is null.
exception:
  MalformedURLException - if url does notconform to the syntax for an RMI connector, or if its protocolis not recognized by this implementation. Only "rmi" and "iiop"are valid when this constructor is used.
exception:
  IOException - if the connector server cannot be createdfor some reason or if it is inevitable that its RMIConnectorServer.start()start method will fail.



RMIConnectorServer
public RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment, MBeanServer mbeanServer) throws IOException(Code)

Makes an RMIConnectorServer for the given MBean server. This is equivalent to calling RMIConnectorServer.RMIConnectorServer(JMXServiceURL,Map,RMIServerImpl,MBeanServer)RMIConnectorServer(directoryURL,environment,null,mbeanServer)


Parameters:
  url - the URL defining how to create the connector server.Cannot be null.
Parameters:
  environment - attributes governing the creation andstoring of the RMI object. Can be null, which is equivalent toan empty Map.
Parameters:
  mbeanServer - the MBean server to which the new connectorserver is attached, or null if it will be attached by beingregistered as an MBean in the MBean server.
exception:
  IllegalArgumentException - if url is null.
exception:
  MalformedURLException - if url does notconform to the syntax for an RMI connector, or if its protocolis not recognized by this implementation. Only "rmi" and "iiop"are valid when this constructor is used.
exception:
  IOException - if the connector server cannot be createdfor some reason or if it is inevitable that its RMIConnectorServer.start()start method will fail.



RMIConnectorServer
public RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment, RMIServerImpl rmiServerImpl, MBeanServer mbeanServer) throws IOException(Code)

Makes an RMIConnectorServer for the given MBean server.


Parameters:
  url - the URL defining how to create the connector server.Cannot be null.
Parameters:
  environment - attributes governing the creation andstoring of the RMI object. Can be null, which is equivalent toan empty Map.
Parameters:
  rmiServerImpl - An implementation of the RMIServer interface,consistent with the protocol type specified in url.If this parameter is non null, the protocol type specified byurl is not constrained, and is assumed to be valid.Otherwise, only "rmi" and "iiop" will be recognized.
Parameters:
  mbeanServer - the MBean server to which the new connectorserver is attached, or null if it will be attached by beingregistered as an MBean in the MBean server.
exception:
  IllegalArgumentException - if url is null.
exception:
  MalformedURLException - if url does notconform to the syntax for an RMI connector, or if its protocolis not recognized by this implementation. Only "rmi" and "iiop"are recognized when rmiServerImpl is null.
exception:
  IOException - if the connector server cannot be createdfor some reason or if it is inevitable that its RMIConnectorServer.start()start method will fail.
See Also:   RMIConnectorServer.start




Method Detail
bind
void bind(String jndiUrl, Hashtable attributes, RMIServer rmiServer, boolean rebind) throws NamingException, MalformedURLException(Code)
Bind a stub to a registry.
Parameters:
  jndiUrl - URL of the stub in the registry, extractedfrom the JMXServiceURL.
Parameters:
  attributes - A Hashtable containing environment parameters,built from the Map specified at this object creation.
Parameters:
  rmiServer - The object to bind in the registry
Parameters:
  rebind - true if the object must be rebound.



connectionClosed
protected void connectionClosed(String connectionId, String message, Object userData)(Code)



connectionFailed
protected void connectionFailed(String connectionId, String message, Object userData)(Code)



connectionOpened
protected void connectionOpened(String connectionId, String message, Object userData)(Code)



encodeIIOPStub
static String encodeIIOPStub(RMIServer rmiServer, Map env) throws IOException(Code)



encodeJRMPStub
static String encodeJRMPStub(RMIServer rmiServer, Map env) throws IOException(Code)



encodeStub
static String encodeStub(RMIServer rmiServer, Map env) throws IOException(Code)
Returns the IOR of the given rmiServer.



getAddress
public JMXServiceURL getAddress()(Code)



getAttributes
public Map<String, ?> getAttributes()(Code)



isActive
public synchronized boolean isActive()(Code)



isIiopURL
static boolean isIiopURL(JMXServiceURL directoryURL, boolean strict) throws MalformedURLException(Code)



newServer
RMIServerImpl newServer() throws IOException(Code)
Creates a new RMIServerImpl.



setMBeanServerForwarder
public synchronized void setMBeanServerForwarder(MBeanServerForwarder mbsf)(Code)



start
public synchronized void start() throws IOException(Code)

Activates the connector server, that is starts listening for client connections. Calling this method when the connector server is already active has no effect. Calling this method when the connector server has been stopped will generate an IOException.

The behavior of this method when called for the first time depends on the parameters that were supplied at construction, as described below.

First, an object of a subclass of RMIServerImpl is required, to export the connector server through RMI:

  • If an RMIServerImpl was supplied to the constructor, it is used.
  • Otherwise, if the protocol part of the JMXServiceURL supplied to the constructor was iiop, an object of type RMIIIOPServerImpl is created.
  • Otherwise, if the JMXServiceURL was null, or its protocol part was rmi, an object of type RMIJRMPServerImpl is created.
  • Otherwise, the implementation can create an implementation-specific RMIServerImpl or it can throw MalformedURLException .

If the given address includes a JNDI directory URL as specified in the package documentation for javax.management.remote.rmi , then this RMIConnectorServer will bootstrap by binding the RMIServerImpl to the given address.

If the URL path part of the JMXServiceURL was empty or a single slash (/), then the RMI object will not be bound to a directory. Instead, a reference to it will be encoded in the URL path of the RMIConnectorServer address (returned by RMIConnectorServer.getAddress() ). The encodings for rmi and iiop are described in the package documentation for javax.management.remote.rmi .

The behavior when the URL path is neither empty nor a JNDI directory URL, or when the protocol is neither rmi nor iiop, is implementation defined, and may include throwing MalformedURLException when the connector server is created or when it is started.


exception:
  IllegalStateException - if the connector server hasnot been attached to an MBean server.
exception:
  IOException - if the connector server cannot bestarted.



stop
public void stop() throws IOException(Code)

Deactivates the connector server, that is, stops listening for client connections. Calling this method will also close all client connections that were made by this server. After this method returns, whether normally or with an exception, the connector server will not create any new client connections.

Once a connector server has been stopped, it cannot be started again.

Calling this method when the connector server has already been stopped has no effect. Calling this method when the connector server has not yet been started will disable the connector server object permanently.

If closing a client connection produces an exception, that exception is not thrown from this method. A JMXConnectionNotification is emitted from this MBean with the connection ID of the connection that could not be closed.

Closing a connector server is a potentially slow operation. For example, if a client machine with an open connection has crashed, the close operation might have to wait for a network protocol timeout. Callers that do not want to block in a close operation should do it in a separate thread.

This method calls the method RMIServerImpl.closeclose on the connector server's RMIServerImpl object.

If the RMIServerImpl was bound to a JNDI directory by the RMIConnectorServer.start() start method, it is unbound from the directory by this method.


exception:
  IOException - if the server cannot be closed cleanly,or if the RMIServerImpl cannot be unbound from thedirectory. When this exception is thrown, the server hasalready attempted to close all client connections, ifappropriate; to call RMIServerImpl.close; and tounbind the RMIServerImpl from its directory, ifappropriate. All client connections are closed except possiblythose that generated exceptions when the server attempted toclose them.



toJMXConnector
public JMXConnector toJMXConnector(Map<String, ?> env) throws IOException(Code)

Returns a client stub for this connector server. A client stub is a serializable object whose JMXConnector.connect(Map) connect method can be used to make one new connection to this connector server.


Parameters:
  env - client connection parameters of the same sort thatcould be provided to JMXConnector.connect(Map)JMXConnector.connect(Map). Can be null, which is equivalentto an empty map. a client stub that can be used to make a new connectionto this connector server.
exception:
  UnsupportedOperationException - if this connectorserver does not support the generation of client stubs.
exception:
  IllegalStateException - if the JMXConnectorServer isnot started (see RMIConnectorServer.isActive()).
exception:
  IOException - if a communications problem means that astub cannot be created.



Fields inherited from javax.management.remote.JMXConnectorServer
final public static String AUTHENTICATOR(Code)(Java Doc)

Methods inherited from javax.management.remote.JMXConnectorServer
protected void connectionClosed(String connectionId, String message, Object userData)(Code)(Java Doc)
protected void connectionFailed(String connectionId, String message, Object userData)(Code)(Java Doc)
protected void connectionOpened(String connectionId, String message, Object userData)(Code)(Java Doc)
public String[] getConnectionIds()(Code)(Java Doc)
public synchronized MBeanServer getMBeanServer()(Code)(Java Doc)
public MBeanNotificationInfo[] getNotificationInfo()(Code)(Java Doc)
public void postDeregister()(Code)(Java Doc)
public void postRegister(Boolean registrationDone)(Code)(Java Doc)
public synchronized void preDeregister() throws Exception(Code)(Java Doc)
public synchronized ObjectName preRegister(MBeanServer mbs, ObjectName name)(Code)(Java Doc)
public synchronized void setMBeanServerForwarder(MBeanServerForwarder mbsf)(Code)(Java Doc)
public JMXConnector toJMXConnector(Map<String, ?> env) throws IOException(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.