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.


Variable Index

 o avail
The number of handler threads waiting for connections.
 o handlers
The thread group for handler threads.
 o maxThreads
Maximum number of handler threads.
 o minThreads
Minimum number of handler threads.
 o params
The parameters for this service.
 o port
The service port number.
 o serviceConfig
Service configuration for this service.
 o serviceRoot
Service root directory.
 o shutdown
Set to true when service shutdown is in progress.
 o shutdownComplete
Set to true when service shutdown is complete.
 o timeout
Handler thread timeout.
 o total
The total number of handler threads.
 o useNative
Set to true if native library support is available.

Constructor Index

 o Service()
Creates a new service with default parameters.
 o Service(ServiceParameters)

Method Index

 o createHandler()
Creates a new connection handler.
 o error(String)
Issues a non-fatal error message and returns.
 o error(String, Exception)
Issues a non-fatal error message with exception trace and returns.
 o fatal(String)
Issues a fatal (non-recoverable) error message and then exits.
 o fatal(String, Exception)
Issues a fatal (non-recoverable) error message with exception trace and then exits.
 o getConfiguration()
Get the configuration for the service.
 o getServiceParameters()
Returns the parameters for this service.
 o getServiceRoot()
Returns service root directory.
 o init()
Initialize the service.
 o init(ServiceConfiguration)
Initializes the service with specified configuration.
 o inShutdown()
Returns true if this service is in the process of a shutdown.
 o isShutdownComplete()
Returns true if this service has completed its shutdown.
 o run()
Starts the service.
 o shutdown()
Initiates service shutdown.
 o waitJeevesEvent()
Blocks until the Jeeves Event is triggered.

Variables

 o serviceRoot
  protected String serviceRoot
Service root directory.

 o handlers
  protected ThreadGroup handlers
The thread group for handler threads.

 o minThreads
  protected int minThreads
Minimum number of handler threads.

 o maxThreads
  protected int maxThreads
Maximum number of handler threads.

 o timeout
  protected long timeout
Handler thread timeout.

 o port
  protected int port
The service port number.

 o avail
  protected int avail
The number of handler threads waiting for connections.

 o total
  protected int total
The total number of handler threads.

 o shutdown
  protected boolean shutdown
Set to true when service shutdown is in progress.

 o shutdownComplete
  protected boolean shutdownComplete
Set to true when service shutdown is complete.

 o params
  protected ServiceParameters params
The parameters for this service.

 o useNative
  protected static boolean useNative
Set to true if native library support is available.

 o serviceConfig
  protected ServiceConfiguration serviceConfig
Service configuration for this service.

Constructors

 o Service
  protected Service(ServiceParameters params)
 o Service
  protected Service()
Creates a new service with default parameters.

Methods

 o init
  protected abstract void init(ServiceConfiguration configuration)
Initializes the service with specified configuration.

 o init
  protected void init()
Initialize the service. Called from ServerProcess when the service is created.

 o run
  public void run()
Starts the service. Will return when service has been stopped.

 o createHandler
  protected abstract ServiceHandler createHandler()
Creates a new connection handler.

Returns:
the handler object
 o getServiceParameters
  public ServiceParameters getServiceParameters()
Returns the parameters for this service.

 o shutdown
  protected synchronized void shutdown()
Initiates service shutdown.

 o inShutdown
  public synchronized boolean inShutdown()
Returns true if this service is in the process of a shutdown.

 o isShutdownComplete
  public synchronized boolean isShutdownComplete()
Returns true if this service has completed its shutdown.

 o error
  protected void error(String s)
Issues a non-fatal error message and returns.

Parameters:
s - the error message
 o 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
 o fatal
  protected void fatal(String s)
Issues a fatal (non-recoverable) error message and then exits.

Parameters:
s - the error message
 o 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
 o getConfiguration
  protected ServiceConfiguration getConfiguration()
Get the configuration for the service.

Returns:
the service's configuration.
 o getServiceRoot
  public String getServiceRoot()
Returns service root directory.

Returns:
the service's root.
 o 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