Class SimonProxy

java.lang.Object
host.anzo.simon.SimonProxy
All Implemented Interfaces:
InvocationHandler

public class SimonProxy extends Object implements InvocationHandler
The InvocationHandler which redirects each method call over the network to the related dispatcher
  • Constructor Details

    • SimonProxy

      protected SimonProxy(Dispatcher dispatcher, org.apache.mina.core.session.IoSession session, String remoteObjectName, Class<?>[] remoteInterfaces, boolean regularLookup)
      Constructor which sets the reference to the dispatcher and the remote object name
      Parameters:
      dispatcher - a reference to the underlying dispatcher
      session - a reference to the IoSession of the corresponding network connection
      remoteObjectName - name of the remote object
      remoteInterfaces - the interfaces that the remote object has exported
      regularLookup -
  • Method Details

    • invoke

      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
      Specified by:
      invoke in interface InvocationHandler
      Throws:
      Throwable
      See Also:
    • getRemoteSocketAddress

      protected SocketAddress getRemoteSocketAddress()
      Returns the SocketAddress of the remote host connected with this proxy
      Returns:
      the SocketAddress of the remote host
    • getLocalSocketAddress

      protected SocketAddress getLocalSocketAddress()
      Returns the SocketAddress of the local host connected with this proxy
      Returns:
      the SocketAddress of the local host
    • release

      protected Dispatcher release()
      Releases this proxy. This cancels also the session on the Dispatcher.
      Returns:
      the Dispatcher related to this proxy.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDetailString

      protected String getDetailString()
    • getRemoteObjectName

      protected String getRemoteObjectName()
      Returns the proxy's remote object name in the related lookup table
      Returns:
      the remote object name
    • getIoSession

      protected org.apache.mina.core.session.IoSession getIoSession()
      Returns the IoSession related to this proxy
      Returns:
      an instance of IoSession
    • getDispatcher

      protected Dispatcher getDispatcher()
      Returns the Dispatcher instance related to this proxy. May return null in case of an already shutdown session
      Returns:
      an instance of Dispatcher
    • isRegularLookup

      protected boolean isRegularLookup()
      Returns true if this proxy has been cerated in ciontext of a lookup-call. False in case of callback object
      Returns:
      boolean