|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.jwarp.service.AService
Basic implementation of a JWeb service.
| Field Summary | |
protected IContext |
context
|
protected java.util.Date |
createdDate
|
protected java.lang.String[] |
dependencies
|
protected static java.util.Properties |
emptyProperties
Additional or noirmal service properties that are also settable during service run. |
protected java.util.List |
exceptionListeners
|
protected ILogWriter |
log
|
protected java.util.Date |
resumedDate
|
protected java.lang.String |
serviceName
The service's name |
protected int |
serviceStatus
The current service status |
protected java.lang.String |
serviceType
The service's type identifier |
protected java.util.Date |
startedDate
|
protected java.util.Date |
stoppedDate
|
protected java.util.Date |
suspendedDate
|
protected ITicket |
systemTicket
|
| Fields inherited from interface org.jwarp.service.IService |
SERVICE_STATUS_CREATED, SERVICE_STATUS_NOT_AVAILABLE, SERVICE_STATUS_READY, SERVICE_STATUS_RESUMING, SERVICE_STATUS_RUNNING, SERVICE_STATUS_STARTING, SERVICE_STATUS_STOPPED, SERVICE_STATUS_STOPPING, SERVICE_STATUS_SUSPENDED |
| Constructor Summary | |
protected |
AService(java.lang.String type)
Creates a new service |
protected |
AService(java.lang.String type,
IContext context)
Creates a new service |
protected |
AService(java.lang.String type,
java.lang.String name)
Creates a new service |
protected |
AService(java.lang.String type,
java.lang.String name,
IContext context)
|
| Method Summary | |
void |
addExceptionListener(IExceptionListener handler)
|
void |
checkContext(IContext context)
This checks if the given context is a valid context for the service. |
void |
configure(org.jdom.Element config)
Pass the Configuration to the Configurable
class. |
ILogWriter |
createLogFromXML(org.jdom.Element writer)
This method reads in and initialized a log writer object. |
IContext |
getContext()
Return the services context. |
java.util.Date |
getCreationDate()
|
java.lang.String[] |
getDependencies()
|
java.util.Iterator |
getExceptionListeners()
|
ILogWriter |
getLog()
|
int |
getLogLevel()
This method returns if the application actually is running in debugging mode and so printing more detailed information on errors |
java.lang.String |
getName()
Get the service's name |
java.lang.String |
getReference()
Get the reference for registering within the context resolver. |
java.util.Date |
getResumedDate()
|
java.util.Date |
getShutDownDate()
|
java.util.Date |
getStartDate()
|
int |
getStatus(ITicket ticket)
Returns the current status of the service |
java.util.Date |
getSuspendedDate()
|
java.lang.String |
getType()
Get the service type identifier. |
void |
removeAllExceptionListeners()
|
void |
removeExceptionListener(IExceptionListener listener)
|
void |
resume(ITicket ticket)
Resume the service |
protected void |
sendExceptionEvent(java.lang.Exception e,
java.lang.Object o)
|
void |
setContext(IContext context,
ITicket user)
Change the service's context. |
void |
setDependencies(java.lang.String[] dependencies)
|
void |
setLogLevel(int level)
With this method debugging mode can be switched on and off |
protected void |
setName(java.lang.String name)
Reset the service's name. |
void |
shutdown(ITicket ticket)
Shutdown the service |
void |
start(ITicket ticket)
Start the service with the given configuration. |
void |
suspend(ITicket ticket)
Suspend the service |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected static final java.util.Properties emptyProperties
protected IContext context
protected ITicket systemTicket
protected ILogWriter log
protected java.util.Date createdDate
protected java.util.Date startedDate
protected java.util.Date stoppedDate
protected java.util.Date resumedDate
protected java.util.Date suspendedDate
protected int serviceStatus
protected java.lang.String serviceName
protected java.lang.String serviceType
protected java.lang.String[] dependencies
protected java.util.List exceptionListeners
| Constructor Detail |
protected AService(java.lang.String type,
IContext context)
protected AService(java.lang.String type,
java.lang.String name,
IContext context)
protected AService(java.lang.String type)
protected AService(java.lang.String type,
java.lang.String name)
| Method Detail |
public void configure(org.jdom.Element config)
throws ConfigurationException
IConfigurableConfiguration to the Configurable
class. This method must always be called after the constructor and before any other method.configure in interface IConfigurableorg.jwarp.service.configuration.IConfigurableconfiguration - the class configurations.public java.lang.String[] getDependencies()
getDependencies in interface IServicepublic void setDependencies(java.lang.String[] dependencies)
setDependencies in interface IServicepublic ILogWriter getLog()
public java.lang.String getType()
getType in interface IServicepublic IContext getContext()
public final void setContext(IContext context,
ITicket user)
throws java.lang.SecurityException
IServicesetContext in interface IServiceorg.jwarp.service.IServicecontext - The contextuser - The userjava.lang.SecurityException - If the context is invalidpublic java.lang.String getName()
getName in interface IServicepublic java.lang.String getReference()
getReference in interface IReferenceableprotected void setName(java.lang.String name)
ticket - The username - The new name
public void start(ITicket ticket)
throws ServiceInitializationException,
java.lang.SecurityException
start in interface IServiceServiceInitializationException - If the service could not startedjava.lang.SecurityException - If access was denied.
public void shutdown(ITicket ticket)
throws ServiceRuntimeException,
java.lang.SecurityException
shutdown in interface IServiceticket - The user ticketServiceRuntimeException - If the service could not be shut ownjava.lang.SecurityException - If access was denied.
public void suspend(ITicket ticket)
throws ServiceRuntimeException,
java.lang.SecurityException
suspend in interface IServiceticket - The user ticketServiceRuntimeException - If the service could not be suspendedjava.lang.SecurityException - If access was denied.
public void resume(ITicket ticket)
throws ServiceRuntimeException,
java.lang.SecurityException
resume in interface IServiceticket - The user ticketServiceRuntimeException - If the service could not be resumedjava.lang.SecurityException - If access was denied.
public int getStatus(ITicket ticket)
throws java.lang.SecurityException
getStatus in interface IServiceticket - The user ticketjava.lang.SecurityException - If access was denied.public void addExceptionListener(IExceptionListener handler)
addExceptionListener in interface IExceptionProviderpublic java.util.Iterator getExceptionListeners()
getExceptionListeners in interface IExceptionProviderpublic void removeAllExceptionListeners()
removeAllExceptionListeners in interface IExceptionProviderpublic void removeExceptionListener(IExceptionListener listener)
removeExceptionListener in interface IExceptionProvider
protected void sendExceptionEvent(java.lang.Exception e,
java.lang.Object o)
public void checkContext(IContext context)
throws java.lang.SecurityException
checkContext in interface IServiceThe - contextjava.lang.SecurityException - If the context is invalidpublic java.util.Date getStartDate()
public java.util.Date getShutDownDate()
public java.util.Date getSuspendedDate()
public java.util.Date getResumedDate()
public java.util.Date getCreationDate()
public int getLogLevel()
getLogLevel in interface IServicepublic void setLogLevel(int level)
setLogLevel in interface IServicepublic ILogWriter createLogFromXML(org.jdom.Element writer)
The - XML log subtree
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||