|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.utils.ManagedRemoteService
public class ManagedRemoteService
ManagedRemoteService creates and manages an RMI SIAM 'RemoteService' proxy associated with the specified name, and periodically checks that the service is still available.
| Nested Class Summary | |
|---|---|
static interface |
ManagedRemoteService.StatusListener
Interface for components that wish to respond to connection status |
| Field Summary | |
|---|---|
protected long |
_lastRefreshTime
|
protected java.lang.Object |
_lock
|
protected static org.apache.log4j.Logger |
_log4j
|
protected NodeProbe |
_nodeProbe
|
protected RemoteService |
_service
|
protected java.net.InetAddress |
_serviceAddr
|
protected java.lang.String |
_serviceMnemonic
|
protected java.lang.String |
_serviceURL
|
protected java.util.Vector |
_statusListeners
|
protected static int |
PROBE_TIMEOUT_MSEC
|
protected static int |
REFRESH_INTERVAL_MSEC
|
protected static int |
RMIREGISTRY_PORT
|
| Constructor Summary | |
|---|---|
ManagedRemoteService(java.lang.String serviceURL,
java.lang.String serviceMnemonic,
int pingIntervalMsec)
|
|
| Method Summary | |
|---|---|
void |
addListener(ManagedRemoteService.StatusListener listener)
Add a status listener |
RemoteService |
connect()
Reconnect service |
boolean |
connected()
Return true if connected to remote service |
static java.lang.String |
getHostName(java.lang.String nodeURL)
Return the 'hostname' portion of the remote service's URL. |
RemoteService |
getProxy()
Get service proxy |
protected void |
notifyListeners(boolean connected)
Notify listeners of connection status |
void |
resetConnection()
Set service reference to 'null', so that next access attempt will result in reconnection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.log4j.Logger _log4j
protected static final int REFRESH_INTERVAL_MSEC
protected long _lastRefreshTime
protected RemoteService _service
protected java.lang.String _serviceURL
protected java.lang.String _serviceMnemonic
protected java.util.Vector _statusListeners
protected java.net.InetAddress _serviceAddr
protected NodeProbe _nodeProbe
protected static final int PROBE_TIMEOUT_MSEC
protected static final int RMIREGISTRY_PORT
protected java.lang.Object _lock
| Constructor Detail |
|---|
public ManagedRemoteService(java.lang.String serviceURL,
java.lang.String serviceMnemonic,
int pingIntervalMsec)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public void resetConnection()
protected void notifyListeners(boolean connected)
public RemoteService connect()
throws java.lang.Exception
java.lang.Exceptionpublic boolean connected()
public RemoteService getProxy()
throws java.lang.Exception
java.lang.Exceptionpublic void addListener(ManagedRemoteService.StatusListener listener)
public static java.lang.String getHostName(java.lang.String nodeURL)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||