|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--arlut.csd.ganymede.serverAdminProxy
serverAdminProxy is a server-side Admin object which buffers console status updates, coalescing update events as needed to maximize server efficiency. Each serverAdminProxy object has a background thread which communicates with an admin console in the background, allowing the Ganymede server's operations to be asynchronous with respect to admin console updates.
adminEvent| Field Summary | |
private static int |
classCounter
Used to generate a unique name for our background thread. |
private java.lang.Thread |
commThread
Our background communications thread, which is responsible for calling the admin console via RMI. |
private static boolean |
debug
|
private int |
dequeuePtr
|
private boolean |
done
If true, we have been told to shut down, and our background commThread will exit as soon as it can clear its event queue. |
private int |
ebSz
|
private int |
enqueuePtr
|
private arlut.csd.ganymede.adminEvent[] |
eventBuffer
Our queue of adminEvent objects. |
private arlut.csd.ganymede.adminEvent[] |
lookUp
Handy direct look-up table for events in eventBuffer |
private int |
maxBufferSize
How many events we'll queue up before deciding that the admin console isn't responding. |
private arlut.csd.ganymede.Admin |
remoteConsole
Our remote reference to the admin console client |
| Constructor Summary | |
serverAdminProxy(arlut.csd.ganymede.Admin remoteConsole)
|
|
| Method Summary | |
private void |
addEvent(arlut.csd.ganymede.adminEvent newEvent)
private helper method in serverAdminProxy, used to add an event to the proxy's event buffer. |
void |
changeAdmins(java.lang.String adminStatus)
This method is called by the Ganymede server to update the number of admin consoles attached to the server. |
void |
changeState(java.lang.String state)
This method is called by the Ganymede server to update the admin console's server state display. |
void |
changeStatus(java.lang.String status)
This method is called by the Ganymede server to add to the admin console's log display. |
void |
changeTasks(java.util.Vector tasks)
This method is called by the Ganymede server to update the admin console's task table. |
void |
changeUsers(java.util.Vector entries)
This method is called by the Ganymede server to update the admin console's connected user table. |
private arlut.csd.ganymede.adminEvent |
dequeue()
private dequeue method. |
private void |
enqueue(arlut.csd.ganymede.adminEvent item)
private enqueue method. |
void |
forceDisconnect(java.lang.String reason)
Callback: The server can tell us to disconnect if the server is going down. |
java.lang.String |
getName()
This method is called by the Ganymede server to obtain the username given when the admin console was started. |
java.lang.String |
getPassword()
This method is called by the Ganymede server to obtain the password given when the admin console was started. |
boolean |
isAlive()
Returns true if we are successfully in communications with the attached admin console. |
private void |
replaceEvent(byte method,
java.lang.Object param)
private helper method in serverAdminProxy, used to add an event to the proxy's event buffer. |
void |
run()
The serverAdminProxy's background thread's run() method. |
void |
setLastDumpTime(java.util.Date date)
This method is called by the Ganymede server to set the last dump date in the admin console. |
void |
setLocksHeld(int locks)
This method is called by the Ganymede server to set the number of locks held in the admin console. |
void |
setMemoryState(long freeMem,
long totalMem)
This method is called by the Ganymede server to update the memory status display in the admin console. |
void |
setObjectsCheckedOut(int objs)
This method is called by the Ganymede server to set the number of objects checked out in the admin console. |
void |
setServerStart(java.util.Date date)
This method is called by the Ganymede server to set the server start date in the admin console. |
void |
setTransactionsInJournal(int trans)
This method is called by the Ganymede server to set the number of transactions in the server's journal in the admin console. |
void |
shutdown()
This method shuts down the background thread. |
private void |
throwOverflow()
This method throws a remoteException which describes the state of the event buffer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final boolean debug
private static int classCounter
Used to generate a unique name for our background thread.
private java.lang.Thread commThread
Our background communications thread, which is responsible for calling the admin console via RMI.
private final arlut.csd.ganymede.adminEvent[] eventBuffer
Our queue of adminEvent objects.
private int enqueuePtr
private int dequeuePtr
private int ebSz
private final int maxBufferSize
How many events we'll queue up before deciding that the admin console isn't responding. Right now all events are either being handled with coalesce or replace, so we should never, ever have more objects in our eventBuffer than we have types of events.
private arlut.csd.ganymede.Admin remoteConsole
Our remote reference to the admin console client
private volatile boolean done
If true, we have been told to shut down, and our background commThread will exit as soon as it can clear its event queue.
.Volatile because we use this as part of our thread synchronization logic.
private arlut.csd.ganymede.adminEvent[] lookUp
Handy direct look-up table for events in eventBuffer
| Constructor Detail |
public serverAdminProxy(arlut.csd.ganymede.Admin remoteConsole)
| Method Detail |
public boolean isAlive()
Returns true if we are successfully in communications with the attached admin console.
public void shutdown()
This method shuts down the background thread.
public java.lang.String getName()
throws java.rmi.RemoteException
This method is called by the Ganymede server to obtain the username given when the admin console was started.
getName in interface Adminjava.rmi.RemoteException
public java.lang.String getPassword()
throws java.rmi.RemoteException
This method is called by the Ganymede server to obtain the password given when the admin console was started.
getPassword in interface Adminjava.rmi.RemoteException
public void forceDisconnect(java.lang.String reason)
throws java.rmi.RemoteException
forceDisconnect in interface Adminjava.rmi.RemoteException
public void setServerStart(java.util.Date date)
throws java.rmi.RemoteException
This method is called by the Ganymede server to set the server start date in the admin console.
setServerStart in interface Adminjava.rmi.RemoteException
public void setLastDumpTime(java.util.Date date)
throws java.rmi.RemoteException
This method is called by the Ganymede server to set the last dump date in the admin console.
setLastDumpTime in interface Adminjava.rmi.RemoteException
public void setTransactionsInJournal(int trans)
throws java.rmi.RemoteException
This method is called by the Ganymede server to set the number of transactions in the server's journal in the admin console.
setTransactionsInJournal in interface Adminjava.rmi.RemoteException
public void setObjectsCheckedOut(int objs)
throws java.rmi.RemoteException
This method is called by the Ganymede server to set the number of objects checked out in the admin console.
setObjectsCheckedOut in interface Adminjava.rmi.RemoteException
public void setLocksHeld(int locks)
throws java.rmi.RemoteException
This method is called by the Ganymede server to set the number of locks held in the admin console.
setLocksHeld in interface Adminjava.rmi.RemoteException
public void setMemoryState(long freeMem,
long totalMem)
throws java.rmi.RemoteException
This method is called by the Ganymede server to update the memory status display in the admin console.
setMemoryState in interface Adminjava.rmi.RemoteException
public void changeState(java.lang.String state)
throws java.rmi.RemoteException
This method is called by the Ganymede server to update the admin console's server state display.
changeState in interface Adminjava.rmi.RemoteException
public void changeStatus(java.lang.String status)
throws java.rmi.RemoteException
This method is called by the Ganymede server to add to the admin console's log display.
changeStatus in interface Adminjava.rmi.RemoteException
public void changeAdmins(java.lang.String adminStatus)
throws java.rmi.RemoteException
This method is called by the Ganymede server to update the number of admin consoles attached to the server.
changeAdmins in interface Adminjava.rmi.RemoteException
public void changeUsers(java.util.Vector entries)
throws java.rmi.RemoteException
This method is called by the Ganymede server to update the admin console's connected user table.
changeUsers in interface Adminentries - a Vector of AdminEntry
login description objects.
java.rmi.RemoteException
public void changeTasks(java.util.Vector tasks)
throws java.rmi.RemoteException
This method is called by the Ganymede server to update the admin console's task table.
changeTasks in interface Admintasks - a Vector of scheduleHandle
objects describing the tasks registered in the Ganymede server.
java.rmi.RemoteExceptionpublic void run()
The serverAdminProxy's background thread's run() method. This method runs in the admin console proxy thread to read events from this console's serverAdminProxy eventBuffer and send them down to the admin console.
run in interface java.lang.Runnable
private void addEvent(arlut.csd.ganymede.adminEvent newEvent)
throws java.rmi.RemoteException
private helper method in serverAdminProxy, used to add an event to the proxy's event buffer. If the buffer already contains an event of the same type as newEvent, both events will be sent to the admin console, in chronological order.
java.rmi.RemoteException
private void replaceEvent(byte method,
java.lang.Object param)
throws java.rmi.RemoteException
private helper method in serverAdminProxy, used to add an event to the proxy's event buffer. If the buffer already contains an event of the same type as method, the old event's contents will be replaced with param, and the admin console will never be notified of the old event's contents.
java.rmi.RemoteException
private void throwOverflow()
throws java.rmi.RemoteException
This method throws a remoteException which describes the state
of the event buffer. This is called from addEvent and
replaceEvent. The GanymedeAdmin code that calls the Admin proxy methods in serverAdminProxy
take repeated remote exceptions as an indication that they need
to detach the admin console, which is why we use RemoteException.
java.rmi.RemoteExceptionprivate void enqueue(arlut.csd.ganymede.adminEvent item)
private arlut.csd.ganymede.adminEvent dequeue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||