|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
jrunx.kernel.ServiceAdapter
|
+--jrun.jms.core.util.JMSServiceAdapter
|
+--jrun.jms.core.gc.GarbageCollectionService
The garbage collection service is responsible for managing all transient
garbage collection for OpenJMS, which includes messages, destinations,
endpoints etc. It does not deal with persistent data, which is handled
through the database service. Other services or managers can register
themselves with GarbageCollectionService if they implement the
GarbageCollectable interface.
Gargabe collection will be initiated when the amount of free memory falls below a low water mark, which is calculated as a percentage of total memory. By default garbage collection will run when free memory falls below 20% of total memory, this can be changed through the configuration file.
The service will check the memory usage every 30 seconds by default. but this can also be modified through the configuration file.
In addition the garbage collection service can also be configured to execute at regular intervals regardless the amount of residual free memory. This option can be employed to ease the burden of performing wholesale garbage collection when memory falls below the low water mark threshold. The default value for this is 300 seconds. Setting this value to 0 will disable this capability.
This service makes use of the EventManager to register events for
garabage collection.
| Field Summary | |
static java.lang.String |
OBJECT_NAME
The name of the service |
| Fields inherited from class jrunx.kernel.ServiceAdapter |
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER |
| Fields inherited from interface jrunx.kernel.Service |
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED |
| Constructor Summary | |
GarbageCollectionService()
Create an instance of a garbage collection service. |
|
| Method Summary | |
boolean |
belowLowWaterThreshold()
Check whether the low water threshold has been reached. |
void |
init()
Not every service needs to init, implement it out of convenience. |
static GarbageCollectionService |
instance()
Return the singleton instance of the GarbageCollectionService |
void |
onSchedulableEvent(java.lang.Object Handle,
int type)
This method is called whenever a schedulableEvent gets fired. |
void |
register(GarbageCollectable entry)
Register an entity that wishes to participate in the garbage collection process. |
void |
run()
|
void |
start()
Every service other than mere data collections should start |
void |
stop()
Every service other than mere data collections should stop |
void |
unregister(GarbageCollectable entry)
Unregister the specified entry from the list of garbge collectable entities |
| Methods inherited from class jrun.jms.core.util.JMSServiceAdapter |
getMetaData, restart, resume, setMetaData, suspend |
| Methods inherited from interface jrunx.kernel.ServiceMBean |
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind |
| Methods inherited from interface jrunx.kernel.Service |
destroy, getStatus, updateStatus |
| Field Detail |
public static final java.lang.String OBJECT_NAME
| Constructor Detail |
public GarbageCollectionService()
throws GarbageCollectionServiceException
It will throw a GarbageCollectionServiceException, if it cannot construct the service
GarbageCollectionServiceException - | Method Detail |
public static GarbageCollectionService instance()
throws GarbageCollectionServiceException
GarbageCollectionServiceException -
public void init()
throws java.lang.Exception
ServiceAdapterinit in interface Serviceinit in class ServiceAdapterpublic boolean belowLowWaterThreshold()
public void register(GarbageCollectable entry)
entry - - entry to add to listpublic void unregister(GarbageCollectable entry)
entry - - entry to removepublic void run()
public void start()
throws java.lang.Exception
ServiceAdapterstart in interface Servicestart in class ServiceAdapter
public void stop()
throws java.lang.Exception
ServiceAdapterstop in interface Servicestop in class ServiceAdapter
public void onSchedulableEvent(java.lang.Object Handle,
int type)
SchedulableEventListeneronSchedulableEvent in interface SchedulableEventListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||