/** * @see #findEntity(javax.ejb.EJBHome, String) */ public final static EJBObject findEntity(EJBHome home, int id) throws RemoteException, FinderException { return findEntity(home, "" + id); }
/** * Utility method for looking up and narrowing an Object via JNDI. Used when using RMI-IIOP. * * @see #lookup(String) * @see #narrow(Object, Class) */ public final static Object lookup(String location, Class classType) throws NamingException, RemoteException { return narrow(lookup(location), classType); }
/** * Method to lookup a stateless session EJB's home interface, and create * an instance using the create() method. Any exceptions thrown by the * create() method shall be rethrown (java.lang.Throwable). */ public final static Object createStateless(String location) throws Throwable { try { Object home = EJBUtils.lookup(location); Method createMethod = home.getClass().getDeclaredMethod("create", null); return createMethod.invoke(home, null); } catch (InvocationTargetException e) { throw e.getTargetException(); } }
/** * Utility method for looking up an Object via JNDI. Prefixes <code>java:comp/env/</code> * to <code>location</code>. If that is not found, it retries without the prefix. * * @param location JNDI location */ public final static Object lookup(String location) throws NamingException, RemoteException { // if already determined that env location should be ignored... NamingException notFoundE = null; if (ignoreEnvLocations.contains(location)) { try { return getRoot().lookup(location); } catch (NamingException e) { // hmmm... maybe it's changed location in the JNDI tree ignoreEnvLocations.remove(location); notFoundE = e; } } try { return getRoot().lookup("java:comp/env/" + location); } catch (NamingException e) { if (notFoundE != null) { throw notFoundE; // throw first exception if it exists } ignoreEnvLocations.add(location); return getRoot().lookup(location); } }
/** * Method to lookup a stateless session EJB's home interface, and create * an instance using the create() method. Any exceptions thrown by the * create() method shall be rethrown (java.lang.Throwable). */ public final static Object createStateless(String location) throws Throwable { try { Object home = EJBUtils.lookup(location); Method createMethod = home.getClass().getDeclaredMethod("create", null); return createMethod.invoke(home, null); } catch (InvocationTargetException e) { throw e.getTargetException(); } }
/** * Utility method for looking up an Object via JNDI. Prefixes <code>java:comp/env/</code> * to <code>location</code>. If that is not found, it retries without the prefix. * * @param location JNDI location */ public final static Object lookup(String location) throws NamingException, RemoteException { // if already determined that env location should be ignored... NamingException notFoundE = null; if (ignoreEnvLocations.contains(location)) { try { return getRoot().lookup(location); } catch (NamingException e) { // hmmm... maybe it's changed location in the JNDI tree ignoreEnvLocations.remove(location); notFoundE = e; } } try { return getRoot().lookup("java:comp/env/" + location); } catch (NamingException e) { if (notFoundE != null) { throw notFoundE; // throw first exception if it exists } ignoreEnvLocations.add(location); return getRoot().lookup(location); } }
/** * Utility method for looking up and narrowing an Object via JNDI. Used when using RMI-IIOP. * * @see #lookup(String) * @see #narrow(Object, Class) */ public final static Object lookup(String location, Class classType) throws NamingException, RemoteException { return narrow(lookup(location), classType); }
/** * @see #findEntity(javax.ejb.EJBHome, String) */ public final static EJBObject findEntity(EJBHome home, int id) throws RemoteException, FinderException { return findEntity(home, "" + id); }
/** * @see #findEntity(javax.ejb.EJBHome, String) */ public final static EJBObject findEntity(EJBHome home, long id) throws RemoteException, FinderException { return findEntity(home, "" + id); }
/** * @see #findEntity(javax.ejb.EJBHome, String) */ public final static EJBObject findEntity(EJBHome home, long id) throws RemoteException, FinderException { return findEntity(home, "" + id); }