Package org.apache.activeio.xnet
Class ServiceLogger
- java.lang.Object
-
- org.apache.activeio.xnet.ServiceLogger
-
- All Implemented Interfaces:
ServerService
,SocketService
public class ServiceLogger extends java.lang.Object implements ServerService
-
-
Constructor Summary
Constructors Constructor Description ServiceLogger(java.lang.String name, ServerService next, java.lang.String[] logOnSuccess, java.lang.String[] logOnFailure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getIP()
Gets the ip number that the daemon is listening on.java.lang.String[]
getLogOnFailure()
java.lang.String[]
getLogOnSuccess()
java.lang.String
getName()
Gets the name of the service.int
getPort()
Gets the port number that the daemon is listening on.void
init(java.util.Properties props)
void
service(java.net.Socket socket)
log_on_success ----------------- Different information can be logged when a server starts:void
start()
void
stop()
-
-
-
Constructor Detail
-
ServiceLogger
public ServiceLogger(java.lang.String name, ServerService next, java.lang.String[] logOnSuccess, java.lang.String[] logOnFailure)
-
-
Method Detail
-
service
public void service(java.net.Socket socket) throws ServiceException, java.io.IOException
log_on_success ----------------- Different information can be logged when a server starts: PID : the server's PID (if it's an internal xinetd service, the PID has then a value of 0) ; HOST : the client address ; USERID : the identity of the remote user, according to RFC1413 defining identification protocol; EXIT : the process exit status; DURATION : the session duration. log_on_failure ------------------ Here again, xinetd can log a lot of information when a server can't start, either by lack of resources or because of access rules: HOST, USERID : like above mentioned ; ATTEMPT : logs an access attempt. This an automatic option as soon as another value is provided; RECORD : logs every information available on the client.- Specified by:
service
in interfaceSocketService
- Parameters:
socket
-- Throws:
ServiceException
java.io.IOException
-
getLogOnSuccess
public java.lang.String[] getLogOnSuccess()
-
getLogOnFailure
public java.lang.String[] getLogOnFailure()
-
init
public void init(java.util.Properties props) throws java.lang.Exception
- Specified by:
init
in interfaceServerService
- Throws:
java.lang.Exception
-
start
public void start() throws ServiceException
- Specified by:
start
in interfaceServerService
- Throws:
ServiceException
-
stop
public void stop() throws ServiceException
- Specified by:
stop
in interfaceServerService
- Throws:
ServiceException
-
getName
public java.lang.String getName()
Description copied from interface:SocketService
Gets the name of the service. Used for display purposes only- Specified by:
getName
in interfaceSocketService
-
getIP
public java.lang.String getIP()
Description copied from interface:ServerService
Gets the ip number that the daemon is listening on.- Specified by:
getIP
in interfaceServerService
-
getPort
public int getPort()
Description copied from interface:ServerService
Gets the port number that the daemon is listening on.- Specified by:
getPort
in interfaceServerService
-
-