Xindice API

org.apache.xindice.server
Interface Service

All Superinterfaces:
Named
All Known Implementing Classes:
SocketServer, APIService, XindiceService

public interface Service
extends Named

Services are implemented to provide a daemon process for various purposes. The most general implementation of a Service is to provide a Socket based service, but Services can be written to function in just about any capacity.

See Also:
ServiceManager

Field Summary
static int RESULT_BUSY
           
static int RESULT_FAILED
           
static int RESULT_INVALID
           
static int RESULT_OK
           
static int STATE_STARTED
           
static int STATE_STOPPED
           
static int STATE_SUSPENDED
           
 
Method Summary
 int initialize()
          initialize will initialize the Service based on its current configuration.
 int resume()
          resume resumes exection of a suspended Service.
 int start()
          start will attempt to start the Service.
 int status()
          status returns the current operational status of this Service.
 java.lang.String statusMessage()
          statusMessage returns a textual message about the Service's operational state.
 int stop()
          stop will attempt to stop the Service.
 int suspend()
          suspend suspends execution of the Service.
 int uninitialize()
          uninitialize will uninitialize the Service based on its current configuration and will clean up any existing resources for that configuration.
 
Methods inherited from interface org.apache.xindice.util.Named
getName
 

Field Detail

STATE_STOPPED

public static final int STATE_STOPPED

STATE_STARTED

public static final int STATE_STARTED

STATE_SUSPENDED

public static final int STATE_SUSPENDED

RESULT_OK

public static final int RESULT_OK

RESULT_BUSY

public static final int RESULT_BUSY

RESULT_FAILED

public static final int RESULT_FAILED

RESULT_INVALID

public static final int RESULT_INVALID
Method Detail

status

public int status()
status returns the current operational status of this Service. This value can either be STATE_STOPPED, STATE_STARTED, or STATE_SUSPENDED.
Returns:
The Service's status

statusMessage

public java.lang.String statusMessage()
statusMessage returns a textual message about the Service's operational state.
Returns:
The Service's status as a text message

initialize

public int initialize()
initialize will initialize the Service based on its current configuration. RESULT_INVALID will be returned if the Service's configuration is invalid.
Returns:
The initialization status

start

public int start()
start will attempt to start the Service. Depending on whether the Service was happy about being started or not, a value of RESULT_OK should be returned.
Returns:
The result of the start attempt

stop

public int stop()
stop will attempt to stop the Service. Depending on whether the Service was happy about being stopped or not, a value of RESULT_OK should be returned.
Returns:
The result of the stop attempt

suspend

public int suspend()
suspend suspends execution of the Service. It basically puts it into a paused state until it is resumed or started again. Depending on whether the Service was happy about being suspended or not, a value of RESULT_OK should be returned.
Returns:
The result of the suspend attempt

resume

public int resume()
resume resumes exection of a suspended Service. It will also start a stopped Service. Depending on whether the Service was happy about being resumed or not, a value of RESULT_OK should be returned.
Returns:
The result of the resume attempt

uninitialize

public int uninitialize()
uninitialize will uninitialize the Service based on its current configuration and will clean up any existing resources for that configuration. RESULT_INVALID will be returned if the Service's configuration is invalid.
Returns:
The uninitialization status

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation