Class InMemoryJobSchedulerStore
java.lang.Object
org.apache.activemq.util.ServiceSupport
org.apache.activemq.broker.scheduler.memory.InMemoryJobSchedulerStore
- All Implemented Interfaces:
JobSchedulerStore,org.apache.activemq.Service
public class InMemoryJobSchedulerStore
extends org.apache.activemq.util.ServiceSupport
implements JobSchedulerStore
An in-memory JobSchedulerStore implementation used for Brokers that have persistence
disabled or when the JobSchedulerStore usage doesn't require a file or DB based store
implementation allowing for better performance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected voiddoStop(org.apache.activemq.util.ServiceStopper stopper) Gets the location where the Job Scheduler will write the persistent data used to preserve and recover scheduled Jobs.getJobScheduler(String name) Returns the JobScheduler instance identified by the given name.booleanremoveJobScheduler(String name) Removes the named JobScheduler if it exists, purging all scheduled messages assigned to it.voidsetDirectory(File directory) Sets the directory where persistent store data will be written.longsize()The size of the current store on disk if the store utilizes a disk based store mechanism.Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.Service
start, stop
-
Constructor Details
-
InMemoryJobSchedulerStore
public InMemoryJobSchedulerStore()
-
-
Method Details
-
doStop
- Specified by:
doStopin classorg.apache.activemq.util.ServiceSupport- Throws:
Exception
-
doStart
- Specified by:
doStartin classorg.apache.activemq.util.ServiceSupport- Throws:
Exception
-
getJobScheduler
Description copied from interface:JobSchedulerStoreReturns the JobScheduler instance identified by the given name.- Specified by:
getJobSchedulerin interfaceJobSchedulerStore- Parameters:
name- the name of the JobScheduler instance to lookup.- Returns:
- the named JobScheduler or null if none exists with the given name.
- Throws:
Exception- if an error occurs while loading the named scheduler.
-
removeJobScheduler
Description copied from interface:JobSchedulerStoreRemoves the named JobScheduler if it exists, purging all scheduled messages assigned to it.- Specified by:
removeJobSchedulerin interfaceJobSchedulerStore- Parameters:
name- the name of the scheduler instance to remove.- Returns:
- true if there was a scheduler with the given name to remove.
- Throws:
Exception- if an error occurs while removing the scheduler.
-
size
public long size()Description copied from interface:JobSchedulerStoreThe size of the current store on disk if the store utilizes a disk based store mechanism.- Specified by:
sizein interfaceJobSchedulerStore- Returns:
- the current store size on disk.
-
getDirectory
Description copied from interface:JobSchedulerStoreGets the location where the Job Scheduler will write the persistent data used to preserve and recover scheduled Jobs. If the scheduler implementation does not utilize a file system based store this method returns null.- Specified by:
getDirectoryin interfaceJobSchedulerStore- Returns:
- the directory where persistent store data is written.
-
setDirectory
Description copied from interface:JobSchedulerStoreSets the directory where persistent store data will be written. This method must be called before the scheduler store is started to have any effect.- Specified by:
setDirectoryin interfaceJobSchedulerStore- Parameters:
directory- The directory where the job scheduler store is to be located.
-