javax.management.remote.rmi
Class RMIConnectionImpl

java.lang.Object
  extended by javax.management.remote.rmi.RMIConnectionImpl
All Implemented Interfaces:
Remote, Unreferenced, RMIConnection

public class RMIConnectionImpl
extends Object
implements RMIConnection, Unreferenced

This is the implementation for the rmi connection. The un-marhsalling of marshalled objects is driven by the JSR-160 spec, section 2.11.2. Since this section is not very clear in certain situations, here is how it has been implemented:

Author:
Tom Elrod

Field Summary
protected static Logger log
           
 
Constructor Summary
RMIConnectionImpl(RMIServerImpl rmiServer, String connectionId, ClassLoader defaultClassLoader, Subject subject, Map env)
           
 
Method Summary
 void addNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegationSubject)
           
 Integer[] addNotificationListeners(ObjectName[] names, MarshalledObject[] filters, Subject[] delegationSubjects)
           
 void close()
           
 ObjectInstance createMBean(String className, ObjectName name, MarshalledObject params, String[] signature, Subject delegationSubject)
           
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, MarshalledObject params, String[] signature, Subject delegationSubject)
           
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Subject delegationSubject)
           
 ObjectInstance createMBean(String className, ObjectName name, Subject delegationSubject)
           
 NotificationResult fetchNotifications(long clientSequenceNumber, int maxNotifications, long timeout)
           
 Object getAttribute(ObjectName name, String attribute, Subject delegationSubject)
           
 AttributeList getAttributes(ObjectName name, String[] attributes, Subject delegationSubject)
           
 String getConnectionId()
           
 String getDefaultDomain(Subject delegationSubject)
           
 String[] getDomains(Subject delegationSubject)
           
 Integer getMBeanCount(Subject delegationSubject)
           
 MBeanInfo getMBeanInfo(ObjectName name, Subject delegationSubject)
           
 ObjectInstance getObjectInstance(ObjectName name, Subject delegationSubject)
           
 Object invoke(ObjectName name, String operationName, MarshalledObject params, String[] signature, Subject delegationSubject)
           
 boolean isInstanceOf(ObjectName name, String className, Subject delegationSubject)
           
 boolean isRegistered(ObjectName name, Subject delegationSubject)
           
 Set queryMBeans(ObjectName name, MarshalledObject query, Subject delegationSubject)
           
 Set queryNames(ObjectName name, MarshalledObject query, Subject delegationSubject)
           
 void removeNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegationSubject)
           
 void removeNotificationListener(ObjectName name, ObjectName listener, Subject delegationSubject)
           
 void removeNotificationListeners(ObjectName name, Integer[] listenerIDs, Subject delegationSubject)
           
 void setAttribute(ObjectName name, MarshalledObject attribute, Subject delegationSubject)
           
 AttributeList setAttributes(ObjectName name, MarshalledObject attributes, Subject delegationSubject)
           
 void unreferenced()
          Called by the RMI runtime sometime after the runtime determines that the reference list, the list of clients referencing the remote object, becomes empty.
 void unregisterMBean(ObjectName name, Subject delegationSubject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger log
Constructor Detail

RMIConnectionImpl

public RMIConnectionImpl(RMIServerImpl rmiServer,
                         String connectionId,
                         ClassLoader defaultClassLoader,
                         Subject subject,
                         Map env)
Method Detail

getConnectionId

public String getConnectionId()
                       throws IOException
Specified by:
getConnectionId in interface RMIConnection
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface RMIConnection
Throws:
IOException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  Subject delegationSubject)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  IOException
Specified by:
createMBean in interface RMIConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
IOException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName,
                                  Subject delegationSubject)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException,
                                  IOException
Specified by:
createMBean in interface RMIConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
IOException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  MarshalledObject params,
                                  String[] signature,
                                  Subject delegationSubject)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  IOException
Specified by:
createMBean in interface RMIConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
IOException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName,
                                  MarshalledObject params,
                                  String[] signature,
                                  Subject delegationSubject)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException,
                                  IOException
Specified by:
createMBean in interface RMIConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
IOException

unregisterMBean

public void unregisterMBean(ObjectName name,
                            Subject delegationSubject)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException,
                            IOException
Specified by:
unregisterMBean in interface RMIConnection
Throws:
InstanceNotFoundException
MBeanRegistrationException
IOException

getObjectInstance

public ObjectInstance getObjectInstance(ObjectName name,
                                        Subject delegationSubject)
                                 throws InstanceNotFoundException,
                                        IOException
Specified by:
getObjectInstance in interface RMIConnection
Throws:
InstanceNotFoundException
IOException

queryMBeans

public Set queryMBeans(ObjectName name,
                       MarshalledObject query,
                       Subject delegationSubject)
                throws IOException
Specified by:
queryMBeans in interface RMIConnection
Throws:
IOException

queryNames

public Set queryNames(ObjectName name,
                      MarshalledObject query,
                      Subject delegationSubject)
               throws IOException
Specified by:
queryNames in interface RMIConnection
Throws:
IOException

isRegistered

public boolean isRegistered(ObjectName name,
                            Subject delegationSubject)
                     throws IOException
Specified by:
isRegistered in interface RMIConnection
Throws:
IOException

getMBeanCount

public Integer getMBeanCount(Subject delegationSubject)
                      throws IOException
Specified by:
getMBeanCount in interface RMIConnection
Throws:
IOException

getAttribute

public Object getAttribute(ObjectName name,
                           String attribute,
                           Subject delegationSubject)
                    throws MBeanException,
                           AttributeNotFoundException,
                           InstanceNotFoundException,
                           ReflectionException,
                           IOException
Specified by:
getAttribute in interface RMIConnection
Throws:
MBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException
IOException

getAttributes

public AttributeList getAttributes(ObjectName name,
                                   String[] attributes,
                                   Subject delegationSubject)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   IOException
Specified by:
getAttributes in interface RMIConnection
Throws:
InstanceNotFoundException
ReflectionException
IOException

setAttribute

public void setAttribute(ObjectName name,
                         MarshalledObject attribute,
                         Subject delegationSubject)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException,
                         IOException
Specified by:
setAttribute in interface RMIConnection
Throws:
InstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
IOException

setAttributes

public AttributeList setAttributes(ObjectName name,
                                   MarshalledObject attributes,
                                   Subject delegationSubject)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   IOException
Specified by:
setAttributes in interface RMIConnection
Throws:
InstanceNotFoundException
ReflectionException
IOException

invoke

public Object invoke(ObjectName name,
                     String operationName,
                     MarshalledObject params,
                     String[] signature,
                     Subject delegationSubject)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException,
                     IOException
Specified by:
invoke in interface RMIConnection
Throws:
InstanceNotFoundException
MBeanException
ReflectionException
IOException

getDefaultDomain

public String getDefaultDomain(Subject delegationSubject)
                        throws IOException
Specified by:
getDefaultDomain in interface RMIConnection
Throws:
IOException

getDomains

public String[] getDomains(Subject delegationSubject)
                    throws IOException
Specified by:
getDomains in interface RMIConnection
Throws:
IOException

getMBeanInfo

public MBeanInfo getMBeanInfo(ObjectName name,
                              Subject delegationSubject)
                       throws InstanceNotFoundException,
                              IntrospectionException,
                              ReflectionException,
                              IOException
Specified by:
getMBeanInfo in interface RMIConnection
Throws:
InstanceNotFoundException
IntrospectionException
ReflectionException
IOException

isInstanceOf

public boolean isInstanceOf(ObjectName name,
                            String className,
                            Subject delegationSubject)
                     throws InstanceNotFoundException,
                            IOException
Specified by:
isInstanceOf in interface RMIConnection
Throws:
InstanceNotFoundException
IOException

addNotificationListener

public void addNotificationListener(ObjectName name,
                                    ObjectName listener,
                                    MarshalledObject filter,
                                    MarshalledObject handback,
                                    Subject delegationSubject)
                             throws InstanceNotFoundException,
                                    IOException
Specified by:
addNotificationListener in interface RMIConnection
Throws:
InstanceNotFoundException
IOException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       ObjectName listener,
                                       Subject delegationSubject)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException
Specified by:
removeNotificationListener in interface RMIConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException
IOException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       ObjectName listener,
                                       MarshalledObject filter,
                                       MarshalledObject handback,
                                       Subject delegationSubject)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException
Specified by:
removeNotificationListener in interface RMIConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException
IOException

addNotificationListeners

public Integer[] addNotificationListeners(ObjectName[] names,
                                          MarshalledObject[] filters,
                                          Subject[] delegationSubjects)
                                   throws InstanceNotFoundException,
                                          IOException
Specified by:
addNotificationListeners in interface RMIConnection
Throws:
InstanceNotFoundException
IOException

removeNotificationListeners

public void removeNotificationListeners(ObjectName name,
                                        Integer[] listenerIDs,
                                        Subject delegationSubject)
                                 throws InstanceNotFoundException,
                                        ListenerNotFoundException,
                                        IOException
Specified by:
removeNotificationListeners in interface RMIConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException
IOException

fetchNotifications

public NotificationResult fetchNotifications(long clientSequenceNumber,
                                             int maxNotifications,
                                             long timeout)
                                      throws IOException
Specified by:
fetchNotifications in interface RMIConnection
Throws:
IOException

unreferenced

public void unreferenced()
Called by the RMI runtime sometime after the runtime determines that the reference list, the list of clients referencing the remote object, becomes empty.

Specified by:
unreferenced in interface Unreferenced
Since:
JDK1.1


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.