All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.Service
java.lang.Object
|
+----sun.server.Service
- public class Service
- extends Object
- implements Runnable
An abstract class for implementing network services that manage multiple
connection handler threads.
-
avail
- The number of handler threads waiting for connections.
-
handlers
- The thread group for handler threads.
-
maxThreads
- Maximum number of handler threads.
-
minThreads
- Minimum number of handler threads.
-
params
- The parameters for this service.
-
port
- The service port number.
-
serviceConfig
- Service configuration for this service.
-
serviceRoot
- Service root directory.
-
shutdown
- Set to true when service shutdown is in progress.
-
shutdownComplete
- Set to true when service shutdown is complete.
-
timeout
- Handler thread timeout.
-
total
- The total number of handler threads.
-
useNative
- Set to true if native library support is available.
-
Service()
- Creates a new service with default parameters.
-
Service(ServiceParameters)
-
-
createHandler()
- Creates a new connection handler.
-
error(String)
- Issues a non-fatal error message and returns.
-
error(String, Exception)
- Issues a non-fatal error message with exception trace and returns.
-
fatal(String)
- Issues a fatal (non-recoverable) error message and then exits.
-
fatal(String, Exception)
- Issues a fatal (non-recoverable) error message with exception trace
and then exits.
-
getConfiguration()
-
Get the configuration for the service.
-
getServiceParameters()
- Returns the parameters for this service.
-
getServiceRoot()
- Returns service root directory.
-
init()
- Initialize the service.
-
init(ServiceConfiguration)
- Initializes the service with specified configuration.
-
inShutdown()
- Returns true if this service is in the process of a shutdown.
-
isShutdownComplete()
- Returns true if this service has completed its shutdown.
-
run()
- Starts the service.
-
shutdown()
- Initiates service shutdown.
-
waitJeevesEvent()
- Blocks until the Jeeves Event is triggered.
serviceRoot
protected String serviceRoot
- Service root directory.
handlers
protected ThreadGroup handlers
- The thread group for handler threads.
minThreads
protected int minThreads
- Minimum number of handler threads.
maxThreads
protected int maxThreads
- Maximum number of handler threads.
timeout
protected long timeout
- Handler thread timeout.
port
protected int port
- The service port number.
avail
protected int avail
- The number of handler threads waiting for connections.
total
protected int total
- The total number of handler threads.
shutdown
protected boolean shutdown
- Set to true when service shutdown is in progress.
shutdownComplete
protected boolean shutdownComplete
- Set to true when service shutdown is complete.
params
protected ServiceParameters params
- The parameters for this service.
useNative
protected static boolean useNative
- Set to true if native library support is available.
serviceConfig
protected ServiceConfiguration serviceConfig
- Service configuration for this service.
Service
protected Service(ServiceParameters params)
Service
protected Service()
- Creates a new service with default parameters.
init
protected abstract void init(ServiceConfiguration configuration)
- Initializes the service with specified configuration.
init
protected void init()
- Initialize the service. Called from ServerProcess when the service
is created.
run
public void run()
- Starts the service. Will return when service has been stopped.
createHandler
protected abstract ServiceHandler createHandler()
- Creates a new connection handler.
- Returns:
- the handler object
getServiceParameters
public ServiceParameters getServiceParameters()
- Returns the parameters for this service.
shutdown
protected synchronized void shutdown()
- Initiates service shutdown.
inShutdown
public synchronized boolean inShutdown()
- Returns true if this service is in the process of a shutdown.
isShutdownComplete
public synchronized boolean isShutdownComplete()
- Returns true if this service has completed its shutdown.
error
protected void error(String s)
- Issues a non-fatal error message and returns.
- Parameters:
- s - the error message
error
protected void error(String s,
Exception e)
- Issues a non-fatal error message with exception trace and returns.
- Parameters:
- s - the error message
- e - the error exception
fatal
protected void fatal(String s)
- Issues a fatal (non-recoverable) error message and then exits.
- Parameters:
- s - the error message
fatal
protected void fatal(String s,
Exception e)
- Issues a fatal (non-recoverable) error message with exception trace
and then exits.
- Parameters:
- s - the error message
- e - the error exception
getConfiguration
protected ServiceConfiguration getConfiguration()
- Get the configuration for the service.
- Returns:
- the service's configuration.
getServiceRoot
public String getServiceRoot()
- Returns service root directory.
- Returns:
- the service's root.
waitJeevesEvent
public void waitJeevesEvent()
- Blocks until the Jeeves Event is triggered. The thread invoking this
method should invoke the shutdown() method on returning from this
method.
All Packages Class Hierarchy This Package Previous Next Index