com.opensymphony.util
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 EJBObject |
findEntity(EJBHome home,
int id)
|
static EJBObject |
findEntity(EJBHome home,
long id)
|
static EJBObject |
findEntity(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
RemoteExceptionInitialContextpublic static final Object createStateless(String location) throws Throwable
Throwablepublic static final EJBObject findEntity(EJBHome home, String id) throws RemoteException, 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.
FinderException - Rethrown if thrown by finder method.public static final EJBObject findEntity(EJBHome home, int id) throws RemoteException, FinderException
RemoteException
FinderExceptionfindEntity(javax.ejb.EJBHome, String)public static final EJBObject findEntity(EJBHome home, long id) throws RemoteException, FinderException
RemoteException
FinderExceptionfindEntity(javax.ejb.EJBHome, String)public static final Object lookup(String location, Class classType) throws NamingException, RemoteException
NamingException
RemoteExceptionlookup(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
RemoteExceptionpublic 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 | |||||||||