|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.exolab.jms.service.Service
|
+--org.exolab.jms.persistence.DatabaseService
The DatabaseService is used for managing the persistence aspect of this project.
| Constructor Summary | |
DatabaseService(Configuration config)
Construct a new DatabaseService. |
|
| Method Summary | |
void |
begin()
Begin a transaction. |
void |
commit()
Commit the current transaction. |
protected void |
doStart()
Start the service. |
protected void |
doStop()
Stop the service. |
PersistenceAdapter |
getAdapter()
Returns the PersistenceAdapter created by this service. |
java.sql.Connection |
getConnection()
Returns the connection associated with the current thread. |
static DatabaseService |
getInstance()
Returns the database service associated with the current thread. |
boolean |
isTransacted()
Determines if a transaction is in progress. |
void |
rollback()
Rollback the current transaction. |
void |
setServiceThreadListener(ServiceThreadListener listener)
Sets the service thread listener. |
| Methods inherited from class org.exolab.jms.service.Service |
getName, isStarted, restart, start, stop, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DatabaseService(Configuration config)
DatabaseService.config - the configuration| Method Detail |
public void setServiceThreadListener(ServiceThreadListener listener)
listener - the service thread listener
public static DatabaseService getInstance()
throws PersistenceException
PersistenceException - if no instance is registeredpublic PersistenceAdapter getAdapter()
PersistenceAdapter created by this service.
public void begin()
throws PersistenceException
PersistenceException - if a transaction cannot be started
public java.sql.Connection getConnection()
throws PersistenceException
PersistenceException - if no connection is associated
public void commit()
throws PersistenceException
PersistenceException - if the transaction can't be committed
public void rollback()
throws PersistenceException
PersistenceException - if the transaction can't be rolled backpublic boolean isTransacted()
true if a transaction is in progress; otherwise
false
protected void doStart()
throws ServiceException
doStart in class ServiceServiceException - if the service fails to start
protected void doStop()
throws ServiceException
doStop in class ServiceServiceException - if the service fails to stop
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||