Class InterfaceLookup

java.lang.Object
host.anzo.simon.InterfaceLookup
All Implemented Interfaces:
Lookup

public class InterfaceLookup extends Object
With this class, you can make a lookup by providing a Interface.
  • Field Details

  • Constructor Details

  • Method Details

    • getSslContextFactory

      public SslContextFactory getSslContextFactory()
    • setSslContextFactory

      public void setSslContextFactory(SslContextFactory sslContextFactory)
    • getProxyConfig

      public SimonProxyConfig getProxyConfig()
    • setProxyConfig

      public void setProxyConfig(SimonProxyConfig proxyConfig)
    • getClassLoader

      public ClassLoader getClassLoader()
    • setClassLoader

      public void setClassLoader(ClassLoader classLoader)
    • getServerAddress

      public InetAddress getServerAddress()
    • getServerPort

      public int getServerPort()
    • lookup

      public Object lookup(String canonicalInterfaceName) throws LookupFailedException, EstablishConnectionFailed
      Description copied from interface: Lookup
      Tries to lookup a remote object on the server. A successful lookup includes:
      • established socket connection to server, if not already connected
      • increased reference counter for this client-to-server connection by 1
      • return of the requested remote object
      To avoid leaks, ensure that remote objects are released after use. For releasing objects, please refer to Lookup.release(Object).
      Returns:
      the remote object
      Throws:
      LookupFailedException
      EstablishConnectionFailed
    • setSourceAddress

      public void setSourceAddress(InetAddress sourceAddress)
      Description copied from interface: Lookup
      Sets the address that is used as the source address for the lookup-request. This might be useful if client machine has more than one network interface or server requires a specific client subnet
      Specified by:
      setSourceAddress in interface Lookup
    • release

      public boolean release(Object remoteObject)
      Description copied from interface: Lookup
      Releases are remote object. Releasing a remote objects leads to:
      • release of related SIMON resources (threads, ...)
      • decrease reference counter for this client-to-server connection by 1
      • if reference counter reaches 0, the client-to-server connection will be disconnected and cleaned up
      Specified by:
      release in interface Lookup
      Returns:
      true, in case of a normal and clean release. false if remoteobject is already released
    • getClosedListeners

      public List<ClosedListener> getClosedListeners(Object remoteObject)
      Description copied from interface: Lookup
      Returns a list of attached ClosedListeners.
      Specified by:
      getClosedListeners in interface Lookup
      Parameters:
      remoteObject - the remote object to query for attached closed listeners
      Returns:
      a list of attached closed listeners
    • addClosedListener

      public void addClosedListener(Object remoteObject, ClosedListener closedListener)
      Description copied from interface: Lookup
      Attaches a closed listener to the specified remote object
      Specified by:
      addClosedListener in interface Lookup
      Parameters:
      remoteObject - the remote object to which the listener is attached to
      closedListener - the listener to add
    • removeClosedListener

      public boolean removeClosedListener(Object remoteObject, ClosedListener closedListener)
      Description copied from interface: Lookup
      Removes an already attached closed listener from the specified remote object
      Specified by:
      removeClosedListener in interface Lookup
      Parameters:
      remoteObject - the remote object from which the listener has to be removed
      closedListener - the listener to remove
      Returns:
      true, if listener was removed, false if there is no listener to remove
    • awaitCompleteShutdown

      public void awaitCompleteShutdown(long timeout)
      Awaits a complete network shutdown. Means: Waits until all network connections are closed or timeout occurs.
      Parameters:
      timeout - timeout for awaiting complete network shutdown
      Since:
      1.2.0
    • releaseDispatcher

      protected static boolean releaseDispatcher(Dispatcher dispatcher)
      Releases a Dispatcher. If there is no more server string referencing the Dispatcher, the Dispatcher will be released/shutdown.
      Parameters:
      dispatcher - the iDispatcher to release
      Returns:
      true if the Dispatcher is shut down, false if there's still a reference pending