Package javax.ejb

Examples of javax.ejb.EJBHome


    }

    public void testRemoteInterface() throws Exception {

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


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

            Object testObject = testObjectClass.newInstance();

            InitialContext ctx = new InitialContext();
            EJBHome rawHome = (EJBHome) ctx.lookup("WidgetBeanRemoteHome");
            ;
            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

        }
    }

    public void test03_getEjbHome(){
        try{
            EJBHome home = ejbObject.getEJBHome();
            assertNotNull( "The EJBHome is null", home );
        } catch (Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
        }
    }
View Full Code Here

        delegate.writeEJBHome(getEJBHome(), oostream);
    }

    private void readObject(final ObjectInputStream oistream) throws IOException, ClassNotFoundException {
        final HandleDelegate delegate = HandleDelegateImpl.getDelegate();
        final EJBHome obj = delegate.readEJBHome(oistream);
        this.ior = CorbaORBService.getCurrent().object_to_string((org.omg.CORBA.Object) obj);
        this.stubClass = obj.getClass();
    }
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 {
            EJBHome home = ejbObject.getEJBHome();
            assertNotNull("The EJBHome is null", home);
        } catch (Exception e) {
            fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    }
View Full Code Here

    }

    public void testRemoteInterface() throws Exception {

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

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

            Object testObject = testObjectClass.newInstance();

            InitialContext ctx = new InitialContext();
            EJBHome rawHome = (EJBHome) ctx.lookup("WidgetBeanRemoteHome");
           
            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

                        // If we didn't get any arguments then the parts aren't compatible with the ctor
                        if (compatibleArguments == null)
                            break;
                        // Parts are compatible so invoke the ctor with the compatible set

                        EJBHome home = fieldPort.getEjbHome();
                        Trc.event(
                            this,
                            "Invoking EJB method ",
                            methods[a],
                            " home ",
View Full Code Here

                        // If we didn't get any arguments then the parts aren't compatible with the ctor
                        if (compatibleArguments == null)
                            break;
                        // Parts are compatible so invoke the ctor with the compatible set
                       
                        EJBHome home = fieldPort.getEjbHome();
                        Trc.event(
                            this,
                            "Invoking EJB method ",
                            methods[a],
                            " home ",
View Full Code Here

    public EJBObject getEjbObject() throws WSIFException {
        Trc.entry(this);

        if (fieldEjbObject == null) {
            EJBHome ejbHome = getEjbHome();
            try {
                Method createMethod = ejbHome.getClass().getDeclaredMethod("create", null);
                fieldEjbObject = (EJBObject) createMethod.invoke(ejbHome, null);
            } catch (Exception ex) {
              Trc.exception(ex);
                throw new WSIFException(
                    "Could not create instance for home '" + ejbHome + "'",
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.