|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.clients.web.extensions.service.DummyService
public class DummyService
A dummy service implementation that prints out the current
time on System.out
every x seconds (default = 10) when
the service is running. It will also print out messages when the service
is started and stopped and in some other places.
The service is it's own action factory and controller.
Field Summary | |
---|---|
private String |
extensionId
|
private long |
interval
|
private boolean |
running
|
private TimerTask |
timer
|
Constructor Summary | |
---|---|
DummyService()
|
Method Summary | |
---|---|
ServiceControllerAction[] |
getActions(InvokationContext context)
This method may be called one or several times for each request. |
boolean |
isRunning()
Is the service running or not? |
boolean |
prepareContext(InvokationContext context)
This method is called once for each request/use of an extension and have two purposes: The factory should decide if the extension should be enabled or not. |
void |
setInterval(String seconds)
Set the interval between writes to stdout. |
void |
start()
Start the service if it is not already running. |
void |
stop()
Stop the service if it is running. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private boolean running
private TimerTask timer
private long interval
private String extensionId
Constructor Detail |
---|
public DummyService()
Method Detail |
---|
public ServiceControllerAction[] getActions(InvokationContext context)
ActionFactory
getActions
in interface ActionFactory<ServiceControllerAction>
context
- The current invokation context
public boolean prepareContext(InvokationContext context)
ActionFactory
JspContext
.
prepareContext
in interface ActionFactory<ServiceControllerAction>
context
- The current invokation context
public boolean isRunning()
ServiceControllerAction
isRunning
in interface ServiceControllerAction
public void start()
ServiceControllerAction
start
in interface ServiceControllerAction
public void stop()
ServiceControllerAction
stop
in interface ServiceControllerAction
public void setInterval(String seconds)
seconds
- The interval in secondspublic String toString()
toString
in class Object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |