org.jboss.ejb.txtimer
Class EJBTimerServiceImpl

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.ejb.txtimer.EJBTimerServiceImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, EJBTimerService, EJBTimerServiceImplMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class EJBTimerServiceImpl
extends org.jboss.system.ServiceMBeanSupport
implements EJBTimerServiceImplMBean

A service that implements this interface provides an Tx aware EJBTimerService.

Since:
07-Apr-2004
Version:
$Revision: 57209 $
Author:
Thomas.Diesler@jboss.org, Dimitris.Andreadis@jboss.org

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.ejb.txtimer.EJBTimerServiceImplMBean
OBJECT_NAME
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
EJBTimerServiceImpl()
           
 
Method Summary
 javax.ejb.TimerService createTimerService(javax.management.ObjectName containerId, Object instancePk, Container container)
          Create a TimerService for a given TimedObjectId that lives in a JBoss Container.
 javax.ejb.TimerService createTimerService(javax.management.ObjectName containerId, Object instancePk, TimedObjectInvoker invoker)
          Create a TimerService for a given TimedObjectId that is invoked through the given invoker
 javax.management.ObjectName getPersistencePolicy()
          Get the object name of the persistence policy.
 javax.management.ObjectName getRetryPolicy()
          Get the object name of the retry policy.
 String getTimedObjectInvokerClassName()
          Get the TimedObjectInvoker class name
 String getTimerIdGeneratorClassName()
          Get the TimerIdGenerator class name
 javax.ejb.TimerService getTimerService(javax.management.ObjectName containerId, Object instancePk)
          Get the TimerService for a given TimedObjectId
 String listTimers()
          List the timers registered with all TimerService objects
 void removeTimerService(javax.management.ObjectName containerId, boolean keepState)
          Remove the TimerService for a given containerId.
 void removeTimerService(javax.management.ObjectName containerId, Object instancePk)
          Remove the TimerService for a given containerId/pKey (TimedObjectId), along with any persisted timer information.
 void removeTimerService(javax.management.ObjectName containerId, Object instancePk, boolean keepState)
          Remove the TimerService for a given containerId/pKey (TimedObjectId).
 void restoreTimers(javax.management.ObjectName containerId, ClassLoader loader)
          Restore the persisted timers for a given ejb container
 void setPersistencePolicy(javax.management.ObjectName persistencePolicyName)
          Set the object name of the persistence policy.
 void setRetryPolicy(javax.management.ObjectName retryPolicyName)
          Set the object name of the retry policy.
 void setTimedObjectInvokerClassName(String timedObjectInvokerClassName)
          Set the TimedObjectInvoker class name
 void setTimerIdGeneratorClassName(String timerIdGeneratorClassName)
          Get the TimerIdGenerator class name
 void setTransactionManagerFactory(org.jboss.tm.TransactionManagerFactory factory)
          Set the TransactionManagerFactory
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

EJBTimerServiceImpl

public EJBTimerServiceImpl()
Method Detail

getRetryPolicy

public javax.management.ObjectName getRetryPolicy()
Get the object name of the retry policy.

Specified by:
getRetryPolicy in interface EJBTimerServiceImplMBean

setRetryPolicy

public void setRetryPolicy(javax.management.ObjectName retryPolicyName)
Set the object name of the retry policy.

Specified by:
setRetryPolicy in interface EJBTimerServiceImplMBean

getPersistencePolicy

public javax.management.ObjectName getPersistencePolicy()
Get the object name of the persistence policy.

Specified by:
getPersistencePolicy in interface EJBTimerServiceImplMBean

setPersistencePolicy

public void setPersistencePolicy(javax.management.ObjectName persistencePolicyName)
Set the object name of the persistence policy.

Specified by:
setPersistencePolicy in interface EJBTimerServiceImplMBean

getTimerIdGeneratorClassName

public String getTimerIdGeneratorClassName()
Get the TimerIdGenerator class name

Specified by:
getTimerIdGeneratorClassName in interface EJBTimerServiceImplMBean

setTimerIdGeneratorClassName

public void setTimerIdGeneratorClassName(String timerIdGeneratorClassName)
Get the TimerIdGenerator class name

Specified by:
setTimerIdGeneratorClassName in interface EJBTimerServiceImplMBean

getTimedObjectInvokerClassName

public String getTimedObjectInvokerClassName()
Get the TimedObjectInvoker class name

Specified by:
getTimedObjectInvokerClassName in interface EJBTimerServiceImplMBean

setTimedObjectInvokerClassName

public void setTimedObjectInvokerClassName(String timedObjectInvokerClassName)
Set the TimedObjectInvoker class name

Specified by:
setTimedObjectInvokerClassName in interface EJBTimerServiceImplMBean

setTransactionManagerFactory

public void setTransactionManagerFactory(org.jboss.tm.TransactionManagerFactory factory)
Set the TransactionManagerFactory

Specified by:
setTransactionManagerFactory in interface EJBTimerServiceImplMBean

startService

protected void startService()
                     throws Exception
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport

createTimerService

public javax.ejb.TimerService createTimerService(javax.management.ObjectName containerId,
                                                 Object instancePk,
                                                 Container container)
Create a TimerService for a given TimedObjectId that lives in a JBoss Container. The TimedObjectInvoker is constructed from the invokerClassName.

Specified by:
createTimerService in interface EJBTimerService
Parameters:
containerId - The string identifier for a class of TimedObjects
instancePk - The rimary key for an instance of a TimedObject, may be null
container - The Container that is associated with the TimerService
Returns:
the TimerService

createTimerService

public javax.ejb.TimerService createTimerService(javax.management.ObjectName containerId,
                                                 Object instancePk,
                                                 TimedObjectInvoker invoker)
Create a TimerService for a given TimedObjectId that is invoked through the given invoker

Specified by:
createTimerService in interface EJBTimerService
Parameters:
containerId - The string identifier for a class of TimedObjects
instancePk - The rimary key for an instance of a TimedObject, may be null
invoker - The TimedObjectInvoker
Returns:
the TimerService

getTimerService

public javax.ejb.TimerService getTimerService(javax.management.ObjectName containerId,
                                              Object instancePk)
Get the TimerService for a given TimedObjectId

Specified by:
getTimerService in interface EJBTimerService
Parameters:
containerId - The string identifier for a class of TimedObjects
instancePk - The rimary key for an instance of a TimedObject, may be null
Returns:
The TimerService, or null if it does not exist

removeTimerService

public void removeTimerService(javax.management.ObjectName containerId,
                               Object instancePk)
Remove the TimerService for a given containerId/pKey (TimedObjectId), along with any persisted timer information. This should be used for removing the TimerService and Timers associated with a particular entity bean, when it gets removed.

Specified by:
removeTimerService in interface EJBTimerService
Parameters:
containerId - The string identifier for a class of TimedObjects
pKey - The primary key for an instance of a TimedObject, may be null

removeTimerService

public void removeTimerService(javax.management.ObjectName containerId,
                               boolean keepState)
                        throws IllegalStateException
Remove the TimerService for a given containerId. This should be used to remove the timer service and timers for any type of container (session, entity, message) at the time of undeployment.

Specified by:
removeTimerService in interface EJBTimerService
Parameters:
containerId - The string identifier for a class of TimedObjects
keepState - Flag indicating whether timer persistent state should be kept or removed
Throws:
IllegalStateException

removeTimerService

public void removeTimerService(javax.management.ObjectName containerId,
                               Object instancePk,
                               boolean keepState)
                        throws IllegalStateException
Remove the TimerService for a given containerId/pKey (TimedObjectId).

Parameters:
containerId - The string identifier for a class of TimedObjects
pKey - The primary key for an instance of a TimedObject, may be null
keepState - Flag indicating whether timer persistent state should be kept or removed
Throws:
IllegalStateException

restoreTimers

public void restoreTimers(javax.management.ObjectName containerId,
                          ClassLoader loader)
                   throws IllegalStateException
Restore the persisted timers for a given ejb container

Specified by:
restoreTimers in interface EJBTimerService
Parameters:
containerId - The ejb container id
loader - The classloader to use for loading the timers
Throws:
IllegalStateException

listTimers

public String listTimers()
List the timers registered with all TimerService objects

Specified by:
listTimers in interface EJBTimerServiceImplMBean


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.