public interface ClusterHandler
extends org.cyclos.impl.CustomBean
| Modifier and Type | Method and Description |
|---|---|
void |
awakePollingTasks(java.util.Set<org.cyclos.impl.utils.tasks.PollingTask> pollingTasksToAwake)
Awakes the given
PollingTasks |
org.cyclos.impl.utils.cache.CacheHandlerImplementor |
getCacheHandler()
Returns the
CacheHandler managed by this cluster |
java.lang.String |
getHostId()
Returns the current host identifier
|
LockHandler |
getLockHandler()
Returns the
LockHandler managed by this cluster |
PushNotificationHandler |
getPushNotificationHandler()
Returns the
PushNotificationHandler which can be used to publish / subscribe to push notification events |
SessionTimeoutHandler |
getSessionTimeoutHandler()
Returns the
SessionTimeoutHandler managed by this cluster |
long |
getStartupTime()
Returns when the cluster was started up
|
boolean |
isAlive()
Returns whether the cluster (or local instance) is still alive
|
boolean |
isCluster()
Returns whether we're actually running in a cluster or as a single node installation
|
void |
runBackgroundTasks(java.util.List<java.lang.Long> ids)
Executes the background tasks with the given ids.
|
boolean |
runInitialization(org.cyclos.impl.ApplicationInitializationListener listener)
Attempts to execute the given
ApplicationInitializationListener#onApplicationInitialization(org.cyclos.impl.ApplicationHandler). |
boolean |
runPollingTask(org.cyclos.impl.utils.tasks.PollingTask task,
boolean awake,
java.util.Date nextExecution)
Attempts to execute the given
PollingTask, except if it is already running in some other cluster node (in
this case, returning false). |
void awakePollingTasks(java.util.Set<org.cyclos.impl.utils.tasks.PollingTask> pollingTasksToAwake)
PollingTasksorg.cyclos.impl.utils.cache.CacheHandlerImplementor getCacheHandler()
CacheHandler managed by this clusterjava.lang.String getHostId()
LockHandler getLockHandler()
LockHandler managed by this clusterPushNotificationHandler getPushNotificationHandler()
PushNotificationHandler which can be used to publish / subscribe to push notification eventsSessionTimeoutHandler getSessionTimeoutHandler()
SessionTimeoutHandler managed by this clusterlong getStartupTime()
boolean isAlive()
boolean isCluster()
void runBackgroundTasks(java.util.List<java.lang.Long> ids)
CyclosProperties.getMaxBackgroundTasks() is
respected.boolean runInitialization(org.cyclos.impl.ApplicationInitializationListener listener)
ApplicationInitializationListener#onApplicationInitialization(org.cyclos.impl.ApplicationHandler). In
some cases (for example, the initialization was already executed), it might do nothing, and just return falseboolean runPollingTask(org.cyclos.impl.utils.tasks.PollingTask task,
boolean awake,
java.util.Date nextExecution)
PollingTask, except if it is already running in some other cluster node (in
this case, returning false).
The CyclosProperties.getMaxBackgroundTasks() is respected.task - The task to runawake - A flag indicating whether the given task has been manually awake (true) or is executing after a
timeout (false)nextExecution - The date it is scheduled the next execution