org.openejb.server
Class ServiceLogger

java.lang.Object
  extended by org.openejb.server.ServiceLogger
All Implemented Interfaces:
ServerService, Service

public class ServiceLogger
extends java.lang.Object
implements ServerService

The Server will call the following methods. newInstance() init( port, properties) start() stop() All ServerService implementations must have a no argument constructor.

Author:
David Blevins

Constructor Summary
ServiceLogger(ServerService next)
           
 
Method Summary
 java.lang.String getIP()
          Gets the ip number that the daemon is listening on.
 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)
          Pulls out the access log information
 void service(java.io.InputStream in, java.io.OutputStream out)
           
 void service(java.net.Socket socket)
          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.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceLogger

public ServiceLogger(ServerService next)
Method Detail

init

public void init(java.util.Properties props)
          throws java.lang.Exception
Pulls out the access log information

Specified by:
init in interface ServerService
Specified by:
init in interface Service
Parameters:
props -
Throws:
ServiceException
java.lang.Exception

start

public void start()
           throws ServiceException
Specified by:
start in interface ServerService
Throws:
ServiceException

stop

public void stop()
          throws ServiceException
Specified by:
stop in interface ServerService
Throws:
ServiceException

service

public void service(java.io.InputStream in,
                    java.io.OutputStream out)
             throws ServiceException,
                    java.io.IOException
Specified by:
service in interface ServerService
Throws:
ServiceException
java.io.IOException

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 interface ServerService
Parameters:
socket -
Throws:
ServiceException
java.io.IOException

getName

public java.lang.String getName()
Gets the name of the service. Used for display purposes only

Specified by:
getName in interface ServerService

getIP

public java.lang.String getIP()
Gets the ip number that the daemon is listening on.

Specified by:
getIP in interface ServerService

getPort

public int getPort()
Gets the port number that the daemon is listening on.

Specified by:
getPort in interface ServerService


Copyright © 1999-2011 OpenEJB. All Rights Reserved.