Package Summary  Overview Summary

class:RMIConnection [NONE]

  • All Superinterfaces:
    AutoCloseable, Closeable, Remote
    All Known Implementing Classes:
    RMIConnectionImpl, RMIConnectionImpl_Stub

    public interface RMIConnection
    extends Closeable, Remote
    

    RMI object used to forward an MBeanServer request from a client to its MBeanServer implementation on the server side. There is one Remote object implementing this interface for each remote client connected to an RMI connector.

    User code does not usually refer to this interface. It is specified as part of the public API so that different implementations of that API will interoperate.

    To ensure that client parameters will be deserialized at the server side with the correct classloader, client parameters such as parameters used to invoke a method are wrapped in a MarshalledObject. An implementation of this interface must first get the appropriate class loader for the operation and its target, then deserialize the marshalled parameters with this classloader. Except as noted, a parameter that is a MarshalledObject or MarshalledObject[] must not be null; the behavior is unspecified if it is.

    Class loading aspects are detailed in the JMX Specification, version 1.4

    Most methods in this interface parallel methods in the MBeanServerConnection interface. Where an aspect of the behavior of a method is not specified here, it is the same as in the corresponding MBeanServerConnection method.

    Since:
    1.5

method:getConnectionId() [NONE]

  • getConnectionId

    String getConnectionId()
                    throws IOException
    

    Returns the connection ID. This string is different for every open connection to a given RMI connector server.

    Returns:
    the connection ID
    Throws:
    IOException - if a general communication exception occurred.
    See Also:
    RMIConnector.connect

method:close() [NONE]

  • close

    void close()
        throws IOException
    

    Closes this connection. On return from this method, the RMI object implementing this interface is unexported, so further remote calls to it will fail.

    Specified by:
    close in interface AutoCloseable
    Specified by:
    close in interface Closeable
    Throws:
    IOException - if the connection could not be closed, or the Remote object could not be unexported, or there was a communication failure when transmitting the remote close request.

method:createMBean(java.lang.String,javax.management.ObjectName,javax.security.auth.Subject) [NONE]

method:createMBean(java.lang.String,javax.management.ObjectName,javax.management.ObjectName,javax.security.auth.Subject) [NONE]

method:createMBean(java.lang.String,javax.management.ObjectName,java.rmi.MarshalledObject,java.lang.String[],javax.security.auth.Subject) [NONE]

method:createMBean(java.lang.String,javax.management.ObjectName,javax.management.ObjectName,java.rmi.MarshalledObject,java.lang.String[],javax.security.auth.Subject) [NONE]

method:unregisterMBean(javax.management.ObjectName,javax.security.auth.Subject) [NONE]

method:getObjectInstance(javax.management.ObjectName,javax.security.auth.Subject) [NONE]

method:queryMBeans(javax.management.ObjectName,java.rmi.MarshalledObject,javax.security.auth.Subject) [NONE]

  • queryMBeans

    Set<ObjectInstance> queryMBeans​(ObjectName name,
                                    MarshalledObject query,
                                    Subject delegationSubject)
                             throws IOException
    
    Handles the method MBeanServerConnection.queryMBeans(ObjectName, QueryExp) . The QueryExp is wrapped in a MarshalledObject.
    Parameters:
    name - The object name pattern identifying the MBeans to be retrieved. If null or no domain and key properties are specified, all the MBeans registered will be retrieved.
    query - The query expression to be applied for selecting MBeans, encapsulated into a MarshalledObject. If the MarshalledObject encapsulates a null value no query expression will be applied for selecting MBeans.
    delegationSubject - The Subject containing the delegation principals or null if the authentication principal is used instead.
    Returns:
    A set containing the ObjectInstance objects for the selected MBeans. If no MBean satisfies the query an empty list is returned.
    Throws:
    SecurityException - if the client, or the delegated Subject if any, does not have permission to perform this operation.
    IOException - if a general communication exception occurred.

method:queryNames(javax.management.ObjectName,java.rmi.MarshalledObject,javax.security.auth.Subject) [NONE]

  • queryNames

    Set<ObjectName> queryNames​(ObjectName name,
                               MarshalledObject query,
                               Subject delegationSubject)
                        throws IOException
    
    Handles the method MBeanServerConnection.queryNames(ObjectName, QueryExp) . The QueryExp is wrapped in a MarshalledObject.
    Parameters:
    name - The object name pattern identifying the MBean names to be retrieved. If null or no domain and key properties are specified, the name of all registered MBeans will be retrieved.
    query - The query expression to be applied for selecting MBeans, encapsulated into a MarshalledObject. If the MarshalledObject encapsulates a null value no query expression will be applied for selecting MBeans.
    delegationSubject - The Subject containing the delegation principals or null if the authentication principal is used instead.
    Returns:
    A set containing the ObjectNames for the MBeans selected. If no MBean satisfies the query, an empty list is returned.
    Throws:
    SecurityException - if the client, or the delegated Subject if any, does not have permission to perform this operation.
    IOException - if a general communication exception occurred.

method:isRegistered(javax.management.ObjectName,javax.security.auth.Subject) [NONE]

  • isRegistered

    boolean isRegistered​(ObjectName name,
                         Subject delegationSubject)
                  throws IOException
    
    Parameters:
    name - The object name of the MBean to be checked.
    delegationSubject - The Subject containing the delegation principals or null if the authentication principal is used instead.
    Returns:
    True if the MBean is already registered in the MBean server, false otherwise.
    Throws:
    RuntimeOperationsException - Wraps a java.lang.IllegalArgumentException: The object name in parameter is null.
    SecurityException - if the client, or the delegated Subject if any, does not have permission to perform this operation.
    IOException - if a general communication exception occurred.

method:getMBeanCount(javax.security.auth.Subject) [NONE]

  • getMBeanCount

    Integer getMBeanCount​(Subject delegationSubject)
                   throws IOException
    
    Parameters:
    delegationSubject - The Subject containing the delegation principals or null if the authentication principal is used instead.
    Returns:
    the number of MBeans registered.
    Throws:
    SecurityException - if the client, or the delegated Subject if any, does not have permission to perform this operation.
    IOException - if a general communication exception occurred.

method:getAttribute(javax.management.ObjectName,java.lang.String,javax.security.auth.Subject) [NONE]

method:getAttributes(javax.management.ObjectName,java.lang.String[],javax.security.auth.Subject) [NONE]

method:setAttribute(javax.management.ObjectName,java.rmi.MarshalledObject,javax.security.auth.Subject) [NONE]

method:setAttributes(javax.management.ObjectName,java.rmi.MarshalledObject,javax.security.auth.Subject) [NONE]

method:invoke(javax.management.ObjectName,java.lang.String,java.rmi.MarshalledObject,java.lang.String[],javax.security.auth.Subject) [NONE]

  • invoke

    Object invoke​(ObjectName name,
                  String operationName,
                  MarshalledObject params,
                  String[] signature,
                  Subject delegationSubject)
           throws InstanceNotFoundException,
                  MBeanException,
                  ReflectionException,
                  IOException
    
    Handles the method MBeanServerConnection.invoke(ObjectName, String, Object[], String[]) . The Object[] parameter is wrapped in a MarshalledObject.
    Parameters:
    name - The object name of the MBean on which the method is to be invoked.
    operationName - The name of the operation to be invoked.
    params - An array containing the parameters to be set when the operation is invoked, encapsulated into a MarshalledObject. The encapsulated array can be null, equivalent to an empty array.
    signature - An array containing the signature of the operation. The class objects will be loaded using the same class loader as the one used for loading the MBean on which the operation was invoked. Can be null, equivalent to an empty array.
    delegationSubject - The Subject containing the delegation principals or null if the authentication principal is used instead.
    Returns:
    The object returned by the operation, which represents the result of invoking the operation on the MBean specified.
    Throws:
    InstanceNotFoundException - The MBean specified is not registered in the MBean server.
    MBeanException - Wraps an exception thrown by the MBean's invoked method.
    ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method.
    SecurityException - if the client, or the delegated Subject if any, does not have permission to perform this operation.
    IOException - if a general communication exception occurred.
    RuntimeOperationsException - Wraps an IllegalArgumentException when name or operationName is null.

method:getDefaultDomain(javax.security.auth.Subject) [NONE]

  • getDefaultDomain

    String getDefaultDomain​(Subject delegationSubject)
                     throws IOException
    
    Parameters:
    delegationSubject - The Subject containing the delegation principals or null if the authentication principal is used instead.
    Returns:
    the default domain.
    Throws:
    SecurityException - if the client, or the delegated Subject if any, does not have permission to perform this operation.
    IOException - if a general communication exception occurred.

method:getDomains(javax.security.auth.Subject) [NONE]

  • getDomains

    String[] getDomains​(Subject delegationSubject)
                 throws IOException
    
    Parameters:
    delegationSubject - The Subject containing the delegation principals or null if the authentication principal is used instead.
    Returns:
    the list of domains.
    Throws:
    SecurityException - if the client, or the delegated Subject if any, does not have permission to perform this operation.
    IOException - if a general communication exception occurred.

method:getMBeanInfo(javax.management.ObjectName,javax.security.auth.Subject) [NONE]

method:isInstanceOf(javax.management.ObjectName,java.lang.String,javax.security.auth.Subject) [NONE]

method:addNotificationListener(javax.management.ObjectName,javax.management.ObjectName,java.rmi.MarshalledObject,java.rmi.MarshalledObject,javax.security.auth.Subject) [NONE]

method:removeNotificationListener(javax.management.ObjectName,javax.management.ObjectName,javax.security.auth.Subject) [NONE]

method:removeNotificationListener(javax.management.ObjectName,javax.management.ObjectName,java.rmi.MarshalledObject,java.rmi.MarshalledObject,javax.security.auth.Subject) [NONE]

method:addNotificationListeners(javax.management.ObjectName[],java.rmi.MarshalledObject[],javax.security.auth.Subject[]) [NONE]

  • addNotificationListeners

    Integer[] addNotificationListeners​(ObjectName[] names,
                                       MarshalledObject[] filters,
                                       Subject[] delegationSubjects)
                                throws InstanceNotFoundException,
                                       IOException
    

    Handles the method MBeanServerConnection.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object) .

    Register for notifications from the given MBeans that match the given filters. The remote client can subsequently retrieve the notifications using the fetchNotifications method.

    For each listener, the original NotificationListener and handback are kept on the client side; in order for the client to be able to identify them, the server generates and returns a unique listenerID. This listenerID is forwarded with the Notifications to the remote client.

    If any one of the given (name, filter) pairs cannot be registered, then the operation fails with an exception, and no names or filters are registered.

    Parameters:
    names - the ObjectNames identifying the MBeans emitting the Notifications.
    filters - an array of marshalled representations of the NotificationFilters. Elements of this array can be null.
    delegationSubjects - the Subjects on behalf of which the listeners are being added. Elements of this array can be null. Also, the delegationSubjects parameter itself can be null, which is equivalent to an array of null values with the same size as the names and filters arrays.
    Returns:
    an array of listenerIDs identifying the local listeners. This array has the same number of elements as the parameters.
    Throws:
    IllegalArgumentException - if names or filters is null, or if names contains a null element, or if the three arrays do not all have the same size.
    ClassCastException - if one of the elements of filters unmarshalls as a non-null object that is not a NotificationFilter.
    InstanceNotFoundException - if one of the names does not correspond to any registered MBean.
    SecurityException - if, for one of the MBeans, the client, or the delegated Subject if any, does not have permission to add a listener.
    IOException - if a general communication exception occurred.

method:removeNotificationListeners(javax.management.ObjectName,java.lang.Integer[],javax.security.auth.Subject) [NONE]

method:fetchNotifications(long,int,long) [NONE]

  • fetchNotifications

    NotificationResult fetchNotifications​(long clientSequenceNumber,
                                          int maxNotifications,
                                          long timeout)
                                   throws IOException
    

    Retrieves notifications from the connector server. This method can block until there is at least one notification or until the specified timeout is reached. The method can also return at any time with zero notifications.

    A notification can be included in the result if its sequence number is no less than clientSequenceNumber and this client has registered at least one listener for the MBean generating the notification, with a filter that accepts the notification. Each listener that is interested in the notification is identified by an Integer ID that was returned by addNotificationListeners(ObjectName[], MarshalledObject[], Subject[]) .

    Parameters:
    clientSequenceNumber - the first sequence number that the client is interested in. If negative, it is interpreted as meaning the sequence number that the next notification will have.
    maxNotifications - the maximum number of different notifications to return. The TargetedNotification array in the returned NotificationResult can have more elements than this if the same notification appears more than once. The behavior is unspecified if this parameter is negative.
    timeout - the maximum time in milliseconds to wait for a notification to arrive. This can be 0 to indicate that the method should not wait if there are no notifications, but should return at once. It can be Long.MAX_VALUE to indicate that there is no timeout. The behavior is unspecified if this parameter is negative.
    Returns:
    A NotificationResult.
    Throws:
    IOException - if a general communication exception occurred.

© 2019 Oracle Corporation and/or its affiliates