Package javax.ejb

Examples of javax.ejb.EJBHome


    //=================================
    // Test home handle methods
    //
    public void test01_getEJBHome(){
        try{
            final EJBHome home = ejbHomeHandle.getEJBHome();
            assertNotNull( "The EJBHome is null", home );
        } catch (final Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
        }
    }
View Full Code Here


    /**
     * A method to test retrieving the EJBHome interface of a session bean using its EJBObject reference.
     */
    public void test01_getEjbHome() {
        try {
            final EJBHome home = ejbObject.getEJBHome();
            assertNotNull("The EJBHome is null", home);
        } catch (final Exception e) {
            fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    }
View Full Code Here

    }

    public void testRemoteInterface() throws Exception {

        final InitialContext ctx = new InitialContext();
        final EJBHome home = (EJBHome) ctx.lookup("WidgetBeanRemoteHome");
        assertNotNull("home", home);
        assertTrue("home should be an instance of WidgetHome", home instanceof WidgetHome);
        CrossClassLoaderProxyTestObject.widgetHome = (WidgetHome) home;
        final CrossClassLoaderProxyTestObject proxyTestObject = new CrossClassLoaderProxyTestObject();
        proxyTestObject.testRemoteInterface();
View Full Code Here

            assertFalse(WidgetRemote.class.equals(widgetRemoteClass));

            final Object testObject = testObjectClass.newInstance();

            final InitialContext ctx = new InitialContext();
            final EJBHome rawHome = (EJBHome) ctx.lookup("WidgetBeanRemoteHome");

            final EJBHome home = (EJBHome) copy(rawHome);
            assertNotNull("home", home);
            assertEquals(widgetHomeClass.getClassLoader(), home.getClass().getClassLoader());
            assertTrue(widgetHomeClass.isAssignableFrom(home.getClass()));

            testObjectClass.getField("widgetHome").set(testObject, home);

            testObjectClass.getMethod("testRemoteInterface").invoke(testObject);
        } finally {
View Full Code Here

        Class[] proxyInterfaces = (Class [])
            proxyInterfacesSet.toArray(new Class[proxyInterfacesSet.size()]);

        try {
            EJBHome ejbHomeProxy = (EJBHome) Proxy.newProxyInstance(loader, proxyInterfaces, handler);
            handler.setProxy(ejbHomeProxy);
        } catch (ClassCastException e) {
            String msg = localStrings.getLocalString("ejb.basecontainer_invalid_home_interface",
                    "Home interface [{0}] is invalid since it does not extend javax.ejb.EJBHome.", homeIntf);
            throw new IllegalArgumentException(msg, e);
View Full Code Here

        EJBHomeInvocationHandler handler = getEJBHomeInvocationHandler(remoteBusinessHomeIntf);
        handler.setMethodMap(proxyInvocationInfoMap);

        EJBHomeImpl remoteBusinessHomeImpl = handler;

        EJBHome ejbRemoteBusinessHomeProxy = (EJBHome)
            Proxy.newProxyInstance(loader,
                                   new Class[] { remoteBusinessHomeIntf },
                                   handler);
       
        handler.setProxy(ejbRemoteBusinessHomeProxy);
View Full Code Here

                if (ejbContext == null) {
                    Message mg = new Message("Can't get InitialContext", LOG);
                    throw new BusException(mg);
                }

                EJBHome home = getEJBHome(ejbContext, jndiLookup);

//                 ejbHomeClassLoader = home.getClass().getClassLoader();

                Method createMethod = home.getClass().getMethod("create", new Class[0]);

                ejb = (EJBObject) createMethod.invoke(home, new Object[0]);
               
            } catch (NamingException e) {
                throw new BusException(e);
View Full Code Here

        return serverFactory.create();
    }
  
    private EJBObject getEJBObject(String jndi) throws BusException {
        try {
            EJBHome home = getEJBHome(jndiContext, jndi);

//      ejbHomeClassLoader = home.getClass().getClassLoader();

            Method createMethod = home.getClass().getMethod("create", new Class[0]);

            return (EJBObject) createMethod.invoke(home, new Object[0]);
        } catch (NamingException e) {
            throw new BusException(e);
        } catch (NoSuchMethodException e) {
View Full Code Here

                ServantObject so = _servant_preinvoke("_get_EJBHome",javax.ejb.EJBObject.class);
                if (so == null) {
                    continue;
                }
                try {
                    EJBHome result = ((javax.ejb.EJBObject)so.servant).getEJBHome();
                    return (EJBHome)Util.copyObject(result,_orb());
                } catch (Throwable ex) {
                    Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
                    throw Util.wrapException(exCopy);
                } finally {
View Full Code Here

                ServantObject so = _servant_preinvoke("_get_EJBHome",javax.ejb.HomeHandle.class);
                if (so == null) {
                    continue;
                }
                try {
                    EJBHome result = ((javax.ejb.HomeHandle)so.servant).getEJBHome();
                    return (EJBHome)Util.copyObject(result,_orb());
                } catch (Throwable ex) {
                    Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
                    throw Util.wrapException(exCopy);
                } finally {
View Full Code Here

TOP

Related Classes of javax.ejb.EJBHome

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.