org.apache.felix.mosgi.jmx.rmiconnector.mx4j.remote.rmi
Class RMIConnectionInvoker

java.lang.Object
  extended by org.apache.felix.mosgi.jmx.rmiconnector.mx4j.remote.rmi.RMIConnectionInvoker
All Implemented Interfaces:
Closeable, Remote, RMIConnection

public class RMIConnectionInvoker
extends Object
implements RMIConnection

An RMIConnection that "converts" remote calls to MBeanServer calls, performing unwrapping of parameters and/or the needed actions.

Version:
$Revision: 1.1.1.1 $
Author:
Simone Bordet, Brian Scully
See Also:
mx4j.remote.rmi.ClientInvoker

Constructor Summary
RMIConnectionInvoker(MBeanServer server, ClassLoader defaultLoader, Map environment)
           
 
Method Summary
 void addNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegate)
           
 Integer[] addNotificationListeners(ObjectName[] names, MarshalledObject[] filters, Subject[] delegates)
           
 void close()
           
 ObjectInstance createMBean(String className, ObjectName name, MarshalledObject params, String[] signature, Subject delegate)
           
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, MarshalledObject params, String[] signature, Subject delegate)
           
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Subject delegate)
           
 ObjectInstance createMBean(String className, ObjectName name, Subject delegate)
           
 NotificationResult fetchNotifications(long clientSequenceNumber, int maxNotifications, long timeout)
           
 Object getAttribute(ObjectName name, String attribute, Subject delegate)
           
 AttributeList getAttributes(ObjectName name, String[] attributes, Subject delegate)
           
 String getConnectionId()
           
 String getDefaultDomain(Subject delegate)
           
 String[] getDomains(Subject delegate)
           
 Integer getMBeanCount(Subject delegate)
           
 MBeanInfo getMBeanInfo(ObjectName name, Subject delegate)
           
 ObjectInstance getObjectInstance(ObjectName name, Subject delegate)
           
 Object invoke(ObjectName name, String operationName, MarshalledObject params, String[] signature, Subject delegate)
           
 boolean isInstanceOf(ObjectName name, String className, Subject delegate)
           
 boolean isRegistered(ObjectName name, Subject delegate)
           
 Set queryMBeans(ObjectName name, MarshalledObject query, Subject delegate)
           
 Set queryNames(ObjectName name, MarshalledObject query, Subject delegate)
           
 void removeNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegate)
           
 void removeNotificationListener(ObjectName name, ObjectName listener, Subject delegate)
           
 void removeNotificationListeners(ObjectName name, Integer[] listenerIDs, Subject delegate)
           
 void setAttribute(ObjectName name, MarshalledObject attribute, Subject delegate)
           
 AttributeList setAttributes(ObjectName name, MarshalledObject attributes, Subject delegate)
           
 void unregisterMBean(ObjectName name, Subject delegate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMIConnectionInvoker

public RMIConnectionInvoker(MBeanServer server,
                            ClassLoader defaultLoader,
                            Map environment)
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 Closeable
Specified by:
close in interface RMIConnection
Throws:
IOException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  Subject delegate)
                           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 delegate)
                           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 delegate)
                           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 delegate)
                           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 delegate)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException,
                            IOException
Specified by:
unregisterMBean in interface RMIConnection
Throws:
InstanceNotFoundException
MBeanRegistrationException
IOException

getObjectInstance

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

queryMBeans

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

queryNames

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

isRegistered

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

getMBeanCount

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

getAttribute

public Object getAttribute(ObjectName name,
                           String attribute,
                           Subject delegate)
                    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 delegate)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   IOException
Specified by:
getAttributes in interface RMIConnection
Throws:
InstanceNotFoundException
ReflectionException
IOException

setAttribute

public void setAttribute(ObjectName name,
                         MarshalledObject attribute,
                         Subject delegate)
                  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 delegate)
                            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 delegate)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException,
                     IOException
Specified by:
invoke in interface RMIConnection
Throws:
InstanceNotFoundException
MBeanException
ReflectionException
IOException

getDefaultDomain

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

getDomains

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

getMBeanInfo

public MBeanInfo getMBeanInfo(ObjectName name,
                              Subject delegate)
                       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 delegate)
                     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 delegate)
                             throws InstanceNotFoundException,
                                    IOException
Specified by:
addNotificationListener in interface RMIConnection
Throws:
InstanceNotFoundException
IOException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       ObjectName listener,
                                       Subject delegate)
                                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 delegate)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException
Specified by:
removeNotificationListener in interface RMIConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException
IOException

addNotificationListeners

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

removeNotificationListeners

public void removeNotificationListeners(ObjectName name,
                                        Integer[] listenerIDs,
                                        Subject delegate)
                                 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


Copyright © 2011 Apache Software Foundation. All Rights Reserved.