Package host.anzo.simon
Interface Lookup
- All Known Implementing Classes:
InterfaceLookup,NameLookup
public interface Lookup
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddClosedListener(Object remoteObject, ClosedListener closedListener) Attaches a closed listener to the specified remote objectgetClosedListeners(Object remoteObject) Returns a list of attachedClosedListeners.intTries to lookup a remote object on the server.booleanReleases are remote object.booleanremoveClosedListener(Object remoteObject, ClosedListener closedListener) Removes an already attached closed listener from the specified remote objectvoidsetClassLoader(ClassLoader classLoader) voidsetProxyConfig(SimonProxyConfig proxyConfig) voidsetSourceAddress(InetAddress sourceAddress) Sets the address that is used as the source address for the lookup-request.voidsetSslContextFactory(SslContextFactory sslContextFactory)
-
Method Details
-
getSslContextFactory
SslContextFactory getSslContextFactory() -
setSslContextFactory
-
getProxyConfig
SimonProxyConfig getProxyConfig() -
setProxyConfig
-
getClosedListeners
Returns a list of attachedClosedListeners.- Parameters:
remoteObject- the remote object to query for attached closed listeners- Returns:
- a list of attached closed listeners
-
addClosedListener
Attaches a closed listener to the specified remote object- Parameters:
remoteObject- the remote object to which the listener is attached toclosedListener- the listener to add
-
removeClosedListener
Removes an already attached closed listener from the specified remote object- Parameters:
remoteObject- the remote object from which the listener has to be removedclosedListener- the listener to remove- Returns:
- true, if listener was removed, false if there is no listener to remove
-
getClassLoader
ClassLoader getClassLoader() -
setClassLoader
-
setSourceAddress
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- Parameters:
sourceAddress-
-
getServerAddress
InetAddress getServerAddress() -
getServerPort
int getServerPort() -
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
release(Object).- Parameters:
lookupString-- Returns:
- the remote object
- Throws:
LookupFailedExceptionEstablishConnectionFailed
-
release
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
- Parameters:
remoteObject-- Returns:
- true, in case of a normal and clean release. false if remoteobject is already released
- Throws:
IllegalArgumentException- in case of argument is not a releaseable remote object
-