public class MaciSupervisor extends java.lang.Object implements IMaciSupervisor
| Modifier and Type | Class and Description |
|---|---|
protected class |
MaciSupervisor.AdministratorImplementation
Implementation of Administrator Interface
|
protected class |
MaciSupervisor.ManagerConnectionExceptionHandler |
protected class |
MaciSupervisor.RefreshIfNeeded |
IMaciSupervisor.CannotRetrieveManagerException, IMaciSupervisor.CorbaNoPermissionException, IMaciSupervisor.CorbaNotExistException, IMaciSupervisor.CorbaTransientException, IMaciSupervisor.CorbaUnknownException, IMaciSupervisor.MaciSupervisorException, IMaciSupervisor.NotConnectedToManagerException, IMaciSupervisor.UnknownErrorException| Modifier and Type | Field and Description |
|---|---|
protected MaciSupervisor.AdministratorImplementation |
acImpl
Instantiated in constructor.
|
protected ClientInfo |
administratorClientInfo
assigned in connectToManager().
|
protected boolean |
connectsAutomatically |
protected boolean |
infoShouldBeRefreshed
The 'refresh needed' flag used by the lazy-refresh timer task.
|
protected java.util.logging.Logger |
log |
protected MaciInfo |
maciInfo |
protected java.lang.String |
managerLoc |
protected Manager |
managerRef
assigned in connectToManager()
|
protected MaciSupervisor.ManagerConnectionExceptionHandler |
mcehandler |
protected java.lang.String |
name |
protected org.omg.CORBA.ORB |
orb |
protected int |
refreshCountdown |
protected int |
refreshCountFrom |
protected int |
refreshLag |
protected MaciSupervisor.RefreshIfNeeded |
refreshTask |
protected boolean |
refreshWithoutACause |
protected java.util.Timer |
timer |
MSG_ERROR, MSG_INFORMATION| Modifier | Constructor and Description |
|---|---|
protected |
MaciSupervisor(java.lang.String clientName,
java.lang.String managerLoc,
org.omg.CORBA.ORB orb,
java.util.logging.Logger log)
Creates a MaciSupervisor running on the given ORB, it will connect to the specified
manager.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
connectToManager() |
protected void |
disconnectFromManager() |
void |
dismissManager()
msc (2004-11-09): This was requested, suggested, and agreed upon as a workaround for
the situation where a manager has gone down (and the application using this
macisupervisor knows that the manager is down, e.g.
|
protected java.lang.String |
extractLocation(org.omg.CORBA.Object reference)
Helper for createNode()
|
MaciInfo |
getMaciInfo()
Returns a TreeModel compiled from information from the Acs manager.
|
MaciInfo |
getMaciInformation()
Returns a TreeModel compiled from information from the Acs manager.
|
java.lang.String |
getManagerLocation()
Some people are interested in the weirdest things..
|
boolean |
isConnected()
Whether this is connected
|
int |
myMaciHandle()
Returns the handle given by the manager.
|
protected Manager |
myManagerReference() |
void |
refreshNow()
Tries to refresh the component-section, container-section, and client-section
of the info tree model.
|
void |
refreshSoon()
Request the MaciInfo be refreshed in the background.
|
protected ClientInfo[] |
retrieveClientInfo(java.lang.String name_wildcard) |
protected ComponentInfo[] |
retrieveComponentInfo(java.lang.String name_wildcard) |
protected ContainerInfo[] |
retrieveContainerInfo(java.lang.String name_wildcard)
The containerHandles argument cannot be specified here.
|
void |
setConnectsAutomatically(boolean b) |
void |
setRefreshDelay(int lag,
int period)
Configures the polling rate and responsiveness for updates from
the manager.
|
void |
setRefreshesPeriodically(boolean b)
Refresh every once in a while, even if there wasn't any
indication from the manager that something has changed.
|
void |
start()
This start implementation is smart, it can be called repeatedly.
|
void |
stop()
Tear down this instance.
|
java.lang.String |
toString()
Overridden to provide pretty description.
|
protected java.lang.String name
protected java.lang.String managerLoc
protected org.omg.CORBA.ORB orb
protected java.util.logging.Logger log
protected volatile boolean connectsAutomatically
protected volatile MaciSupervisor.ManagerConnectionExceptionHandler mcehandler
protected final MaciInfo maciInfo
protected volatile boolean refreshWithoutACause
protected volatile int refreshCountdown
protected volatile int refreshCountFrom
protected volatile int refreshLag
protected MaciSupervisor.RefreshIfNeeded refreshTask
protected java.util.Timer timer
protected Manager managerRef
protected volatile boolean infoShouldBeRefreshed
protected volatile ClientInfo administratorClientInfo
protected volatile MaciSupervisor.AdministratorImplementation acImpl
protected MaciSupervisor(java.lang.String clientName,
java.lang.String managerLoc,
org.omg.CORBA.ORB orb,
java.util.logging.Logger log)
clientName - name-prefix like "AcsCommandCenter" or "OMC"managerLoc - the manager corbalocorb - the orb to usepublic void setConnectsAutomatically(boolean b)
public void start()
throws NoPermissionEx,
IMaciSupervisor.CannotRetrieveManagerException,
IMaciSupervisor.CorbaTransientException,
IMaciSupervisor.CorbaNotExistException,
IMaciSupervisor.UnknownErrorException
start in interface IMaciSupervisorNoPermissionExCorbaTransientExceptionCorbaNotExistExceptionUnknownErrorExceptionIMaciSupervisor.CannotRetrieveManagerExceptionIMaciSupervisor.CorbaTransientExceptionIMaciSupervisor.CorbaNotExistExceptionIMaciSupervisor.UnknownErrorExceptionpublic void stop()
stop in interface IMaciSupervisorpublic void dismissManager()
dismissManager in interface IMaciSupervisorpublic boolean isConnected()
isConnected in interface IMaciSupervisorpublic int myMaciHandle()
throws IMaciSupervisor.NotConnectedToManagerException
IMaciSupervisormyMaciHandle in interface IMaciSupervisorNotConnectedToManagerExceptionIMaciSupervisor.NotConnectedToManagerExceptionprotected Manager myManagerReference()
throws IMaciSupervisor.NotConnectedToManagerException
NotConnectedToManagerExceptionIMaciSupervisor.NotConnectedToManagerExceptionpublic java.lang.String getManagerLocation()
getManagerLocation in interface IMaciSupervisorprotected void connectToManager()
throws IMaciSupervisor.CannotRetrieveManagerException,
NoPermissionEx,
org.omg.CORBA.SystemException
IMaciSupervisor.CannotRetrieveManagerExceptionNoPermissionExorg.omg.CORBA.SystemExceptionprotected void disconnectFromManager()
protected ContainerInfo[] retrieveContainerInfo(java.lang.String name_wildcard)
throws IMaciSupervisor.NotConnectedToManagerException,
NoPermissionEx,
org.omg.CORBA.SystemException
name_wildcard - not verified to work as expected, recommended to use '*'.NoPermissionExNotConnectedToManagerExceptionorg.omg.CORBA.SystemExceptionIMaciSupervisor.NotConnectedToManagerExceptionprotected ClientInfo[] retrieveClientInfo(java.lang.String name_wildcard)
throws IMaciSupervisor.NotConnectedToManagerException,
NoPermissionEx,
org.omg.CORBA.SystemException
NoPermissionExNotConnectedToManagerExceptionorg.omg.CORBA.SystemExceptionIMaciSupervisor.NotConnectedToManagerExceptionprotected ComponentInfo[] retrieveComponentInfo(java.lang.String name_wildcard)
throws IMaciSupervisor.NotConnectedToManagerException,
NoPermissionEx,
org.omg.CORBA.SystemException
NoPermissionExNotConnectedToManagerExceptionorg.omg.CORBA.SystemExceptionIMaciSupervisor.NotConnectedToManagerExceptionpublic MaciInfo getMaciInfo() throws NoPermissionEx, IMaciSupervisor.NotConnectedToManagerException, IMaciSupervisor.CorbaTransientException, IMaciSupervisor.CorbaNotExistException, IMaciSupervisor.UnknownErrorException
A call to this method will automatically trigger a refresh, possibly
throwing an exception or blocking the current thread for a long time. Calling
getMaciInformation() and refreshSoon() will shield you from
these effects.
getMaciInfo in interface IMaciSupervisornullNotConnectedToManagerExceptionNoPermissionExUnknownErrorExceptionCorbaNotExistExceptionCorbaTransientExceptionIMaciSupervisor.NotConnectedToManagerExceptionIMaciSupervisor.CorbaTransientExceptionIMaciSupervisor.CorbaNotExistExceptionIMaciSupervisor.UnknownErrorExceptionpublic MaciInfo getMaciInformation()
The returned model may be out-of-date. Call refreshSoon() to have it updated.
nullpublic void refreshSoon()
public void setRefreshesPeriodically(boolean b)
public void setRefreshDelay(int lag,
int period)
lag - - the worst-case response time before updates
from the manager will be adopted. Note that the average response
time is only 1/2 of this. By accepting a higher lag you can
reduce the load on the manager, and vice-versa.period - - the interval by which the manager is polled for
new updates. By accepting a longer period you can reduce the load
on the manager, and vice-versa.public void refreshNow()
throws NoPermissionEx,
IMaciSupervisor.NotConnectedToManagerException,
org.omg.CORBA.SystemException,
IMaciSupervisor.CorbaTransientException,
IMaciSupervisor.CorbaNotExistException,
IMaciSupervisor.UnknownErrorException
getMaciInformation() and refreshSoon() will shield you from
these effects.NoPermissionEx - error during refreshNotConnectedToManagerException - error during refreshCorbaTransientExceptionCorbaNotExistExceptionUnknownErrorExceptionIMaciSupervisor.NotConnectedToManagerExceptionorg.omg.CORBA.SystemExceptionIMaciSupervisor.CorbaTransientExceptionIMaciSupervisor.CorbaNotExistExceptionIMaciSupervisor.UnknownErrorExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String extractLocation(org.omg.CORBA.Object reference)
{host, port}, or null on failure