/** * 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(); } }
/** * 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 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); }
/** * 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); }