All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.sun.jaw.impl.adaptor.generic.AdaptorServer
AdaptorServer class defines generic behaviour for the server
part of an adaptor. Most adaptors extend AdaptorServer and
inherit this behaviour. Adaptors that do not fit this model do not extend
AdaptorServer.
An AdaptorServer is an active object, it listens for client requests
and processes them in its own thread. When necessary, an AdaptorServer
creates other threads to process multiple requests concurrently.
An AdaptorServer object can be stopped by calling the performStop
method. When it is stopped, the AdaptorServer no longer listens to client
requests and no longer holds any thread or communication resources.
It can be started again by calling the performStart method.
An AdaptorServer has a state property which reflects its
activity.
| AdaptorServer | State |
|---|---|
running | ONLINE |
stopped | OFFLINE |
stopping | STOPPING |
The STOPPING state marks the transition from ONLINE to
OFFLINE. This occurs when the AdaptorServer is
finishing or interrupting active requests.
An AdaptorServer may serve several clients concurrently. The
number of concurrent clients can be limited using the property
maxActiveClientCount. The default value of this property is
defined by the subclasses.
When an AdaptorServer is registered in the framework, it is
started automatically. When it is unregistered from the framework it is
stopped automatically.
AdaptorServer
AdaptorServer.
AdaptorServer can
process concurrently.
AdaptorServer.
AdaptorServer.
AdaptorServer
since its creation.
AdaptorServer.
AdaptorServer in string form.
AdaptorServer is active.
AdaptorServer.
AdaptorServer.
AdaptorServer can
process concurrently.
public static final int ONLINE
public static final int OFFLINE
public static final int STOPPING
public AdaptorServer()
AdaptorServer
public synchronized void performStart()
AdaptorServer.
Has no effect if this AdaptorServer is ONLINE or
STOPPING.
public void performStop()
AdaptorServer.
Has no effect if this AdaptorServer is OFFLINE or
STOPPING.
public boolean isActive()
AdaptorServer is active.
public boolean performWaitState(int s,
long timeOut)
The method returns immediately is the timeOut argument is negative. And if timeOut argument equals 0 (zero), it waits only until another thread notifies a new state that is the same as s argument.
public Integer getState()
AdaptorServer.
ONLINE, OFFLINE or STOPPING.
public String getStateString()
AdaptorServer in string form.
public Integer getPort()
AdaptorServer.
AdaptorServer.
public Integer getServedClientCount()
AdaptorServer
since its creation.
AdaptorServer
since its creation. This counter is not reset by the performStop method.
public Integer getActiveClientCount()
AdaptorServer.
AdaptorServer.
public Integer getMaxActiveClientCount()
AdaptorServer can
process concurrently.
AdaptorServer can
process concurrently.
public void setMaxActiveClientCount(Integer c)
AdaptorServer can
process concurrently.
public void notifyClientHandlerCreated(ClientHandler h)
public synchronized void notifyClientHandlerDeleted(ClientHandler h)
public void initCmf(Framework f,
ObjectName name,
boolean db,
ModificationList list) throws InstanceAlreadyExistException
Calls the performStart method if this adaptor is OFFLINE.
public void deleteCmf() throws InstanceNotFoundException, InvocationTargetException
Calls the performStop method if this adaptor is ONLINE.
public abstract String getProtocol()
AdaptorServer.
public void run()
The run method executed by this adaptor's main thread.
public synchronized void addAdaptorListener(AdaptorListener listener)
public synchronized void removeAdaptorListener(AdaptorListener listener)
All Packages Class Hierarchy This Package Previous Next Index