Package host.anzo.simon
Class SimonProxy
java.lang.Object
host.anzo.simon.SimonProxy
- All Implemented Interfaces:
InvocationHandler
The InvocationHandler which redirects each method call over the network to
the related dispatcher
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimonProxy(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 -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected DispatcherReturns theDispatcherinstance related to this proxy.protected org.apache.mina.core.session.IoSessionReturns theIoSessionrelated to this proxyprotected SocketAddressReturns theSocketAddressof the local host connected with this proxyprotected StringReturns the proxy's remote object name in the related lookup tableprotected SocketAddressReturns theSocketAddressof the remote host connected with this proxyprotected booleanReturns true if this proxy has been cerated in ciontext of a lookup-call.protected Dispatcherrelease()Releases this proxy.toString()
-
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 dispatchersession- a reference to theIoSessionof the corresponding network connectionremoteObjectName- name of the remote objectremoteInterfaces- the interfaces that the remote object has exportedregularLookup-
-
-
Method Details
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable- See Also:
-
getRemoteSocketAddress
Returns theSocketAddressof the remote host connected with this proxy- Returns:
- the
SocketAddressof the remote host
-
getLocalSocketAddress
Returns theSocketAddressof the local host connected with this proxy- Returns:
- the
SocketAddressof the local host
-
release
Releases this proxy. This cancels also the session on theDispatcher.- Returns:
- the
Dispatcherrelated to this proxy.
-
toString
-
getDetailString
-
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 theIoSessionrelated to this proxy- Returns:
- an instance of
IoSession
-
getDispatcher
Returns theDispatcherinstance 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
-