|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.spi.persistence.support.ejb.cmp.CMPBeanHelper
public class CMPBeanHelper
Provides static helper methods for CMP bean implementation to simplify the generated code.
| Constructor Summary | |
|---|---|
CMPBeanHelper()
|
|
| Method Summary | |
|---|---|
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(PersistenceManager pm,
Object bean,
StringBuffer buf)
Called from a CMP bean to verify that the PersistenceManager is null. |
static void |
assertPersistenceManagerNotNull(PersistenceManager pm,
Object bean)
Called from a CMP bean to verify that the PersistenceManager is not null. |
static void |
assertPersistent(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,
JDOException ex)
Called from a CMP bean to process JDODuplicateObjectIdException. |
static void |
handleJDODuplicateObjectIdAsEJBException(String beanName,
String paramList,
JDOException ex)
Called from a CMP bean to process JDODuplicateObjectIdException. |
static void |
handleJDOObjectNotFoundException(Object primaryKey,
String beanName,
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,
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,
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,
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,
JDOException ex)
Called from a CMP bean to log JDOException message with the LifecycleLogger. |
static void |
logJDOExceptionWithLifecycleLogger(String key,
String beanName,
String paramList,
JDOException ex)
Called from a CMP bean to log JDOException message with the LifecycleLogger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CMPBeanHelper()
| Method Detail |
|---|
public static void logJDOExceptionWithLifecycleLogger(String key,
String beanName,
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,
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,
JDOException ex)
beanName - the name of the calling bean.ex - the JDOException.
public static void logJDOExceptionWithFinderLogger(String beanName,
Object[] params,
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,
JDOException ex)
beanName - the name of the calling bean.ex - the JDOException.
public static void assertPersistent(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(PersistenceManager pm,
Object bean)
pm - the PersistenceManager to check.bean - the calling bean instance.
IllegalStateException - if the PersistenceManager is null.
public static void assertPersistenceManagerIsNull(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,
JDOException ex)
throws DuplicateKeyException
beanName - the name of the calling bean.paramList - the list of the concatenated parameters.ex - the JDOException.
DuplicateKeyException.
DuplicateKeyException
public static void handleJDODuplicateObjectIdAsEJBException(String beanName,
String paramList,
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,
JDOException ex)
throws ObjectNotFoundException
primaryKey - the PrimaryKey instance.beanName - the name of the calling bean.ex - the JDOException.
ObjectNotFoundException.
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||