|
|||||||||||
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 java.lang.Object |
createStateless(java.lang.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,
java.lang.String id)
Utility method for attempting to find a specific entity bean given it's home interface and primary key. |
static javax.naming.Context |
getRoot()
Get root naming context (InitialContext). |
static java.lang.Object |
lookup(java.lang.String location)
Utility method for looking up an Object via JNDI. |
static java.lang.Object |
lookup(java.lang.String location,
java.lang.Class classType)
Utility method for looking up and narrowing an Object via JNDI. |
static java.lang.Object |
narrow(java.lang.Object o,
java.lang.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 javax.naming.Context getRoot() throws javax.naming.NamingException, java.rmi.RemoteException
javax.naming.NamingException
java.rmi.RemoteException
InitialContext
public static final java.lang.Object createStateless(java.lang.String location) throws java.lang.Throwable
java.lang.Throwable
public static final javax.ejb.EJBObject findEntity(javax.ejb.EJBHome home, java.lang.String id) throws java.rmi.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.
java.rmi.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 java.rmi.RemoteException, javax.ejb.FinderException
java.rmi.RemoteException
javax.ejb.FinderException
findEntity(javax.ejb.EJBHome, String)
public static final javax.ejb.EJBObject findEntity(javax.ejb.EJBHome home, long id) throws java.rmi.RemoteException, javax.ejb.FinderException
java.rmi.RemoteException
javax.ejb.FinderException
findEntity(javax.ejb.EJBHome, String)
public static final java.lang.Object lookup(java.lang.String location, java.lang.Class classType) throws javax.naming.NamingException, java.rmi.RemoteException
javax.naming.NamingException
java.rmi.RemoteException
lookup(String)
,
narrow(Object, Class)
public static final java.lang.Object lookup(java.lang.String location) throws javax.naming.NamingException, java.rmi.RemoteException
java:comp/env/
to location
. If that is not found, it retries without the prefix.
location
- JNDI location
javax.naming.NamingException
java.rmi.RemoteException
public static final java.lang.Object narrow(java.lang.Object o, java.lang.Class classType)
|
See www.opensymphony.com for more information. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |