org.jboss.mq.sm.jdbc
Class JDBCStateManager

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.mq.sm.AbstractStateManager (src) 
              extended byorg.jboss.mq.sm.jdbc.JDBCStateManager
All Implemented Interfaces:
AbstractStateManagerMBean (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src) , StateManager (src)

public class JDBCStateManager
extends AbstractStateManager (src)

A state manager that stores state in the database.


Nested Class Summary
 
Nested classes inherited from class org.jboss.mq.sm.AbstractStateManager (src)
AbstractStateManager.DurableSubscription (src)
 
Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
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
JDBCStateManager()
           
 
Method Summary
protected  void checkLoggedOnClientId(java.lang.String clientID)
          Check if the clientID is allowed to logg in from the particular state managers perspective.
 ObjectName (src) getConnectionManager()
           
protected  AbstractStateManager.DurableSubscription (src) getDurableSubscription(DurableSubscriptionID (src)  sub)
          Get a DurableSubscription.
 java.util.Collection getDurableSubscriptionIdsForTopic(SpyTopic (src)  topic)
          Get all configured durable subscriptions for a particular topic.
 StateManager (src) getInstance()
          Get an instance if the StateManager (Singleton).
protected  java.lang.String getPreconfClientId(java.lang.String logon, java.lang.String passwd)
          Get preconfigured clientID for login/user, and if state manager wants do authentication.
 java.lang.String getSqlProperties()
          Gets the sqlProperties.
 boolean hasSecurityManager()
           
protected  void initDB()
           
protected  void removeDurableSubscription(AbstractStateManager.DurableSubscription (src)  ds)
          Remove the subscription and save to persistent storage.
protected  void saveDurableSubscription(AbstractStateManager.DurableSubscription (src)  ds)
          Add to durable subs and save the subsrcription to persistent storage.
 void setConnectionManager(ObjectName (src)  connectionManagerName)
           
 void setHasSecurityManager(boolean hasSecurityManager)
           
 void setSqlProperties(java.lang.String value)
          Sets the sqlProperties.
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
 
Methods inherited from class org.jboss.mq.sm.AbstractStateManager (src)
addLoggedOnClientId, checkUser, getDurableTopic, removeLoggedOnClientId, setDurableSubscription
 
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, stopService
 
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
 
Methods inherited from interface org.jboss.system.ServiceMBean (src)
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Constructor Detail

JDBCStateManager

public JDBCStateManager()
Method Detail

getConnectionManager

public ObjectName (src)  getConnectionManager()

setConnectionManager

public void setConnectionManager(ObjectName (src)  connectionManagerName)

hasSecurityManager

public boolean hasSecurityManager()

setHasSecurityManager

public void setHasSecurityManager(boolean hasSecurityManager)

getSqlProperties

public java.lang.String getSqlProperties()
Gets the sqlProperties.

Returns:
Returns a Properties

setSqlProperties

public void setSqlProperties(java.lang.String value)
Sets the sqlProperties.


getDurableSubscription

protected AbstractStateManager.DurableSubscription (src)  getDurableSubscription(DurableSubscriptionID (src)  sub)
                                                                   throws JMSException (src) 
Description copied from class: AbstractStateManager (src)
Get a DurableSubscription.

Specified by:
getDurableSubscription in class AbstractStateManager (src)
Parameters:
sub - the durable subscription id
Returns:
the durable subscription or null if not found
Throws:
JMSException (src) - for any error

saveDurableSubscription

protected void saveDurableSubscription(AbstractStateManager.DurableSubscription (src)  ds)
                                throws JMSException (src) 
Description copied from class: AbstractStateManager (src)
Add to durable subs and save the subsrcription to persistent storage.

Called by this class so the sublclass can save. This may be both a new subscription or a changed one. It is up to the sublcass to know how to find a changed on. (Only the topic will have changed, and it is the same DurableSubscription that is saved again that this class got through getDurableSubscription.

Specified by:
saveDurableSubscription in class AbstractStateManager (src)
Parameters:
ds - the durable subscription to save
Throws:
JMSException (src) - for any error

removeDurableSubscription

protected void removeDurableSubscription(AbstractStateManager.DurableSubscription (src)  ds)
                                  throws JMSException (src) 
Description copied from class: AbstractStateManager (src)
Remove the subscription and save to persistent storage.

Called by this class so the sublclass can remove.

Specified by:
removeDurableSubscription in class AbstractStateManager (src)
Parameters:
ds - the durable subscription to save
Throws:
JMSException (src) - for any error

getDurableSubscriptionIdsForTopic

public java.util.Collection getDurableSubscriptionIdsForTopic(SpyTopic (src)  topic)
                                                       throws JMSException (src) 
Description copied from interface: StateManager (src)
Get all configured durable subscriptions for a particular topic.

Specified by:
getDurableSubscriptionIdsForTopic in interface StateManager (src)
Specified by:
getDurableSubscriptionIdsForTopic in class AbstractStateManager (src)
Throws:
JMSException (src)

checkLoggedOnClientId

protected void checkLoggedOnClientId(java.lang.String clientID)
                              throws JMSException (src) 
Description copied from class: AbstractStateManager (src)
Check if the clientID is allowed to logg in from the particular state managers perspective.

Specified by:
checkLoggedOnClientId in class AbstractStateManager (src)
Parameters:
clientID - the client id to check
Throws:
JMSException (src) - for any error

getPreconfClientId

protected java.lang.String getPreconfClientId(java.lang.String logon,
                                              java.lang.String passwd)
                                       throws JMSException (src) 
Description copied from class: AbstractStateManager (src)
Get preconfigured clientID for login/user, and if state manager wants do authentication. This is NOT recomended when using a SecurityManager.

Specified by:
getPreconfClientId in class AbstractStateManager (src)
Parameters:
logon - the user name
passwd - the password
Returns:
any preconfigured client id
Throws:
JMSException (src) - for any error

getInstance

public StateManager (src)  getInstance()
Description copied from interface: AbstractStateManagerMBean (src)
Get an instance if the StateManager (Singleton).


startService

protected 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

initDB

protected void initDB()
               throws java.lang.Exception
Throws:
java.lang.Exception