org.jboss.system.pm
Class AttributePersistenceService

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.system.pm.AttributePersistenceService
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class AttributePersistenceService
extends ServiceMBeanSupport (src)

AttributePersistenceService Works in conjuction with org.jboss.mx.persistence.DelegatingPersistenceManager that upon creation, consults this service for an implementations of the interface org.jboss.mx.persistence.AttributePersistenceManager The service will instantiate and initialize the actual persistence manager and return it whenever asked. It also introduces the notion of a 'version', when creating the persistent manager, so that persisted data from different versions are kept separately. The service can be stopped, the version can be changed and the service re-started, resulting in a new persistent manager being instantiated and all XMBeans created thereafter using this instead. So the goal is really to have a way to plug-in external and manageable persistent managers that that support versioning, too.


Field Summary
static java.lang.String DEFAULT_APM
          The default AttributePersistenceManager implementation
static boolean DEFAULT_DESTROY_APM_ON_STOP
          The default behaviour for destroying the APM when stopping
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
AttributePersistenceService()
          Constructs a AttributePersistenceService.
 
Method Summary
 AttributePersistenceManager (src) apmCreate()
           
 boolean apmExists(java.lang.String id)
           
 java.lang.String[] apmListAll()
           
 java.lang.String apmListAllAsString()
           
 void apmRemove(java.lang.String id)
           
 void apmRemoveAll()
           
 boolean getApmDestroyOnServiceStop()
           
 java.lang.String getAttributePersistenceManagerClass()
           
 org.w3c.dom.Element getAttributePersistenceManagerConfig()
           
 java.lang.String getVersionTag()
           
 void setApmDestroyOnServiceStop(boolean apmDestroyOnStop)
           
 void setAttributePersistenceManagerClass(java.lang.String apmClass)
           
 void setAttributePersistenceManagerConfig(org.w3c.dom.Element apmConfig)
           
 void setVersionTag(java.lang.String versionTag)
           
 void startService()
          Sub-classes should override this method to provide custum 'start' logic.
 void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, 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 (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_APM

public static final java.lang.String DEFAULT_APM
The default AttributePersistenceManager implementation

See Also:
Constant Field Values (src)

DEFAULT_DESTROY_APM_ON_STOP

public static final boolean DEFAULT_DESTROY_APM_ON_STOP
The default behaviour for destroying the APM when stopping

See Also:
Constant Field Values (src)
Constructor Detail

AttributePersistenceService

public AttributePersistenceService()
Constructs a AttributePersistenceService.

Method Detail

getVersionTag

public java.lang.String getVersionTag()
Returns:
Returns the versionTag.

setVersionTag

public void setVersionTag(java.lang.String versionTag)
Parameters:
versionTag - The versionTag to set.

getAttributePersistenceManagerClass

public java.lang.String getAttributePersistenceManagerClass()
Returns:
Returns the apmClass.

setAttributePersistenceManagerClass

public void setAttributePersistenceManagerClass(java.lang.String apmClass)
Parameters:
apmClass - The apmClass to set.

getAttributePersistenceManagerConfig

public org.w3c.dom.Element getAttributePersistenceManagerConfig()
Returns:
Returns the apmConfig.

setAttributePersistenceManagerConfig

public void setAttributePersistenceManagerConfig(org.w3c.dom.Element apmConfig)
Parameters:
apmConfig - The apmConfig to set.

getApmDestroyOnServiceStop

public boolean getApmDestroyOnServiceStop()
Returns:
Returns the apmDestroyOnStop.

setApmDestroyOnServiceStop

public void setApmDestroyOnServiceStop(boolean apmDestroyOnStop)
Parameters:
apmDestroyOnStop - The apmDestroyOnStop to set.

startService

public void startService()
                  throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

public void stopService()
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)

apmCreate

public AttributePersistenceManager (src)  apmCreate()

apmExists

public boolean apmExists(java.lang.String id)
                  throws java.lang.Exception
Throws:
java.lang.Exception

apmRemove

public void apmRemove(java.lang.String id)
               throws java.lang.Exception
Throws:
java.lang.Exception

apmRemoveAll

public void apmRemoveAll()
                  throws java.lang.Exception
Throws:
java.lang.Exception

apmListAll

public java.lang.String[] apmListAll()
                              throws java.lang.Exception
Throws:
java.lang.Exception

apmListAllAsString

public java.lang.String apmListAllAsString()
                                    throws java.lang.Exception
Throws:
java.lang.Exception