| java.lang.Object org.ow2.easybeans.tests.common.helper.ContextHelper
ContextHelper | final public class ContextHelper (Code) | | Used to do common operations on bean contexts.
author: Eduardo Studzinski Estima de Castro author: Gisele Pinheiro Souza |
Method Summary | |
public static void | checkBeanRef(EJBContext ejbContext, String entryName, E beanInterface) Checks the following items:if the ejb context can be used to
access the environment entry; if the JNDI API can be used
directly to access the environment entry; If fails, an
IllegalStateException is thrown. | public static void | checkEntityManager(EJBContext ejbContext, EntityManager ref, String pUnitName) Checks the following items: if the injected reference is ok;if the ejb context can be used to
access the persitence unit entry; if the JNDI API can be used
directly to access the persistence context entry; If fails, an
IllegalStateException is thrown. | public static void | checkEntityManager(EJBContext ejbContext, String pUnitName) Checks the following items:if the ejb context can be used to
access the persitence unit entry; if the JNDI API can be used
directly to access the persistence context entry; If fails, an
IllegalStateException is thrown. | public static void | checkEntityManager(EntityManager ref) Checks if an entity manager reference is working properly. | public static void | checkEntityManagerFactory(EJBContext ejbContext, EntityManagerFactory ref, String pUnitName) Checks the following items: if the injected reference is ok;if the ejb context can be used to
access the persitence unit entry; if the JNDI API can be used
directly to access the persistence unit entry; If fails, an
IllegalStateException is thrown. | public static void | checkEntityManagerFactory(EJBContext ejbContext, String pUnitName) Checks the following items:if the ejb context can be used to
access the persitence unit entry; if the JNDI API can be used
directly to access the persistence unit entry; If fails, an
IllegalStateException is thrown. | public static void | checkEntityManagerFactory(EntityManagerFactory ref) Checks if an entity manager factory reference is working properly. | public static void | checkResource(EJBContext ejbContext, E resource, String resourceName) Checks the following items:if the resource was correctly injected;
if the ejb context can be used to
access the resource; if the JNDI API can be used
directly to access the resource; If fails, an
IllegalStateException is thrown. | public static void | checkResource(EJBContext ejbContext, String entryName) Checks the following items:if the ejb context can be used to
access the entry; if the JNDI API can be used
directly to access the entry; If fails, an
IllegalStateException is thrown. | public static void | checkResource(E entry) Checks if an entry is working properly. | public static void | checkSimpleEntry(EJBContext ejbContext, String entryName, E beanValue, E expectedValue) Checks the following items:if a simple environment entry value specified
in the descriptor was correctly injected; if the session
context can be used to access the simple environment entry; if the
JNDI API can be used directly to access the simple environment entry; If
fails, an IllegalStateException is thrown. | public static void | checkSimpleEntry(EJBContext ejbContext, String entryName, E expectedValue) Checks the following items:if the ejb context can be used to
access the simple environment entry; if the JNDI API can be
used directly to access the simple environment entry; If fails, an
IllegalStateException is thrown. |
ERROR_MSG_INJECTION | final public static String ERROR_MSG_INJECTION(Code) | | Error message.
|
ERROR_MSG_JNDI_ACCESS | final public static String ERROR_MSG_JNDI_ACCESS(Code) | | Error message.
|
ERROR_MSG_NOT_FOUND | final public static String ERROR_MSG_NOT_FOUND(Code) | | Error message.
|
ERROR_MSG_SESSION_CONTEXT | final public static String ERROR_MSG_SESSION_CONTEXT(Code) | | Error message.
|
ERROR_REFERENCE_NULL | final public static String ERROR_REFERENCE_NULL(Code) | | Error message.
|
checkBeanRef | public static void checkBeanRef(EJBContext ejbContext, String entryName, E beanInterface)(Code) | | Checks the following items:if the ejb context can be used to
access the environment entry; if the JNDI API can be used
directly to access the environment entry; If fails, an
IllegalStateException is thrown.
< Parameters: E - > Element Type Parameters: ejbContext - ejb context instance Parameters: entryName - entry name in the environment Parameters: beanInterface - bean interface. |
checkEntityManager | public static void checkEntityManager(EJBContext ejbContext, EntityManager ref, String pUnitName)(Code) | | Checks the following items: if the injected reference is ok;if the ejb context can be used to
access the persitence unit entry; if the JNDI API can be used
directly to access the persistence context entry; If fails, an
IllegalStateException is thrown.
Parameters: ref - reference Parameters: ejbContext - ejb context instance Parameters: pUnitName - persistence unit name |
checkEntityManager | public static void checkEntityManager(EJBContext ejbContext, String pUnitName)(Code) | | Checks the following items:if the ejb context can be used to
access the persitence unit entry; if the JNDI API can be used
directly to access the persistence context entry; If fails, an
IllegalStateException is thrown.
Parameters: ejbContext - ejb context instance Parameters: pUnitName - persistence unit name |
checkEntityManager | public static void checkEntityManager(EntityManager ref)(Code) | | Checks if an entity manager reference is working properly.
Parameters: ref - reference |
checkEntityManagerFactory | public static void checkEntityManagerFactory(EJBContext ejbContext, EntityManagerFactory ref, String pUnitName)(Code) | | Checks the following items: if the injected reference is ok;if the ejb context can be used to
access the persitence unit entry; if the JNDI API can be used
directly to access the persistence unit entry; If fails, an
IllegalStateException is thrown.
Parameters: ref - reference Parameters: ejbContext - ejb context instance Parameters: pUnitName - persistence unit name |
checkEntityManagerFactory | public static void checkEntityManagerFactory(EJBContext ejbContext, String pUnitName)(Code) | | Checks the following items:if the ejb context can be used to
access the persitence unit entry; if the JNDI API can be used
directly to access the persistence unit entry; If fails, an
IllegalStateException is thrown.
Parameters: ejbContext - ejb context instance Parameters: pUnitName - persistence unit name |
checkEntityManagerFactory | public static void checkEntityManagerFactory(EntityManagerFactory ref)(Code) | | Checks if an entity manager factory reference is working properly.
Parameters: ref - reference |
checkResource | public static void checkResource(EJBContext ejbContext, E resource, String resourceName)(Code) | | Checks the following items:if the resource was correctly injected;
if the ejb context can be used to
access the resource; if the JNDI API can be used
directly to access the resource; If fails, an
IllegalStateException is thrown.
< Parameters: E - > Element Type Parameters: ejbContext - session Context instance Parameters: resource - resource object Parameters: resourceName - resource name in the environment |
checkResource | public static void checkResource(EJBContext ejbContext, String entryName)(Code) | | Checks the following items:if the ejb context can be used to
access the entry; if the JNDI API can be used
directly to access the entry; If fails, an
IllegalStateException is thrown.
< Parameters: E - > Element Type Parameters: ejbContext - ejb context instance Parameters: entryName - entry name in the environment |
checkResource | public static void checkResource(E entry)(Code) | | Checks if an entry is working properly.
< Parameters: E - > entry type Parameters: entry - reference |
checkSimpleEntry | public static void checkSimpleEntry(EJBContext ejbContext, String entryName, E beanValue, E expectedValue)(Code) | | Checks the following items:if a simple environment entry value specified
in the descriptor was correctly injected; if the session
context can be used to access the simple environment entry; if the
JNDI API can be used directly to access the simple environment entry; If
fails, an IllegalStateException is thrown.
< Parameters: E - > Element Type Parameters: ejbContext - ejb context instance Parameters: entryName - entry name in the environment Parameters: beanValue - value obtained in the bean object. Parameters: expectedValue - value expected by the element |
checkSimpleEntry | public static void checkSimpleEntry(EJBContext ejbContext, String entryName, E expectedValue)(Code) | | Checks the following items:if the ejb context can be used to
access the simple environment entry; if the JNDI API can be
used directly to access the simple environment entry; If fails, an
IllegalStateException is thrown.
< Parameters: E - > Element Type Parameters: ejbContext - ejb context instance Parameters: entryName - entry name in the environment. Parameters: expectedValue - value expected by the element. |
|
|