Xindice API

org.apache.xindice.server.services
Class SocketServer

java.lang.Object
  |
  +--org.apache.xindice.util.SimpleConfigurable
        |
        +--org.apache.xindice.server.services.SocketServer
All Implemented Interfaces:
Configurable, KernelAccess, Named, java.lang.Runnable, Service
Direct Known Subclasses:
HTTPServer

public abstract class SocketServer
extends SimpleConfigurable
implements Service, KernelAccess, java.lang.Runnable

SocketServer is the generic base class for all of Xindice's Socket-based Services.


Field Summary
 int chunkSize
           
 java.lang.String hostname
           
 int keepalive
           
 Kernel kernel
           
 int linger
           
 int port
           
 boolean reverse
           
 int timeout
           
 
Fields inherited from interface org.apache.xindice.server.Service
RESULT_BUSY, RESULT_FAILED, RESULT_INVALID, RESULT_OK, STATE_STARTED, STATE_STOPPED, STATE_SUSPENDED
 
Constructor Summary
SocketServer()
           
 
Method Summary
 java.lang.String getHostname()
           
 java.lang.String getName()
          getName retrieves the contextually important name of the object
 int getPort()
           
abstract  java.lang.String getProtocol()
           
abstract  int initialize()
          initialize will initialize the Service based on its current configuration.
 int resume()
          resume resumes exection of a suspended Service.
abstract  void run()
           
 void setConfig(Configuration config)
          setConfig sets the configuration information for the Configurable object instance.
 void setKernel(Kernel kernel)
          setKernel provides a Kernel callback interface to the implementing object.
 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 class org.apache.xindice.util.SimpleConfigurable
getConfig
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kernel

public Kernel kernel

port

public int port

hostname

public java.lang.String hostname

keepalive

public int keepalive

linger

public int linger

timeout

public int timeout

reverse

public boolean reverse

chunkSize

public int chunkSize
Constructor Detail

SocketServer

public SocketServer()
Method Detail

setKernel

public void setKernel(Kernel kernel)
Description copied from interface: KernelAccess
setKernel provides a Kernel callback interface to the implementing object.
Specified by:
setKernel in interface KernelAccess
Following copied from interface: org.apache.xindice.server.KernelAccess
Parameters:
kernel - the Kernel reference

setConfig

public void setConfig(Configuration config)
               throws XindiceException
Description copied from interface: Configurable
setConfig sets the configuration information for the Configurable object instance.
Overrides:
setConfig in class SimpleConfigurable
Following copied from interface: org.apache.xindice.util.Configurable
Parameters:
config - The configuration Node

getName

public java.lang.String getName()
Description copied from interface: Named
getName retrieves the contextually important name of the object
Specified by:
getName in interface Named
Following copied from interface: org.apache.xindice.util.Named
Returns:
The object's name

status

public int status()
Description copied from interface: Service
status returns the current operational status of this Service. This value can either be STATE_STOPPED, STATE_STARTED, or STATE_SUSPENDED.
Specified by:
status in interface Service
Following copied from interface: org.apache.xindice.server.Service
Returns:
The Service's status

statusMessage

public java.lang.String statusMessage()
Description copied from interface: Service
statusMessage returns a textual message about the Service's operational state.
Specified by:
statusMessage in interface Service
Following copied from interface: org.apache.xindice.server.Service
Returns:
The Service's status as a text message

getProtocol

public abstract java.lang.String getProtocol()

getHostname

public java.lang.String getHostname()

getPort

public int getPort()

start

public int start()
Description copied from interface: Service
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.
Specified by:
start in interface Service
Following copied from interface: org.apache.xindice.server.Service
Returns:
The result of the start attempt

stop

public int stop()
Description copied from interface: Service
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.
Specified by:
stop in interface Service
Following copied from interface: org.apache.xindice.server.Service
Returns:
The result of the stop attempt

suspend

public int suspend()
Description copied from interface: Service
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.
Specified by:
suspend in interface Service
Following copied from interface: org.apache.xindice.server.Service
Returns:
The result of the suspend attempt

resume

public int resume()
Description copied from interface: Service
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.
Specified by:
resume in interface Service
Following copied from interface: org.apache.xindice.server.Service
Returns:
The result of the resume attempt

uninitialize

public int uninitialize()
Description copied from interface: Service
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.
Specified by:
uninitialize in interface Service
Following copied from interface: org.apache.xindice.server.Service
Returns:
The uninitialization status

initialize

public abstract int initialize()
Description copied from interface: Service
initialize will initialize the Service based on its current configuration. RESULT_INVALID will be returned if the Service's configuration is invalid.
Specified by:
initialize in interface Service
Following copied from interface: org.apache.xindice.server.Service
Returns:
The initialization status

run

public abstract void run()
Specified by:
run in interface java.lang.Runnable

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation