Package com.levigo.jadice.server.core
Class JadiceServer
- java.lang.Object
-
- com.levigo.jadice.server.core.JadiceServer
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,org.springframework.context.Lifecycle
,org.springframework.jmx.export.naming.SelfNaming
@ManagedResource(objectName="com.levigo.jadice.server:name=serverInstance", description="the jadice server management interface") public class JadiceServer extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.naming.SelfNaming, org.springframework.context.Lifecycle
This class is the central entry point to the jadice server system. It manages a server instance. Most work, however, is delegated to the JobScheduler.
-
-
Constructor Summary
Constructors Constructor Description JadiceServer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
protected void
checkClosed()
protected void
checkRunning()
void
ensureCorrectConfiguration()
ObjectName
getObjectName()
Date
getReleaseDate()
RequestEndpoint<?>
getRequestEndpoint()
JobScheduler
getScheduler()
static ScheduledExecutorService
getSchedulerService()
String
getVersion()
boolean
isRunning()
void
setJMXContext(JMXContext ctx)
void
setRequestEndpoint(RequestEndpoint<?> requestEndpoint)
void
setScheduler(JobScheduler scheduler)
void
start()
void
stop()
-
-
-
Method Detail
-
getSchedulerService
public static ScheduledExecutorService getSchedulerService()
-
checkClosed
protected void checkClosed()
-
checkRunning
protected void checkRunning()
-
ensureCorrectConfiguration
public void ensureCorrectConfiguration() throws ConfigurationException
- Throws:
ConfigurationException
-
getScheduler
public JobScheduler getScheduler()
-
setScheduler
public void setScheduler(JobScheduler scheduler)
-
setJMXContext
public void setJMXContext(JMXContext ctx)
-
getObjectName
public ObjectName getObjectName() throws MalformedObjectNameException
- Specified by:
getObjectName
in interfaceorg.springframework.jmx.export.naming.SelfNaming
- Throws:
MalformedObjectNameException
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
isRunning
@ManagedAttribute(description="Flag indicating whether the server is running") public boolean isRunning()
- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
start
@ManagedOperation(description="Start this jadice server instance") public void start()
- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
stop
@ManagedOperation(description="Perform a safe shutdown of this jadice server instance") public void stop()
- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
getVersion
@ManagedAttribute(description="Version of jadice server") public String getVersion()
-
getReleaseDate
@ManagedAttribute(description="Date when this version was built") public Date getReleaseDate()
-
getRequestEndpoint
public RequestEndpoint<?> getRequestEndpoint()
-
setRequestEndpoint
public void setRequestEndpoint(RequestEndpoint<?> requestEndpoint)
-
-