public class CMPHelper extends Object
| Constructor and Description |
|---|
CMPHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertValidLocalObject(Object o,
Object container)
Called in a CMP environment to verify that the specified object
is of a valid local interface type.
|
static void |
assertValidRemoteObject(Object o,
Object container)
Called in a CMP environment to verify that the specified object
is of a valid remote interface type.
|
static void |
beginInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment.
|
static void |
commitInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment.
|
static void |
flush(PersistenceManager pm)
Flush transactional changes to the database.
|
static Object |
getContainer(Object info)
Called in a CMP supported environment to get a Container instance that
will be passed unchanged to the required methods.
|
static javax.ejb.EJBLocalObject |
getEJBLocalObject(Object pk,
Object container)
Called in a managed environment to get an EJBLocalObject reference for this
primary key instance and Container object.
|
static javax.ejb.EJBLocalObject |
getEJBLocalObject(Object pk,
Object container,
javax.ejb.EJBContext context)
Called in a managed environment to get an EJBLocalObject reference for this
primary key instance, Container object, and EJBContext of the calling bean.
|
static javax.ejb.EJBObject |
getEJBObject(Object pk,
Object container)
Called in a CMP supported environment to get an EJBObject reference for this
primary key instance and Container object.
|
static long |
getNextId()
Increments the counter and returns the value.
|
static int |
getNumericConverterPolicy(Object container)
Called in CMP environment to get NumericConverter policy referenced
by this Container instance.
|
static PersistenceManagerFactory |
getPersistenceManagerFactory(Object container)
Called in a CMP environment to lookup PersistenceManagerFactory
referenced by this Container instance as the CMP resource.
|
static boolean |
isContainerReady() |
static void |
preSelect(Object container)
Called in a CMP supported environment.
|
static void |
registerContainerHelper(ContainerHelper h)
Register class that implements ContainerHelper interface
Should be called by a static method at class initialization time.
|
static void |
removeByEJBLocalObject(javax.ejb.EJBLocalObject ejb,
Object container)
Called in a managed environment to remove a bean for a given EJBLocalObject,
and Container instance.
|
static void |
removeByPK(Object pk,
Object container)
Called in a managed environment to remove a bean for a given primary key
and Container instance.
|
static void |
resumeCurrentTransaction(Transaction tx)
Called from read-only beans to resume current transaction.
|
static void |
rollbackInternalTransaction(PersistenceManager pm)
Called in a unspecified transaction context of a managed environment.
|
static void |
setCascadeDeleteAfterSuperEJBRemove(javax.ejb.EntityContext context)
Called in a managed environment to mark EntityContext of the
bean as already removed during cascade-delete operation.
|
static Transaction |
suspendCurrentTransaction()
Called from read-only beans to suspend current transaction.
|
public static void registerContainerHelper(ContainerHelper h)
h - application server specific implemetation of the ContainerHelper
interface.public static long getNextId()
public static Object getContainer(Object info)
info - Object with the request information that is application server
specific.JDOFatalInternalException - if ContainerHelper instance is not registered.getEJBObject(Object, Object),
getEJBLocalObject(Object, Object),
getEJBLocalObject(Object, Object, EJBContext),
removeByEJBLocalObject(EJBLocalObject, Object),
removeByPK(Object, Object)public static javax.ejb.EJBObject getEJBObject(Object pk, Object container)
pk - the primary key instance.container - a Container instance for the request.getContainer(Object)public static javax.ejb.EJBLocalObject getEJBLocalObject(Object pk, Object container)
pk - the primary key instance.container - a Container instance for the request.getContainer(Object)public static javax.ejb.EJBLocalObject getEJBLocalObject(Object pk, Object container, javax.ejb.EJBContext context)
pk - the primary key instance.container - a Container instance for the request.context - an EJBContext of the calling bean.getContainer(Object)public static void removeByEJBLocalObject(javax.ejb.EJBLocalObject ejb,
Object container)
ejb - the EJBLocalObject for the bean to be removed.container - a Container instance for the request.getContainer(Object)public static void removeByPK(Object pk, Object container)
pk - the primary key for the bean to be removed.container - a Container instance for the request.getContainer(Object)public static void setCascadeDeleteAfterSuperEJBRemove(javax.ejb.EntityContext context)
context - the EntityContext of the bean beeing removed.public static PersistenceManagerFactory getPersistenceManagerFactory(Object container)
container - a Container instance for the request.getContainer(Object)public static void assertValidLocalObject(Object o, Object container)
o - the instance to validate.container - a Container instance for the request.getContainer(Object)public static void assertValidRemoteObject(Object o, Object container)
o - the instance to validate.container - a Container instance for the request.getContainer(Object)public static void preSelect(Object container)
container - a Container instance for the request.getContainer(Object)public static int getNumericConverterPolicy(Object container)
container - a Container instance for the requestgetContainer(Object)public static void beginInternalTransaction(PersistenceManager pm)
pm - PersistenceManagerpublic static void commitInternalTransaction(PersistenceManager pm)
pm - PersistenceManagerpublic static void rollbackInternalTransaction(PersistenceManager pm)
pm - PersistenceManagerpublic static Transaction suspendCurrentTransaction()
public static void resumeCurrentTransaction(Transaction tx)
tx - - The javax.transaction.Transaction object that
represents the transaction to be resumed.public static void flush(PersistenceManager pm)
pm - PersistenceManagerpublic static boolean isContainerReady()
Copyright © 2019. All rights reserved.