org.safs.staf.service.logging
Class AbstractSAFSCustomLoggingService

java.lang.Object
  extended by org.safs.staf.service.logging.AbstractSAFSCustomLoggingService

public abstract class AbstractSAFSCustomLoggingService
extends java.lang.Object

AbstractSAFSCustomLoggingService is an external STAF service that handles custom SAFS logging. This class is defined as an abstract class, for different version of STAF, you may extends this class and implements the staf-version-related interface (STAFServiceInterfaceLevel or STAFServiceInterfaceLevel30). We have implemented the class for version 2 and 3: SAFSCustomLoggingService and SAFSCustomLoggingService3

This class and CustomLogFac provide a sample implementation of custom logging service that writes directly to the same STAF logs that standard logging service writes to.

Registration of this service takes the following format:

SERVICE <ServiceName> LIBRARY JSTAF EXECUTE <ServiceJarFile> PARMS SAFSLOGGING <SAFSLoggingService>

SAFSLOGGING option is required because this service uses the unique STAF LOG service instance loaded by SAFS logging service to access the running STAF logs.

Example:

SERVICE SAFSCustomLogs LIBRARY JSTAF EXECUTE c:\staf\services\SAFSCustomLogs.jar PARMS SAFSLOGGING SAFSLogs

This service provides the following commands:

 INIT        <facname> MODE <mode> [LINKEDFAC <name>]
 LOGMESSAGE  <facname> MESSAGE <msg> [DESCRIPTION <desc>] [MSGTYPE <msgType>]
 CLOSE       <facname>
 HELP
 VERSION
 

See Also:
CustomLogFac, org.safs.staf.service.logging.v2.SAFSLoggingService, org.safs.staf.service.logging.v3.SAFSLoggingService3, "SAFSLogs Service User's Guide", org.safs.staf.service.logging.v2.SAFSCustomLoggingService, org.safs.staf.service.logging.v3.SAFSCustomLoggingService3

Field Summary
protected  ServiceDebugLog debugLog
           
static java.lang.String SCLS_SERVICE_OPTION_SAFSLOGGING
           
static java.lang.String SCLS_SERVICE_PARM_DESCRIPTION
           
static java.lang.String SCLS_SERVICE_PARM_LINKEDFAC
           
static java.lang.String SCLS_SERVICE_PARM_MESSAGE
           
static java.lang.String SCLS_SERVICE_PARM_MODE
           
static java.lang.String SCLS_SERVICE_PARM_MSGTYPE
           
static java.lang.String SCLS_SERVICE_REQUEST_CLOSE
           
static java.lang.String SCLS_SERVICE_REQUEST_HELP
           
static java.lang.String SCLS_SERVICE_REQUEST_INIT
           
static java.lang.String SCLS_SERVICE_REQUEST_LOGMESSAGE
           
static java.lang.String SCLS_SERVICE_REQUEST_VERSION
           
static java.lang.String SCLS_SERVICE_RESPONSE_BYPASS
           
 
Constructor Summary
AbstractSAFSCustomLoggingService()
           
 
Method Summary
 com.ibm.staf.STAFResult acceptRequest(InfoInterface.RequestInfo info)
          Handles service request from STAF.
 com.ibm.staf.STAFResult init(InfoInterface.InitInfo info)
          Handles initializing this instance of the service for STAF.
 com.ibm.staf.STAFResult terminate()
          Handles removing this service from STAF.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCLS_SERVICE_OPTION_SAFSLOGGING

public static final java.lang.String SCLS_SERVICE_OPTION_SAFSLOGGING
See Also:
Constant Field Values

SCLS_SERVICE_REQUEST_INIT

public static final java.lang.String SCLS_SERVICE_REQUEST_INIT
See Also:
Constant Field Values

SCLS_SERVICE_REQUEST_LOGMESSAGE

public static final java.lang.String SCLS_SERVICE_REQUEST_LOGMESSAGE
See Also:
Constant Field Values

SCLS_SERVICE_REQUEST_CLOSE

public static final java.lang.String SCLS_SERVICE_REQUEST_CLOSE
See Also:
Constant Field Values

SCLS_SERVICE_REQUEST_HELP

public static final java.lang.String SCLS_SERVICE_REQUEST_HELP
See Also:
Constant Field Values

SCLS_SERVICE_REQUEST_VERSION

public static final java.lang.String SCLS_SERVICE_REQUEST_VERSION
See Also:
Constant Field Values

SCLS_SERVICE_PARM_MODE

public static final java.lang.String SCLS_SERVICE_PARM_MODE
See Also:
Constant Field Values

SCLS_SERVICE_PARM_LINKEDFAC

public static final java.lang.String SCLS_SERVICE_PARM_LINKEDFAC
See Also:
Constant Field Values

SCLS_SERVICE_PARM_MESSAGE

public static final java.lang.String SCLS_SERVICE_PARM_MESSAGE
See Also:
Constant Field Values

SCLS_SERVICE_PARM_DESCRIPTION

public static final java.lang.String SCLS_SERVICE_PARM_DESCRIPTION
See Also:
Constant Field Values

SCLS_SERVICE_PARM_MSGTYPE

public static final java.lang.String SCLS_SERVICE_PARM_MSGTYPE
See Also:
Constant Field Values

SCLS_SERVICE_RESPONSE_BYPASS

public static final java.lang.String SCLS_SERVICE_RESPONSE_BYPASS
See Also:
Constant Field Values

debugLog

protected ServiceDebugLog debugLog
Constructor Detail

AbstractSAFSCustomLoggingService

public AbstractSAFSCustomLoggingService()
Method Detail

init

public com.ibm.staf.STAFResult init(InfoInterface.InitInfo info)
Handles initializing this instance of the service for STAF.

This service is registered under process name "STAF/Service/<ServiceName>".


acceptRequest

public com.ibm.staf.STAFResult acceptRequest(InfoInterface.RequestInfo info)
Handles service request from STAF.


terminate

public com.ibm.staf.STAFResult terminate()
Handles removing this service from STAF.