Class SunContainerHelper
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImpl
-
- com.sun.jdo.spi.persistence.support.sqlstore.ejb.SunTransactionHelper
-
- com.sun.jdo.spi.persistence.support.sqlstore.ejb.SunContainerHelper
-
- All Implemented Interfaces:
ConnectorNamingEventListener
,ContainerHelper
,TransactionHelper
public class SunContainerHelper extends SunTransactionHelper implements ContainerHelper
Implementation for Sun specific CMP and Container interactions as defined by the ContainerHelper interface. IMPORTANT: This class extends SunTransactionHelper class. Any changes to the TransactionHelper implementation must be done in the SunTransactionHelper.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertValidLocalObject(Object o, Object container)
Verify that this instance is of a valid local interface type for a given Container helper.void
assertValidRemoteObject(Object o, Object container)
Verify that this instance is of a valid remote interface type for a given Container helper.void
beginInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment.void
commitInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment.Object
getContainer(Object info)
Get a Container helper instance that will be passed unchanged to the required methods.jakarta.ejb.EJBLocalObject
getEJBLocalObject(Object pk, Object container)
Get an EJBLocalObject reference for this primary key and Container helper.jakarta.ejb.EJBLocalObject
getEJBLocalObject(Object pk, Object container, jakarta.ejb.EJBContext context)
Get an EJBLocalObject reference for this primary key and Container helper, and EJBContext of the calling bean.jakarta.ejb.EJBObject
getEJBObject(Object pk, Object container)
Get an EJBObject reference for this primary key and Container helper.int
getNumericConverterPolicy(Object container)
Called in CMP environment to get NumericConverter policy referenced by this Container instance.PersistenceManagerFactory
getPersistenceManagerFactory(Object container)
Called in a CMP environment to lookup PersistenceManagerFactory referenced by this Container instance as the CMP resource.void
preSelect(Object container)
Called in a CMP supported environment.void
removeByEJBLocalObject(jakarta.ejb.EJBLocalObject ejb, Object container)
Remove a bean for a given EJBLocalObject and Container helper.void
removeByPK(Object pk, Object container)
Remove a bean for a given primary key and Container helper.void
resumeCurrentTransaction(jakarta.transaction.Transaction tx)
Called from read-only beans to resume current transaction.void
rollbackInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment.void
setCascadeDeleteAfterSuperEJBRemove(jakarta.ejb.EntityContext context)
Mark the bean as already removed during cascade-delete operation for a given EntityContext.jakarta.transaction.Transaction
suspendCurrentTransaction()
Called from read-only beans to suspend current transaction.-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.ejb.SunTransactionHelper
connectorNamingEventPerformed, getDDLNamePrefix, getLocalTransactionManager, getNonTransactionalConnection, getTransaction, getUserTransaction, notifyApplicationUnloaded, registerApplicationLifeCycleEventListener, registerSynchronization, replaceInternalPersistenceManagerFactory
-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImpl
getConnection, isManaged, postInvoke, preInvoke, setPersistenceManagerFactoryDefaults, translateStatus, unwrapStatement
-
-
-
-
Method Detail
-
getContainer
public Object getContainer(Object info)
Get a Container helper instance that will be passed unchanged to the required methods. This is SunContainerHelper specific code. The info argument is an Object array that consistes of a class to use for the class loader and concreteImpl bean class name.- Specified by:
getContainer
in interfaceContainerHelper
- Parameters:
info
- Object with the request information that is application server specific.- Returns:
- a Container helper instance as an Object.
- See Also:
getEJBObject(java.lang.Object,java.lang.Object)
,getEJBLocalObject(java.lang.Object,java.lang.Object)
,getEJBLocalObject(Object, Object, EJBObject)
,removeByEJBLocalObject(jakarta.ejb.EJBLocalObject,java.lang.Object)
,removeByPK(java.lang.Object,java.lang.Object)
-
getEJBObject
public jakarta.ejb.EJBObject getEJBObject(Object pk, Object container)
Get an EJBObject reference for this primary key and Container helper. This is SunContainerHelper specific code.- Specified by:
getEJBObject
in interfaceContainerHelper
- Parameters:
pk
- the primary key instance.container
- a Container instance for the request.- Returns:
- a corresponding EJBObject instance to be used by the client.
- See Also:
getContainer(java.lang.Object)
-
getEJBLocalObject
public jakarta.ejb.EJBLocalObject getEJBLocalObject(Object pk, Object container)
Get an EJBLocalObject reference for this primary key and Container helper. This is SunContainerHelper specific code.- Specified by:
getEJBLocalObject
in interfaceContainerHelper
- Parameters:
pk
- the primary key instance.container
- a helper instance for the request.- Returns:
- a corresponding EJBLocalObject instance to be used by the client.
- See Also:
getContainer(java.lang.Object)
-
getEJBLocalObject
public jakarta.ejb.EJBLocalObject getEJBLocalObject(Object pk, Object container, jakarta.ejb.EJBContext context)
Get an EJBLocalObject reference for this primary key and Container helper, and EJBContext of the calling bean. Allows the container to check if this method is called during ejbRemove that is part of a cascade-delete remove. This is SunContainerHelper specific code.- Specified by:
getEJBLocalObject
in interfaceContainerHelper
- Parameters:
pk
- the primary key instance.container
- a helper instance for the request.context
- an EJBContext of the calling bean.- Returns:
- a corresponding EJBLocalObject instance to be used by the client.
- See Also:
getContainer(java.lang.Object)
-
removeByEJBLocalObject
public void removeByEJBLocalObject(jakarta.ejb.EJBLocalObject ejb, Object container)
Remove a bean for a given EJBLocalObject and Container helper. This is SunContainerHelper specific code.- Specified by:
removeByEJBLocalObject
in interfaceContainerHelper
- Parameters:
ejb
- the EJBLocalObject for the bean to be removed.container
- a Container instance for the request.- See Also:
getContainer(java.lang.Object)
-
removeByPK
public void removeByPK(Object pk, Object container)
Remove a bean for a given primary key and Container helper. This is SunContainerHelper specific code.- Specified by:
removeByPK
in interfaceContainerHelper
- Parameters:
pk
- the primary key for the bean to be removed.container
- a Container instance for the request.- See Also:
getContainer(java.lang.Object)
-
assertValidLocalObject
public void assertValidLocalObject(Object o, Object container)
Verify that this instance is of a valid local interface type for a given Container helper. This is SunContainerHelper specific code.- Specified by:
assertValidLocalObject
in interfaceContainerHelper
- Parameters:
o
- the instance to be verified.container
- a Container instance for the request.- See Also:
getContainer(java.lang.Object)
-
assertValidRemoteObject
public void assertValidRemoteObject(Object o, Object container)
Verify that this instance is of a valid remote interface type for a given Container helper. This is SunContainerHelper specific code.- Specified by:
assertValidRemoteObject
in interfaceContainerHelper
- Parameters:
o
- the instance to be verified.container
- a Container instance for the request.- See Also:
getContainer(java.lang.Object)
-
setCascadeDeleteAfterSuperEJBRemove
public void setCascadeDeleteAfterSuperEJBRemove(jakarta.ejb.EntityContext context)
Mark the bean as already removed during cascade-delete operation for a given EntityContext. Called by the generated ejbRemove method before calling ejbRemove of the related beans (via removeByEJBLocalObject) that are to be cascade-deleted. This is SunContainerHelper specific code.- Specified by:
setCascadeDeleteAfterSuperEJBRemove
in interfaceContainerHelper
- Parameters:
context
- the EntityContext of the bean beeing removed.
-
preSelect
public void preSelect(Object container)
Called in a CMP supported environment. Notifies the container that ejbSelect had been called. This is SunContainerHelper specific code.- Specified by:
preSelect
in interfaceContainerHelper
- Parameters:
container
- a Container instance for the request.- See Also:
getContainer(java.lang.Object)
-
getPersistenceManagerFactory
public PersistenceManagerFactory getPersistenceManagerFactory(Object container)
Called in a CMP environment to lookup PersistenceManagerFactory referenced by this Container instance as the CMP resource. This is SunContainerHelper specific code.- Specified by:
getPersistenceManagerFactory
in interfaceContainerHelper
- Parameters:
container
- a Container instance for the request.- See Also:
getContainer(java.lang.Object)
-
getNumericConverterPolicy
public int getNumericConverterPolicy(Object container)
Called in CMP environment to get NumericConverter policy referenced by this Container instance.- Specified by:
getNumericConverterPolicy
in interfaceContainerHelper
- Parameters:
container
- a Container instance for the request- Returns:
- a valid NumericConverter policy type
- See Also:
getContainer(java.lang.Object)
-
beginInternalTransaction
public void beginInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment. According to p.364 of EJB 2.0 spec, CMP may need to manage its own transaction when its transaction attribute is NotSupported, Never, Supports. This is a generic implementation. Application server may like to overwrite this if necessary.- Specified by:
beginInternalTransaction
in interfaceContainerHelper
- Parameters:
pm
- PersistenceManager
-
commitInternalTransaction
public void commitInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment. According to p.364 of EJB 2.0 spec, CMP may need to manage its own transaction when its transaction attribute is NotSupported, Never, Supports. This is a generic implementation. Application server may like to overwrite this if necessary.- Specified by:
commitInternalTransaction
in interfaceContainerHelper
- Parameters:
pm
- PersistenceManager
-
rollbackInternalTransaction
public void rollbackInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment. According to p.364 of EJB 2.0 spec, CMP may need to manage its own transaction when its transaction attribute is NotSupported, Never, Supports. This is a generic implementation. Application server may like to overwrite this if necessary.- Specified by:
rollbackInternalTransaction
in interfaceContainerHelper
- Parameters:
pm
- PersistenceManager
-
suspendCurrentTransaction
public jakarta.transaction.Transaction suspendCurrentTransaction()
Called from read-only beans to suspend current transaction. This will guarantee that PersistenceManager is not bound to any transaction.- Specified by:
suspendCurrentTransaction
in interfaceContainerHelper
- Returns:
- jakarta.transaction.Transaction object representing the suspended transaction. Returns null if the calling thread is not associated with a transaction.
-
resumeCurrentTransaction
public void resumeCurrentTransaction(jakarta.transaction.Transaction tx)
Called from read-only beans to resume current transaction. This will guarantee that the transaction continues to run after read-only bean accessed its PersistenceManager.- Specified by:
resumeCurrentTransaction
in interfaceContainerHelper
- Parameters:
tx
- - The jakarta.transaction.Transaction object that represents the transaction to be resumed. If this object had been returned by #suspendCurrentTransaction() call it will be null in case calling thread was not associated with a transaction.
-
-