jason.core
Class HTTPService

java.lang.Object
  |
  +--jason.core.AbstractService
        |
        +--jason.core.ThreadableService
              |
              +--jason.core.TaskableService
                    |
                    +--jason.core.SocketService
                          |
                          +--jason.core.ProcessableService
                                |
                                +--jason.core.HTTPService
All Implemented Interfaces:
java.io.Serializable, Service, ServiceDataListener

public abstract class HTTPService
extends ProcessableService

HTTPService This service is for processable task, it is able to get all the request from a socket object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class jason.core.SocketService
port, serverSocket, traceRequest
 
Fields inherited from class jason.core.ThreadableService
activeThread
 
Fields inherited from class jason.core.AbstractService
INITIALIZED, name, NOSTATE, serviceContext, STARTED, STOPPED
 
Fields inherited from interface jason.core.Service
ERROR_MESSAGE, INFORMATION_MESSAGE, VERBOSE_MESSAGE, WARNING_MESSAGE
 
Constructor Summary
HTTPService()
           
 
Method Summary
protected  byte[] getHostRequestFromInputStream(java.io.InputStream in)
          This method returns an array of bytes with the full user request, this is needed for load balancing between several process.
protected abstract  Task getTaskForSocket(java.net.Socket host)
           
 
Methods inherited from class jason.core.ProcessableService
fireSocketAccept, notifyBadPort, setLoadBalancingMax
 
Methods inherited from class jason.core.SocketService
beforeRun, fireConflictDetected, getSocketTimeout, notifyData, notifyInitReady, run, setBacklog, setSocketTimeout, setTraceRequest, start
 
Methods inherited from class jason.core.TaskableService
notifyTask
 
Methods inherited from class jason.core.ThreadableService
actionForStart, enableServiceForThread, getThreadLoopDelay, isThreadLoopMode, isThreadStarted, isWaiting, notifyThreadRunning, runThread, setPriority, setThreadLoopDelay, setThreadLoopMode, threadNotify, threadWait
 
Methods inherited from class jason.core.AbstractService
checkForContext, fireCriticalErrorDetected, getBooleanProperty, getInfo, getIntProperty, getName, getPropertiesName, getProperty, getServiceContext, getServiceState, getState, getStringProperty, getType, getVersion, hasServiceContext, init, isAutoStop, isEnabled, isInitialized, isOverride, isPersistent, isPrivate, isProcessable, isStarted, isStopped, isTest, isThreadable, isVerbose, manageRequest, manageRequestForType, notifyStartReady, notifyStopReady, postStop, restart, sendCustomMessage, sendErrorMessage, sendInformationMessage, sendInnerError, sendWarningMessage, setAutoStop, setEnabled, setName, setPersistent, setPrivate, setProperty, setServiceContext, setTest, setType, setVerbose, setVersion, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPService

public HTTPService()
Method Detail

getHostRequestFromInputStream

protected byte[] getHostRequestFromInputStream(java.io.InputStream in)
                                        throws java.io.IOException
This method returns an array of bytes with the full user request, this is needed for load balancing between several process. By default this method tries to read until two '\n' or the end of the stream. If your protocol doesn't limit the scope of the request with the same method, please override this method.

Specified by:
getHostRequestFromInputStream in class ProcessableService
Parameters:
in - InputStream from the user request
Returns:
the request if a byte array
java.io.IOException

getTaskForSocket

protected abstract Task getTaskForSocket(java.net.Socket host)
                                  throws ServiceException
Specified by:
getTaskForSocket in class ProcessableService
Returns:
a task for a user socker
ServiceException