Class ActivatableWrapper


  • public class ActivatableWrapper
    extends RemoteObjectWrapper
    The ActivatableWrapper class extends RemoteObjectWrapper and is used for wrapping ActivatableRef. By using the activate method of ActivatableWrapper, it is possible to turn it into an UnicastWrapper.
    Author:
    Tobias Neitzel (@qtc_de)
    • Field Detail

      • activationUID

        public final UID activationUID
        activationUID
    • Constructor Detail

      • ActivatableWrapper

        public ActivatableWrapper​(Remote remoteObject,
                                  String boundName,
                                  RemoteRef ref)
                           throws IllegalArgumentException,
                                  IllegalAccessException,
                                  NoSuchFieldException,
                                  SecurityException
        ActivatableWrapper is constructed from a remote object. It expects the underlying RemoteRef to be an ActivatableRef and attempts to extract the ActivationID from it. The ActivationID is then used to obtain the actual UID used for activation and the reference to the Activator. To provide compatibility to newer Java versions, the constructor uses reflection to perform operations on classes that are contained in the activation system. This allows them to be dynamically generated if they are missing. During the enum action, it is possible to use the RMGOptions.ACTIVATE option to activate an ActivatableWrapper and to display properties of the UnicastRef that is obtained during activation. For all other operations, activation is done implicitly. The third argument seems superfluous, as the ref is already contained in the remote object. However, ActivatableWrapper should be created by using the getInstance method of RemoteObjectWrapper. This one extracts the reference from the remote object anyway to check whether it is a UnicastRef or ActivatableRef. Therefore, we can reuse this extracted ref instead of performing another extraction.
        Parameters:
        remoteObject - Incoming RemoteObject, usually obtained by an RMI lookup call
        boundName - The bound name that the remoteObject uses inside the RMI registry
        ref - ActivatableRef to wrap around
        Throws:
        IllegalArgumentException - if reflective access fails
        IllegalAccessException - if reflective access fails
        NoSuchFieldException - if reflective access fails
        SecurityException - if reflective access fails
    • Method Detail

      • getActivated

        public UnicastWrapper getActivated()
        Return the currently set activatedRef. This is probably null, if the wrapper was not previously activated. Use the activate method instead, if you want to ensure activation.
        Returns:
        activatedRef or null
      • getActivatorEndpoint

        public String getActivatorEndpoint()
        Return a formatted string in host:port format for the Activator endpoint.
        Returns:
        String representation of the activator endpoint