|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.james.socket.AbstractJamesHandler
public abstract class AbstractJamesHandler
Common Handler code
Field Summary | |
---|---|
protected DNSService |
dnsServer
The DNSService |
protected java.io.InputStream |
in
The incoming stream of bytes coming from the socket. |
protected CRLFTerminatedReader |
inReader
The reader associated with incoming characters. |
protected java.io.PrintWriter |
out
The writer to which outgoing messages are written. |
protected java.io.OutputStream |
outs
The socket's output stream |
protected java.lang.String |
remoteHost
The remote host name obtained by lookup on the socket. |
protected java.lang.String |
remoteIP
The remote IP address of the socket. |
protected java.net.Socket |
socket
The TCP/IP socket over which the service interaction is occurring |
protected Watchdog |
theWatchdog
The watchdog being used by this handler to deal with idle timeouts. |
Constructor Summary | |
---|---|
AbstractJamesHandler()
|
Method Summary | |
---|---|
protected void |
errorHandler(java.lang.RuntimeException e)
Method which will be colled on error |
java.lang.String |
getName()
The name of this handler. |
void |
handleConnection(java.net.Socket connection)
|
protected abstract void |
handleProtocol()
Handle the protocol |
protected void |
initHandler(java.net.Socket connection)
Helper method for accepting connections. |
protected abstract void |
resetHandler()
Resets the handler data to a basic state. |
void |
service(org.apache.avalon.framework.service.ServiceManager arg0)
|
abstract void |
setConfigurationData(java.lang.Object theData)
This method will be implemented checking for the correct class type. |
void |
setDnsServer(DNSService dnsServer)
|
void |
setName(java.lang.String name)
The name of this handler. |
void |
setStreamDumpDir(java.lang.String streamDumpDir)
If not null, this will enable dump to file for tcp connections |
void |
setWatchdog(Watchdog theWatchdog)
Set the Watchdog for use by this handler. |
java.lang.String |
toString()
Use for context sensitive logging. |
void |
writeLoggedFlushedResponse(java.lang.String responseString)
Write and flush a response string. |
void |
writeLoggedResponse(java.lang.String responseString)
Write a response string. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.net.Socket socket
protected java.io.PrintWriter out
protected java.io.InputStream in
protected CRLFTerminatedReader inReader
protected java.io.OutputStream outs
protected Watchdog theWatchdog
protected java.lang.String remoteHost
protected java.lang.String remoteIP
protected DNSService dnsServer
Constructor Detail |
---|
public AbstractJamesHandler()
Method Detail |
---|
public abstract void setConfigurationData(java.lang.Object theData)
theData
- Configuration Bean.public void service(org.apache.avalon.framework.service.ServiceManager arg0) throws org.apache.avalon.framework.service.ServiceException
service
in interface org.apache.avalon.framework.service.Serviceable
org.apache.avalon.framework.service.ServiceException
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
protected void initHandler(java.net.Socket connection) throws java.io.IOException
connection
- The Socket which belongs to the connection
java.io.IOException
- get thrown if an IO error is detectedpublic void handleConnection(java.net.Socket connection) throws java.io.IOException
handleConnection
in interface org.apache.avalon.cornerstone.services.connection.ConnectionHandler
java.io.IOException
ConnectionHandler.handleConnection(java.net.Socket)
protected void errorHandler(java.lang.RuntimeException e)
e
- the RuntimeExceptionprotected abstract void handleProtocol() throws java.io.IOException
java.io.IOException
- get thrown if an IO error is detectedprotected abstract void resetHandler()
public void setWatchdog(Watchdog theWatchdog)
theWatchdog
- the watchdogpublic final void writeLoggedFlushedResponse(java.lang.String responseString)
responseString
- the response string sent to the clientpublic final void writeLoggedResponse(java.lang.String responseString)
responseString
- the response string sent to the clientpublic void setStreamDumpDir(java.lang.String streamDumpDir)
streamDumpDir
- the dirpublic void setDnsServer(DNSService dnsServer)
public final java.lang.String getName()
public final void setName(java.lang.String name)
name
- the name to setpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |