|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.util.EJBUtils
Utilities for Enterprise JavaBeans (and JNDI). This is a class contains static methods only and is not meant to be instantiated.
Constructor Summary | |
EJBUtils()
|
Method Summary | |
static Object |
createStateless(String location)
Method to lookup a stateless session EJB's home interface, and create an instance using the create() method. |
static javax.ejb.EJBObject |
findEntity(javax.ejb.EJBHome home,
int id)
|
static javax.ejb.EJBObject |
findEntity(javax.ejb.EJBHome home,
long id)
|
static javax.ejb.EJBObject |
findEntity(javax.ejb.EJBHome home,
String id)
Utility method for attempting to find a specific entity bean given it's home interface and primary key. |
static Context |
getRoot()
Get root naming context (InitialContext). |
static Object |
lookup(String location)
Utility method for looking up an Object via JNDI. |
static Object |
lookup(String location,
Class classType)
Utility method for looking up and narrowing an Object via JNDI. |
static Object |
narrow(Object o,
Class classType)
Utility method for narrowing portable object to a class |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EJBUtils()
Method Detail |
public static final Context getRoot() throws NamingException, RemoteException
NamingException
RemoteException
InitialContext
public static final Object createStateless(String location) throws Throwable
Throwable
public static final javax.ejb.EJBObject findEntity(javax.ejb.EJBHome home, String id) throws RemoteException, javax.ejb.FinderException
Attempts to call the following methods in order:
home.findByPrimaryKey(int id); home.findByPrimaryKey(long id); home.findByPrimaryKey(Integer id); home.findByPrimaryKey(Long id); home.findByPrimaryKey(String id);
home
- Reference to entity home interface.id
- Value of primary key.
EJBObject
to be casted to desired type.
RemoteException
- Rethrown if thrown by finder method.
javax.ejb.FinderException
- Rethrown if thrown by finder method.public static final javax.ejb.EJBObject findEntity(javax.ejb.EJBHome home, int id) throws RemoteException, javax.ejb.FinderException
RemoteException
javax.ejb.FinderException
findEntity(javax.ejb.EJBHome, String)
public static final javax.ejb.EJBObject findEntity(javax.ejb.EJBHome home, long id) throws RemoteException, javax.ejb.FinderException
RemoteException
javax.ejb.FinderException
findEntity(javax.ejb.EJBHome, String)
public static final Object lookup(String location, Class classType) throws NamingException, RemoteException
NamingException
RemoteException
lookup(String)
,
narrow(Object, Class)
public static final Object lookup(String location) throws NamingException, RemoteException
java:comp/env/
to location
. If that is not found, it retries without the prefix.
location
- JNDI location
NamingException
RemoteException
public static final Object narrow(Object o, Class classType)
|
OSCore Project Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |