Class RemoteObjectWrapper

  • Direct Known Subclasses:
    ActivatableWrapper, EmptyWrapper, UnicastWrapper

    public abstract class RemoteObjectWrapper
    extends Object
    The RemoteObjectWrapper class represents a wrapper around the ordinary RMI remote object related classes. It stores the basic information that is required to use the remote object as usual, but adds additional fields that allow to obtain meta information more easily. From remote-method-guesser v4.3.0 on, the class gets extended by the UnicastWrapper and ActivatableWrapper classes. As the names suggest, UnicastWrapper is used to wrap remote objects that contain a UnicastRef, whereas ActivatableWrapper is used for wrapping ActivatabaseRef types.
    Author:
    Tobias Neitzel (@qtc_de)
    • Field Detail

      • boundName

        public String boundName
        associated boundName
      • remoteObject

        public Remote remoteObject
        associated Remote
      • knownEndpoint

        public KnownEndpoint knownEndpoint
        associated knownEndpoint
    • Constructor Detail

      • RemoteObjectWrapper

        public RemoteObjectWrapper​(String boundName)
        This constructor is only used for special purposes during the enum action. The resulting RemoteObjectWrapper is not fully functional and should not be used for other purposes than displaying the bound name.
        Parameters:
        boundName - as used in the RMI registry
      • RemoteObjectWrapper

        public RemoteObjectWrapper​(String boundName,
                                   Remote remoteObject)
        Partially initializes a wrapper. This constructor goes already a little bit deeper than the previous one by also assigning the remote object, checking for the implementing class and whether it is a duplicate. However, this constructor should still only be used by subclasses that add the missing fields.
        Parameters:
        boundName - bound name as used in the RMI registry
        remoteObject - the corresponding remote object
    • Method Detail

      • getByName

        public static RemoteObjectWrapper getByName​(String boundName,
                                                    RemoteObjectWrapper[] list)
        Searches a supplied list of RemoteObjectWrapper objects for the Wrapper that is associated to the specified bound name.
        Parameters:
        boundName - associated bound name to look for
        list - RemoteObjectWrapper objects to search in
        Returns:
        RemoteObjectWrapper that matches the specified bound name or null
      • fromBoundNames

        public static RemoteObjectWrapper[] fromBoundNames​(String[] boundNames)
        Creates an array of RemoteObjectWrapper from an array of bound names. The resulting RemoteObjectWrappers are dummy objects that just contain the associated bound name. This should only be used during rmg's enum action to display bound names using the Formatter class.
        Parameters:
        boundNames - Array of String to create the RemoteObjectWrapper from
        Returns:
        Array of RemoteObjectWrapper associated to the specified bound names
      • isKnown

        public boolean isKnown()
        Check whether the endpoint is a known endpoint.
        Returns:
        True of the endpoint is known.
      • getInterfaceName

        public String getInterfaceName()
        Return the interface name that is implemented by the remote object.
        Returns:
        interface name implemented by the remote object
      • getUnicastWrapper

        public UnicastWrapper getUnicastWrapper()
        Transform an RemoteObjectWrapper into a UnicastWrapper. If the RemoteObjectWrapper is already a UnicastWrapper, it is simply returned. If it is an ActivatableWrapper instead, it is activated.
        Returns:
        UnicastWrapper
      • getUnicastWrappers

        public static UnicastWrapper[] getUnicastWrappers​(RemoteObjectWrapper[] wrappers)
        Transform an array of RemoteObjectWrapper into an array of UnicastWrapper. If an element is already a UnicastWrapper, it is simply returned. ActivatableWrappers, on the other hand, are activated to create a UnicastWrapper.
        Parameters:
        wrappers - RemoteObjectWrapper array
        Returns:
        Array of associated UnicastWrappers