public class CMPBeanHelper extends Object
| Constructor and Description |
|---|
CMPBeanHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertCollectionNotNull(Collection c,
String beanName)
Called from a CMP bean to verify that the argument for
a Collection set method is not null.
|
static void |
assertNotContainerTransaction(Object bean)
Called from a 1.1 CMP bean to verify that the bean method is not called
in a container transaction.
|
static void |
assertPersistenceManagerIsNull(com.sun.jdo.api.persistence.support.PersistenceManager pm,
Object bean,
StringBuffer buf)
Called from a CMP bean to verify that the PersistenceManager
is null.
|
static void |
assertPersistenceManagerNotNull(com.sun.jdo.api.persistence.support.PersistenceManager pm,
Object bean)
Called from a CMP bean to verify that the PersistenceManager
is not null.
|
static void |
assertPersistent(com.sun.jdo.api.persistence.support.PersistenceCapable pc,
String beanName)
Called from a CMP bean to verify that the PersistenceCapable
instance is already persistent.
|
static void |
handleCloneException(Object primaryKey,
String beanName,
Exception ex)
Throws EJBException on failed clone of persistence state
in read-only beans.
|
static void |
handleJDODuplicateObjectIdAsDuplicateKeyException(String beanName,
String paramList,
com.sun.jdo.api.persistence.support.JDOException ex)
Called from a CMP bean to process JDODuplicateObjectIdException.
|
static void |
handleJDODuplicateObjectIdAsEJBException(String beanName,
String paramList,
com.sun.jdo.api.persistence.support.JDOException ex)
Called from a CMP bean to process JDODuplicateObjectIdException.
|
static void |
handleJDOObjectNotFoundException(Object primaryKey,
String beanName,
com.sun.jdo.api.persistence.support.JDOException ex)
Called from a CMP bean to process JDOObjectNotFoundException.
|
static void |
handleUpdateNotAllowedException(String beanName)
Throws EJBException on attempted updates to the
calling bean.
|
static void |
logFinderException(int level,
String beanName,
Exception ex)
Called from a CMP bean to log JDOException message thrown
from a any finder or selector method, with the FinderLogger.
|
static String |
logJDOExceptionFromPKSetter(String beanName,
com.sun.jdo.api.persistence.support.JDOException ex)
Called from a CMP bean to log JDOException message thrown
from a PK setter method, with the InternalLogger.
|
static void |
logJDOExceptionWithFinderLogger(String beanName,
Object[] params,
com.sun.jdo.api.persistence.support.JDOException ex)
Called from a CMP bean to log JDOException message thrown
from a any finder or selector method, with the FinderLogger.
|
static void |
logJDOExceptionWithInternalLogger(String beanName,
com.sun.jdo.api.persistence.support.JDOException ex)
Called from a CMP bean to log JDOException message thrown
from a any getter or setter method, with the InternalLogger.
|
static void |
logJDOExceptionWithLifecycleLogger(String key,
String beanName,
com.sun.jdo.api.persistence.support.JDOException ex)
Called from a CMP bean to log JDOException message
with the LifecycleLogger.
|
static void |
logJDOExceptionWithLifecycleLogger(String key,
String beanName,
String paramList,
com.sun.jdo.api.persistence.support.JDOException ex)
Called from a CMP bean to log JDOException message
with the LifecycleLogger.
|
public static void logJDOExceptionWithLifecycleLogger(String key, String beanName, com.sun.jdo.api.persistence.support.JDOException ex)
key - the key for the corresponding Bundle.beanName - the name of the calling bean.ex - the JDOException.public static void logJDOExceptionWithLifecycleLogger(String key, String beanName, String paramList, com.sun.jdo.api.persistence.support.JDOException ex)
key - the key for the corresponding Bundle.beanName - the name of the calling bean.paramList - the list of the concatenated parameters.ex - the JDOException.public static void logJDOExceptionWithInternalLogger(String beanName, com.sun.jdo.api.persistence.support.JDOException ex)
beanName - the name of the calling bean.ex - the JDOException.public static void logJDOExceptionWithFinderLogger(String beanName, Object[] params, com.sun.jdo.api.persistence.support.JDOException ex)
beanName - the name of the calling bean.params - the Object[] of the parameter values for the
finder or selector method.ex - the JDOException.public static void logFinderException(int level,
String beanName,
Exception ex)
level - the logging level as int.beanName - the name of the calling bean.ex - the Exception.public static String logJDOExceptionFromPKSetter(String beanName, com.sun.jdo.api.persistence.support.JDOException ex)
beanName - the name of the calling bean.ex - the JDOException.public static void assertPersistent(com.sun.jdo.api.persistence.support.PersistenceCapable pc,
String beanName)
pc - the PersistenceCapable instance to be checked.beanName - the name of the caller bean.IllegalStateException - if the instance is not persistent.public static void assertCollectionNotNull(Collection c, String beanName)
c - the Collection to check.beanName - the name of the caller bean.IllegalArgumentException - if the argument is null.public static void assertPersistenceManagerNotNull(com.sun.jdo.api.persistence.support.PersistenceManager pm,
Object bean)
pm - the PersistenceManager to check.bean - the calling bean instance.IllegalStateException - if the PersistenceManager is null.public static void assertPersistenceManagerIsNull(com.sun.jdo.api.persistence.support.PersistenceManager pm,
Object bean,
StringBuffer buf)
pm - the PersistenceManager to check.bean - the calling bean instance.IllegalStateException - if the PersistenceManager is not null.public static void assertNotContainerTransaction(Object bean)
bean - the calling bean instance.IllegalStateException - if the bean method is called in a container transaction.public static void handleJDODuplicateObjectIdAsDuplicateKeyException(String beanName, String paramList, com.sun.jdo.api.persistence.support.JDOException ex) throws jakarta.ejb.DuplicateKeyException
beanName - the name of the calling bean.paramList - the list of the concatenated parameters.ex - the JDOException.DuplicateKeyException.jakarta.ejb.DuplicateKeyExceptionpublic static void handleJDODuplicateObjectIdAsEJBException(String beanName, String paramList, com.sun.jdo.api.persistence.support.JDOException ex)
beanName - the name of the calling bean.paramList - the list of the concatenated parameters.ex - the JDOException.EJBException.public static void handleJDOObjectNotFoundException(Object primaryKey, String beanName, com.sun.jdo.api.persistence.support.JDOException ex) throws jakarta.ejb.ObjectNotFoundException
primaryKey - the PrimaryKey instance.beanName - the name of the calling bean.ex - the JDOException.ObjectNotFoundException.jakarta.ejb.ObjectNotFoundExceptionpublic static void handleUpdateNotAllowedException(String beanName)
beanName - the name of the calling bean.EJBException.public static void handleCloneException(Object primaryKey, String beanName, Exception ex)
primaryKey - the PrimaryKey instance.beanName - the name of the calling bean.ex - the Exception.EJBException.Copyright © 2017–2020 Eclipse Foundation. All rights reserved.