org.jacorb.imr
Class ImRServerInfo
java.lang.Object
org.jacorb.imr.ImRServerInfo
- java.io.Serializable
public class ImRServerInfo
extends java.lang.Object
implements java.io.Serializable
This class contains the information about a logical server.
It has methods for managing the associated POAs, holding and
releasing the server, and, for the "client side", a method
that blocks until the server is released.
Version:
- Nicolas Noffke
- Serialized Form
ImRServerInfo(String name, String host, String command) - The Constructor.
|
void | addPOA(ImRPOAInfo poa) - Adds a POA to this server.
|
void | awaitRelease() - This method blocks until the server is released, i.e. set
to not holding.
|
protected String[] | getPOANames() - Builds an array of of the names of the POAs associated with this server.
|
void | release() - Release the server and unblock all waiting threads.
|
void | setDown() - Sets the server down, i.e. not active.
|
void | setNotRestarting()
|
boolean | shouldBeRestarted() - Tests if this server should be restarted.
|
ServerInfo | toServerInfo() - "Converts" this Object to a
ServerInfo instance containing
the same info as this object.
|
active
protected boolean active
command
protected String command
holding
protected boolean holding
host
protected String host
name
protected String name
restarting
protected boolean restarting
ImRServerInfo
public ImRServerInfo(String name,
String host,
String command)
throws IllegalServerName
The Constructor. It sets up the internal attributes.
name
- the logical server namehost
- the name of the host on which the server should be restarted
(ignored when no startup command is specified).command
- the startup command for this server, passed to the
server startup daemon on host
(in case there is one active).
IllegalServerName
- thrown when name
is
null
or of length zero.
addPOA
public void addPOA(ImRPOAInfo poa)
Adds a POA to this server.
poa
- the POA to add.
awaitRelease
public void awaitRelease()
This method blocks until the server is released, i.e. set
to not holding.
This will not time out since holding a
server is only done by administrators.
getPOANames
protected String[] getPOANames()
Builds an array of of the names of the POAs associated with this server.
This method is needed for deleting a server since its POAs have to be
as well removed from the central storage.
- an array of POA names
release
public void release()
Release the server and unblock all waiting threads.
setDown
public void setDown()
Sets the server down, i.e. not active. If a request for a POA
of this server is received, the repository tries to restart the server.
The server is automatically set back to active when the first of
its POAs gets reregistered.
setNotRestarting
public void setNotRestarting()
shouldBeRestarted
public boolean shouldBeRestarted()
Tests if this server should be restarted. That is the
case if the server is not active and nobody else is currently
trying to restart it.
If true is returned the server is set to restarting. That means
the thread calling this method has to restart the server,
otherwise it will stay down indefinetly.
- true, if the server should be restarted by the calling thread.
toServerInfo
public ServerInfo toServerInfo()
"Converts" this Object to a ServerInfo
instance containing
the same info as this object.
- a
ServerInfo
object.