Class SunTransactionHelper
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImpl
-
- com.sun.jdo.spi.persistence.support.sqlstore.ejb.SunTransactionHelper
-
- All Implemented Interfaces:
ConnectorNamingEventListener,TransactionHelper
- Direct Known Subclasses:
SunContainerHelper
public class SunTransactionHelper extends TransactionHelperImpl implements ConnectorNamingEventListener
Sun specific implementation for TransactionHelper interface. This class has a special implementation forregisterSynchronization, because it uses a special object that registers Synchronization instance to be processed after any bean's or container beforeCompletion method, but before the corresponding afterCompletion.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectorNamingEventPerformed(ConnectorNamingEvent event)Listeners registered for the event will get notified via this method.
Listeners interested in the event will override this method and perform their required operations.StringgetDDLNamePrefix(Object info)Returns name prefix for DDL files extracted from the info instance by the application server specific code.jakarta.transaction.TransactionManagergetLocalTransactionManager()SunTransactionHelper specific codeConnectiongetNonTransactionalConnection(Object resource, String username, char[] password)Called in a managed environment to get a Connection from the application server specific resource.jakarta.transaction.TransactiongetTransaction()SunTransactionHelper specific codejakarta.transaction.UserTransactiongetUserTransaction()SunTransactionHelper specific codevoidnotifyApplicationUnloaded(ClassLoader classLoader)Called to notify a ApplicationLifeCycleEventListeners that an application is unloaded.voidregisterApplicationLifeCycleEventListener(ApplicationLifeCycleEventListener listener)Called to register a ApplicationLifeCycleEventListener.voidregisterSynchronization(jakarta.transaction.Transaction jta, jakarta.transaction.Synchronization sync)SunTransactionHelper specific codePersistenceManagerFactoryreplaceInternalPersistenceManagerFactory(PersistenceManagerFactory pmf)SunTransactionHelper specific code-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImpl
getConnection, isManaged, postInvoke, preInvoke, setPersistenceManagerFactoryDefaults, translateStatus, unwrapStatement
-
-
-
-
Method Detail
-
getTransaction
public jakarta.transaction.Transaction getTransaction()
SunTransactionHelper specific code- Specified by:
getTransactionin interfaceTransactionHelper- Specified by:
getTransactionin classTransactionHelperImpl- Returns:
- the Transaction instance for the calling thread
-
getUserTransaction
public jakarta.transaction.UserTransaction getUserTransaction()
SunTransactionHelper specific code- Specified by:
getUserTransactionin interfaceTransactionHelper- Specified by:
getUserTransactionin classTransactionHelperImpl- Returns:
- the UserTransaction instance for the calling thread
-
registerSynchronization
public void registerSynchronization(jakarta.transaction.Transaction jta, jakarta.transaction.Synchronization sync) throws jakarta.transaction.RollbackException, jakarta.transaction.SystemExceptionSunTransactionHelper specific code- Specified by:
registerSynchronizationin interfaceTransactionHelper- Overrides:
registerSynchronizationin classTransactionHelperImpl- Parameters:
jta- the Transaction instance for the calling thread.sync- the internal Synchronization instance to register.- Throws:
jakarta.transaction.SystemExceptionjakarta.transaction.RollbackException
-
replaceInternalPersistenceManagerFactory
public PersistenceManagerFactory replaceInternalPersistenceManagerFactory(PersistenceManagerFactory pmf)
SunTransactionHelper specific code- Specified by:
replaceInternalPersistenceManagerFactoryin interfaceTransactionHelper- Overrides:
replaceInternalPersistenceManagerFactoryin classTransactionHelperImpl- Parameters:
pmf- PersistenceManagerFactory instance to be replaced- Returns:
- the PersistenceManagerFactory known to the runtime
-
getDDLNamePrefix
public String getDDLNamePrefix(Object info)
Returns name prefix for DDL files extracted from the info instance by the application server specific code. SunTransactionHelper specific code. Delegates the actual implementation to DeploymentHelper#getDDLNamePrefix(Object);- Specified by:
getDDLNamePrefixin interfaceTransactionHelper- Overrides:
getDDLNamePrefixin classTransactionHelperImpl- Parameters:
info- the instance to use for the name generation.- Returns:
- name prefix as String.
-
getNonTransactionalConnection
public Connection getNonTransactionalConnection(Object resource, String username, char[] password) throws SQLException
Called in a managed environment to get a Connection from the application server specific resource. In a non-managed environment returns null as it should not be called. SunTransactionHelper specific code uses com.sun.appserv.jdbc.DataSource to get a Connection.- Specified by:
getNonTransactionalConnectionin interfaceTransactionHelper- Specified by:
getNonTransactionalConnectionin classTransactionHelperImpl- Parameters:
resource- the application server specific resource.username- the resource username. If null, Connection is requested without username and password validation.password- the password for the resource username.- Returns:
- a Connection.
- Throws:
SQLException
-
getLocalTransactionManager
public jakarta.transaction.TransactionManager getLocalTransactionManager()
SunTransactionHelper specific code- Specified by:
getLocalTransactionManagerin interfaceTransactionHelper- Specified by:
getLocalTransactionManagerin classTransactionHelperImpl- Returns:
- jakarta.transaction.TransactionManager
-
registerApplicationLifeCycleEventListener
public void registerApplicationLifeCycleEventListener(ApplicationLifeCycleEventListener listener)
Description copied from interface:TransactionHelperCalled to register a ApplicationLifeCycleEventListener. If ApplicationLifeCycle management is active (typically in managed environment), the registered listener will receive a call back for lifecycle events.- Specified by:
registerApplicationLifeCycleEventListenerin interfaceTransactionHelper- Overrides:
registerApplicationLifeCycleEventListenerin classTransactionHelperImpl- Parameters:
listener- An instance of ApplicationLifeCycleEventListener.
-
notifyApplicationUnloaded
public void notifyApplicationUnloaded(ClassLoader classLoader)
Description copied from interface:TransactionHelperCalled to notify a ApplicationLifeCycleEventListeners that an application is unloaded. If ApplicationLifeCycle management is active (typically in managed environment), the registered listener will handle the notification.- Specified by:
notifyApplicationUnloadedin interfaceTransactionHelper- Overrides:
notifyApplicationUnloadedin classTransactionHelperImpl- Parameters:
classLoader- An instance of the ClassLoader that loaded the application.
-
connectorNamingEventPerformed
public void connectorNamingEventPerformed(ConnectorNamingEvent event)
Description copied from interface:ConnectorNamingEventListenerListeners registered for the event will get notified via this method.
Listeners interested in the event will override this method and perform their required operations.- Specified by:
connectorNamingEventPerformedin interfaceConnectorNamingEventListener
-
-