Methods Summary |
---|
public static void | assertValidLocalObject(java.lang.Object o, java.lang.Object container)Called in a CMP environment to verify that the specified object
is of a valid local interface type.
The Container instance is acquired via #getContainer(Object).
getContainerHelper().assertValidLocalObject(o, container);
|
public static void | assertValidRemoteObject(java.lang.Object o, java.lang.Object container)Called in a CMP environment to verify that the specified object
is of a valid remote interface type.
The Container instance is acquired via #getContainer(Object).
getContainerHelper().assertValidRemoteObject(o, container);
|
public static void | beginInternalTransaction(com.sun.jdo.api.persistence.support.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.
getContainerHelper().beginInternalTransaction(pm);
|
public static void | commitInternalTransaction(com.sun.jdo.api.persistence.support.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.
getContainerHelper().commitInternalTransaction(pm);
|
public static void | flush(com.sun.jdo.api.persistence.support.PersistenceManager pm)Flush transactional changes to the database.
Transaction tx = pm.currentTransaction();
// flush updates to the database if transaction is active.
if (tx != null && tx.isActive()) {
PersistenceManagerWrapper pmw = (PersistenceManagerWrapper)pm;
PersistenceManagerImpl pmi =
(PersistenceManagerImpl)pmw.getPersistenceManager();
pmi.internalFlush();
}
|
public static java.lang.Object | getContainer(java.lang.Object info)Called in a CMP supported environment to get a Container instance that
will be passed unchanged to the required methods. In a non-managed environment
throws JDOFatalInternalException.
The info argument can be an array of Objects if necessary.
return getContainerHelper().getContainer(info);
|
private static ContainerHelper | getContainerHelper()Returns a ContainerHelper instance that can be used to invoke
the corresponding method.
if (containerHelper == null) {
throw new JDOFatalInternalException(I18NHelper.getMessage(
messages, "ejb.cmphelper.nonmanaged")); //NOI18N
}
return containerHelper;
|
public static javax.ejb.EJBLocalObject | getEJBLocalObject(java.lang.Object pk, java.lang.Object container)Called in a managed environment to get an EJBLocalObject reference for this
primary key instance and Container object.
The Container instance is acquired via #getContainer(Object).
return getContainerHelper().getEJBLocalObject(pk, container);
|
public static javax.ejb.EJBLocalObject | getEJBLocalObject(java.lang.Object pk, java.lang.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.
Allows the container to check if this method is called during ejbRemove
that is part of a cascade-delete remove.
The Container instance is acquired via #getContainer(Object).
return getContainerHelper().getEJBLocalObject(pk, container, context);
|
public static javax.ejb.EJBObject | getEJBObject(java.lang.Object pk, java.lang.Object container)Called in a CMP supported environment to get an EJBObject reference for this
primary key instance and Container object.
The Container instance is acquired via #getContainer(Object).
return getContainerHelper().getEJBObject(pk, container);
|
public static synchronized long | getNextId()Increments the counter and returns the value. Used to populate primary
key columns for EJB with an unknown Primary Key Class.
counter++;
return counter;
|
public static int | getNumericConverterPolicy(java.lang.Object container)Called in CMP environment to get NumericConverter policy referenced
by this Container instance.
return getContainerHelper().getNumericConverterPolicy(container);
|
public static com.sun.jdo.api.persistence.support.PersistenceManagerFactory | getPersistenceManagerFactory(java.lang.Object container)Called in a CMP environment to lookup PersistenceManagerFactory
referenced by this Container instance as the CMP resource.
The Container instance is acquired via #getContainer(Object).
return getContainerHelper().getPersistenceManagerFactory(container);
|
public static void | preSelect(java.lang.Object container)Called in a CMP supported environment. Notifies the container that
ejbSelect had been called.
The Container instance is acquired via #getContainer(Object).
getContainerHelper().preSelect(container);
|
public static void | registerContainerHelper(ContainerHelper h)Register class that implements ContainerHelper interface
Should be called by a static method at class initialization time.
containerHelper = h;
|
public static void | removeByEJBLocalObject(javax.ejb.EJBLocalObject ejb, java.lang.Object container)Called in a managed environment to remove a bean for a given EJBLocalObject,
and Container instance.
The Container instance is acquired via #getContainer(Object).
getContainerHelper().removeByEJBLocalObject(ejb, container);
|
public static void | removeByPK(java.lang.Object pk, java.lang.Object container)Called in a managed environment to remove a bean for a given primary key
and Container instance.
The Container instance is acquired via #getContainer(Object).
getContainerHelper().removeByPK(pk, container);
|
public static void | resumeCurrentTransaction(javax.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.
getContainerHelper().resumeCurrentTransaction(tx);
|
public static void | rollbackInternalTransaction(com.sun.jdo.api.persistence.support.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.
getContainerHelper().rollbackInternalTransaction(pm);
|
public 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.
Called by the generated ejbRemove method before calling ejbRemove of the
related beans (via removeByEJBLocalObject) that are to be cascade-deleted.
The Container instance is acquired via #getContainer(Object).
getContainerHelper().setCascadeDeleteAfterSuperEJBRemove(context);
|
public static javax.transaction.Transaction | suspendCurrentTransaction()Called from read-only beans to suspend current transaction.
This will guarantee that PersistenceManager is not bound to
any transaction.
return getContainerHelper().suspendCurrentTransaction();
|