|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
public class GenericService
A GenericService is a basic implementation of the Service interfaces. Services written from scratch should extend this class to take advantage of all the facilities it provides:
A GenericService provides two methods that subclasses should override:
| Field Summary | |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
SERVICE_INFO_KEY
Should be used as a key to retrieve the serviceInfo property from ResourceBundles |
| Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
|---|
DEFAULT_LOG_TRACE_STATUS |
| Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
|---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
| Constructor Summary | |
|---|---|
GenericService()
Constructs a new GenericService |
|
| Method Summary | |
|---|---|
void |
addLogListener(LogListener pListener)
Adds a listener to the list of log listeners |
protected javax.servlet.Servlet |
createAdminServlet()
Creates and returns a new Servlet that will administer this service. |
void |
doStartService()
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. |
void |
doStopService()
This is called when a Service is required to shut down. |
java.lang.String |
getAbsoluteName()
Returns the absolute name of this service, using Nucleus to get the absolute name. |
javax.servlet.Servlet |
getAdminServlet()
Returns the Servlet that will handle requests directed at this service. |
protected ApplicationLogging |
getLoggingForVlogging()
Get the ApplicationLogging instance to use for vlog methods. |
int |
getLogListenerCount()
Returns the number of log listeners |
LogListener[] |
getLogListeners()
Returns the list of log listeners as an array property. |
java.lang.String |
getName()
Returns the name by which this element is know within its enclosing NameContext. |
NameContext |
getNameContext()
Returns the NameContext into which this element has been bound, or null if the element is not bound in a NameContext. |
Nucleus |
getNucleus()
Returns the Nucleus managing this Service |
NameContext |
getRoot()
Searches up the tree until it finds the root NameContext |
Configuration |
getServiceConfiguration()
Returns the Configuration that was used to create this Service, null if there was none. |
java.lang.String |
getServiceInfo()
Returns the a descriptive string about this service |
boolean |
isLoggingDebug()
This method returns whether or not an debug log event should be broadcast. |
boolean |
isLoggingError()
This method returns whether or not an error log event should be broadcast. |
boolean |
isLoggingInfo()
This method returns whether or not an info log event should be broadcast. |
boolean |
isLoggingTrace()
This method returns whether or not an trace log event should be broadcast. |
boolean |
isLoggingWarning()
This method returns whether or not an warning log event should be broadcast. |
boolean |
isRunning()
Returns true if this Service is currently running. |
void |
logDebug(java.lang.String pMessage)
Logs an debug event with the specified message |
void |
logDebug(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an debug event with the specified message and Throwable |
void |
logDebug(java.lang.Throwable pThrowable)
Logs an debug event with the specified Throwable |
void |
logError(java.lang.String pMessage)
Logs an error event with the specified message |
void |
logError(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an error event with the specified message and Throwable |
void |
logError(java.lang.Throwable pThrowable)
Logs an error event with the specified Throwable |
void |
logInfo(java.lang.String pMessage)
Logs an info event with the specified message |
void |
logInfo(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an info event with the specified message and Throwable |
void |
logInfo(java.lang.Throwable pThrowable)
Logs an info event with the specified Throwable |
void |
logTrace(java.lang.String pMessage)
Logs an trace event with the specified message |
void |
logTrace(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an trace event with the specified message and Throwable |
void |
logTrace(java.lang.Throwable pThrowable)
Logs an trace event with the specified Throwable |
void |
logWarning(java.lang.String pMessage)
Logs an warning event with the specified message |
void |
logWarning(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an warning event with the specified message and Throwable |
void |
logWarning(java.lang.Throwable pThrowable)
Logs an warning event with the specified Throwable |
void |
nameContextElementBound(NameContextBindingEvent pEvent)
This is called to notify this context that it is being bound into a NameContext. |
void |
nameContextElementUnbound(NameContextBindingEvent pEvent)
This is called to notify this context that it is being unbound from a NameContext. |
void |
removeLogListener(LogListener pListener)
Removes a listener from the list of log listeners |
java.lang.Object |
resolveName(ComponentName pName)
Resolves the specified name, relative to this context's parent. |
java.lang.Object |
resolveName(ComponentName pName,
boolean pCreate)
Resolves the specified name, relative to this context's parent. |
java.lang.Object |
resolveName(java.lang.String pName)
Resolves the specified name, relative to this context's parent. |
java.lang.Object |
resolveName(java.lang.String pName,
boolean pCreate)
Resolves the specified name, relative to this context's parent. |
void |
sendLogEvent(LogEvent pLogEvent)
Sends a LogEvent to all of the listeners |
void |
setLoggingDebug(boolean pLogging)
Sets whether or not debug log events should be logged. |
void |
setLoggingError(boolean pLogging)
Sets whether or not error log events should be logged. |
void |
setLoggingInfo(boolean pLogging)
Sets whether or not info log events should be logged. |
void |
setLoggingTrace(boolean pLogging)
Sets whether or not trace log events should be logged. |
void |
setLoggingWarning(boolean pLogging)
Sets whether or not warning log events should be logged. |
void |
setNucleus(Nucleus pNucleus)
Sets the Nucleus managing this Service |
void |
setServiceInfo(java.lang.String pServiceInfo)
Sets the a descriptive string about this service |
void |
startService(ServiceEvent pEvent)
Starts the service running. |
void |
stopService()
Stops the service. |
| Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
|---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String CLASS_VERSION
public static final java.lang.String SERVICE_INFO_KEY
| Constructor Detail |
|---|
public GenericService()
| Method Detail |
|---|
public NameContext getRoot()
public void doStartService()
throws ServiceException
ServiceException - if the Service had a problem starting up
public void doStopService()
throws ServiceException
ServiceException - if the Service had a problem shutting downpublic java.lang.String getServiceInfo()
public void setServiceInfo(java.lang.String pServiceInfo)
public void addLogListener(LogListener pListener)
addLogListener in interface atg.nucleus.logging.ApplicationLoggingSenderpublic void removeLogListener(LogListener pListener)
removeLogListener in interface atg.nucleus.logging.ApplicationLoggingSenderpublic LogListener[] getLogListeners()
getLogListeners in interface atg.nucleus.logging.ApplicationLoggingSenderpublic int getLogListenerCount()
getLogListenerCount in interface atg.nucleus.logging.ApplicationLoggingSenderpublic void sendLogEvent(LogEvent pLogEvent)
public java.lang.Object resolveName(ComponentName pName,
boolean pCreate)
pName - the name to be resolvedpCreate - flag indicating whether Nucleus should attempt to
create the object if it does not already exist in the naming
hierarchy.
public java.lang.Object resolveName(java.lang.String pName,
boolean pCreate)
pName - the name to be resolvedpCreate - flag indicating whether Nucleus should attempt to
create the object if it does not already exist in the naming
hierarchy.
public java.lang.Object resolveName(ComponentName pName)
resolveName in interface ComponentNameResolverpName - the name to be resolved
public java.lang.Object resolveName(java.lang.String pName)
resolveName in interface NameResolverpName - the name to be resolved
public java.lang.String getAbsoluteName()
public void nameContextElementBound(NameContextBindingEvent pEvent)
nameContextElementBound in interface NameContextBindingListenerpublic void nameContextElementUnbound(NameContextBindingEvent pEvent)
nameContextElementUnbound in interface NameContextBindingListenerpublic NameContext getNameContext()
getNameContext in interface NameContextElementpublic java.lang.String getName()
getName in interface NameContextElement
public void startService(ServiceEvent pEvent)
throws ServiceException
startService in interface ServiceListenerpEvent - the ServiceEvent encapsulating information about
the Service's environment and configuration
ServiceException - if an error occurred while attempting
to start the service.
public void stopService()
throws ServiceException
stopService in interface ServiceListenerServiceException - if an error occurred while attempting
to stop the service.public Nucleus getNucleus()
getNucleus in interface Servicepublic void setNucleus(Nucleus pNucleus)
public Configuration getServiceConfiguration()
getServiceConfiguration in interface Servicepublic boolean isRunning()
isRunning in interface Servicepublic boolean isLoggingInfo()
isLoggingInfo in interface ApplicationLoggingpublic void setLoggingInfo(boolean pLogging)
setLoggingInfo in interface ApplicationLoggingpublic boolean isLoggingWarning()
isLoggingWarning in interface ApplicationLoggingpublic void setLoggingWarning(boolean pLogging)
setLoggingWarning in interface ApplicationLoggingpublic boolean isLoggingError()
isLoggingError in interface ApplicationLoggingpublic void setLoggingError(boolean pLogging)
setLoggingError in interface ApplicationLoggingpublic boolean isLoggingDebug()
isLoggingDebug in interface ApplicationLoggingpublic void setLoggingDebug(boolean pLogging)
setLoggingDebug in interface ApplicationLoggingpublic boolean isLoggingTrace()
isLoggingTrace in interface atg.nucleus.logging.TraceApplicationLoggingisLoggingTrace in class atg.nucleus.logging.VariableArgumentApplicationLoggingImplpublic void setLoggingTrace(boolean pLogging)
setLoggingTrace in interface atg.nucleus.logging.TraceApplicationLoggingpublic void logInfo(java.lang.String pMessage)
logInfo in interface ApplicationLoggingpublic void logInfo(java.lang.Throwable pThrowable)
logInfo in interface ApplicationLogging
public void logInfo(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logInfo in interface ApplicationLoggingpublic void logWarning(java.lang.String pMessage)
logWarning in interface ApplicationLoggingpublic void logWarning(java.lang.Throwable pThrowable)
logWarning in interface ApplicationLogging
public void logWarning(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logWarning in interface ApplicationLoggingpublic void logError(java.lang.String pMessage)
logError in interface ApplicationLoggingpublic void logError(java.lang.Throwable pThrowable)
logError in interface ApplicationLogging
public void logError(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logError in interface ApplicationLoggingpublic void logDebug(java.lang.String pMessage)
logDebug in interface ApplicationLoggingpublic void logDebug(java.lang.Throwable pThrowable)
logDebug in interface ApplicationLogging
public void logDebug(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logDebug in interface ApplicationLoggingpublic void logTrace(java.lang.String pMessage)
logTrace in interface atg.nucleus.logging.TraceApplicationLoggingpublic void logTrace(java.lang.Throwable pThrowable)
logTrace in interface atg.nucleus.logging.TraceApplicationLogging
public void logTrace(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logTrace in interface atg.nucleus.logging.TraceApplicationLoggingpublic javax.servlet.Servlet getAdminServlet()
getAdminServlet in interface AdminableServicecreateAdminServlet()protected javax.servlet.Servlet createAdminServlet()
protected ApplicationLogging getLoggingForVlogging()
getLoggingForVlogging in class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||