openlsd.multiple.ophandler.common
Class LSDOpHandlerHttpIoHandler

java.lang.Object
  extended by org.apache.mina.common.IoHandlerAdapter
      extended by openlsd.multiple.ophandler.common.LSDOpHandlerHttpIoHandler
All Implemented Interfaces:
org.apache.mina.common.IoHandler

public class LSDOpHandlerHttpIoHandler
extends org.apache.mina.common.IoHandlerAdapter

Http Service for the OpenLSD Server (Info, Clean, Shutdown)

Author:
Frederic BREGIER LGPL 2007

Field Summary
static java.lang.String CLEAN
          CLEAN COMMAND
static java.lang.String CSV
          CSV OPTION
 org.apache.mina.transport.socket.SocketAcceptor httpAcceptor
          SocketAcceptor for HTTP Service
static java.lang.String INFOSESSION
          INFO (Session statistics) COMMAND
static java.lang.String ORDER
          ORDER BASED URL
 org.apache.mina.filter.executor.OrderedThreadPoolExecutor orderedThreadPoolExecutor
          OrderedThreadPoolExecutor for HTTP Service
static java.lang.String passwd
          Password for shutting down the OpHandler through the Web interface
 LSDPoolLSDConnection poolLSDConnection
          LSDPoolLSDConnection from OpHandler
static int port
          Port for HTTP service
static java.lang.String SHUTDOWN
          SHUTDOWN COMMAND
 
Constructor Summary
LSDOpHandlerHttpIoHandler(LSDPoolLSDConnection poolLSDConnection)
          Construct one HTTP Service on pre defined port (set through XML configuration); if cannot be open, httpAcceptor will be null.
 
Method Summary
 void close(boolean wait)
          Close the HTTP Service
 void exceptionCaught(org.apache.mina.common.IoSession session, java.lang.Throwable cause)
           
 void messageReceived(org.apache.mina.common.IoSession session, java.lang.Object message)
           
 void messageSent(org.apache.mina.common.IoSession session, java.lang.Object arg1)
           
 void sessionIdle(org.apache.mina.common.IoSession session, org.apache.mina.common.IdleStatus status)
           
 
Methods inherited from class org.apache.mina.common.IoHandlerAdapter
sessionClosed, sessionCreated, sessionOpened
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHUTDOWN

public static final java.lang.String SHUTDOWN
SHUTDOWN COMMAND

See Also:
Constant Field Values

INFOSESSION

public static final java.lang.String INFOSESSION
INFO (Session statistics) COMMAND

See Also:
Constant Field Values

CLEAN

public static final java.lang.String CLEAN
CLEAN COMMAND

See Also:
Constant Field Values

CSV

public static final java.lang.String CSV
CSV OPTION

See Also:
Constant Field Values

ORDER

public static final java.lang.String ORDER
ORDER BASED URL

See Also:
Constant Field Values

port

public static int port
Port for HTTP service


passwd

public static java.lang.String passwd
Password for shutting down the OpHandler through the Web interface


httpAcceptor

public org.apache.mina.transport.socket.SocketAcceptor httpAcceptor
SocketAcceptor for HTTP Service


orderedThreadPoolExecutor

public org.apache.mina.filter.executor.OrderedThreadPoolExecutor orderedThreadPoolExecutor
OrderedThreadPoolExecutor for HTTP Service


poolLSDConnection

public LSDPoolLSDConnection poolLSDConnection
LSDPoolLSDConnection from OpHandler

Constructor Detail

LSDOpHandlerHttpIoHandler

public LSDOpHandlerHttpIoHandler(LSDPoolLSDConnection poolLSDConnection)
Construct one HTTP Service on pre defined port (set through XML configuration); if cannot be open, httpAcceptor will be null.

Parameters:
poolLSDConnection -
Method Detail

close

public void close(boolean wait)
Close the HTTP Service

Parameters:
wait -

messageSent

public void messageSent(org.apache.mina.common.IoSession session,
                        java.lang.Object arg1)
                 throws java.lang.Exception
Specified by:
messageSent in interface org.apache.mina.common.IoHandler
Overrides:
messageSent in class org.apache.mina.common.IoHandlerAdapter
Parameters:
session -
arg1 - (non-Javadoc)
Throws:
java.lang.Exception
See Also:
IoHandlerAdapter.messageSent(org.apache.mina.common.IoSession, java.lang.Object)

exceptionCaught

public void exceptionCaught(org.apache.mina.common.IoSession session,
                            java.lang.Throwable cause)
                     throws java.lang.Exception
Specified by:
exceptionCaught in interface org.apache.mina.common.IoHandler
Overrides:
exceptionCaught in class org.apache.mina.common.IoHandlerAdapter
Parameters:
session -
cause -
Throws:
java.lang.Exception

sessionIdle

public void sessionIdle(org.apache.mina.common.IoSession session,
                        org.apache.mina.common.IdleStatus status)
                 throws java.lang.Exception
Specified by:
sessionIdle in interface org.apache.mina.common.IoHandler
Overrides:
sessionIdle in class org.apache.mina.common.IoHandlerAdapter
Parameters:
session -
status -
Throws:
java.lang.Exception

messageReceived

public void messageReceived(org.apache.mina.common.IoSession session,
                            java.lang.Object message)
                     throws java.lang.Exception
Specified by:
messageReceived in interface org.apache.mina.common.IoHandler
Overrides:
messageReceived in class org.apache.mina.common.IoHandlerAdapter
Parameters:
session -
message -
Throws:
java.lang.Exception