Package javax.ejb

Examples of javax.ejb.HomeHandle


         getLog().debug("Create a bean...");
         bean = doEjbCreate(pk, BEAN_NAME);
         getLog().debug("OK");

         getLog().debug("Get HomeHandle..." );
         HomeHandle homeHan = home.getHomeHandle();
         assertTrue(homeHan != null);  
         getLog().debug("OK");

         getLog().debug("Get another home from the HomeHandle...");
         CtsBmpHome anotherHome = (CtsBmpHome)homeHan.getEJBHome();
         assertTrue(anotherHome != null);
         getLog().debug("OK");

         getLog().debug("Get the Meta-data object...");
         EJBMetaData md = anotherHome.getEJBMetaData();
View Full Code Here


        assertTrue("metaData.getEJBHome() should be an instance of WidgetHome", metaData.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);
        assertEquals(CrossClassLoaderProxyTest.WidgetHome.class, metaData.getHomeInterfaceClass());
        assertEquals(CrossClassLoaderProxyTest.WidgetRemote.class, metaData.getRemoteInterfaceClass());

        // verify home handle
        HomeHandle homeHandle = widgetHome.getHomeHandle();
        assertTrue("homeHandle.getEJBHome() should be an instance of WidgetHome", homeHandle.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);

        // verify ejb object getHome
        assertTrue("widget.getEJBHome() should be an instance of WidgetHome", widget.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);

        // verify ejb object handle
View Full Code Here

    }

    public javax.ejb.HomeHandle getHomeHandle(ProxyInfo proxyInfo) {
        org.omg.CORBA.Object ejbHome = (org.omg.CORBA.Object) getEJBHome(proxyInfo);
        String ior = getOrb().object_to_string(ejbHome);
        HomeHandle homeHandle = new CORBAHomeHandle(ior);
        return homeHandle;
    }
View Full Code Here

  
   @Test
   public void testStatefulGetHomeHandle() throws Exception
   {
      ValueHolderHome home = lookup("ValueHolderBean/home", ValueHolderHome.class);
      HomeHandle handle = home.getHomeHandle();
      assertNotNull("handle is null", handle);
      ValueHolderHome otherHome = (ValueHolderHome) handle.getEJBHome();
      exercise(otherHome);
   }
View Full Code Here

  
   @Test
   public void testStatelessGetHomeHandle() throws Exception
   {
      GreeterHome home = lookup("GreeterBean/home", GreeterHome.class);
      HomeHandle handle = home.getHomeHandle();
      assertNotNull("handle is null", handle);
      GreeterHome otherHome = (GreeterHome) handle.getEJBHome();
      exercise(otherHome);
   }
View Full Code Here

    public String getRemoteMessage() throws RemoteException {
        return home.create().hello();
    }

    public String getRemoteViaHomeHandleMessage() throws RemoteException {
        final HomeHandle handle = home.getHomeHandle();
        final IIOPBasicHome newHome = (IIOPBasicHome) PortableRemoteObject.narrow(handle.getEJBHome(), IIOPBasicHome.class);
        final IIOPBasicRemote object = newHome.create();
        return object.hello();
    }
View Full Code Here

    }

    public javax.ejb.HomeHandle getHomeHandle(ProxyInfo proxyInfo) {
        org.omg.CORBA.Object ejbHome = (org.omg.CORBA.Object) getEJBHome(proxyInfo);
        String ior = getOrb().object_to_string(ejbHome);
        HomeHandle homeHandle = new CORBAHomeHandle(ior);
        return homeHandle;
    }
View Full Code Here

        assertTrue("metaData.getEJBHome() should be an instance of WidgetHome", metaData.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);
        assertEquals(CrossClassLoaderProxyTest.WidgetHome.class, metaData.getHomeInterfaceClass());
        assertEquals(CrossClassLoaderProxyTest.WidgetRemote.class, metaData.getRemoteInterfaceClass());

        // verify home handle
        HomeHandle homeHandle = widgetHome.getHomeHandle();
        assertTrue("homeHandle.getEJBHome() should be an instance of WidgetHome", homeHandle.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);

        // verify ejb object getHome
        assertTrue("widget.getEJBHome() should be an instance of WidgetHome", widget.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);

        // verify ejb object handle
View Full Code Here

        assertTrue("metaData.getEJBHome() should be an instance of WidgetHome", metaData.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);
        assertEquals(CrossClassLoaderProxyTest.WidgetHome.class, metaData.getHomeInterfaceClass());
        assertEquals(CrossClassLoaderProxyTest.WidgetRemote.class, metaData.getRemoteInterfaceClass());

        // verify home handle
        HomeHandle homeHandle = widgetHome.getHomeHandle();
        assertTrue("homeHandle.getEJBHome() should be an instance of WidgetHome", homeHandle.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);

        // verify ejb object getHome
        assertTrue("widget.getEJBHome() should be an instance of WidgetHome", widget.getEJBHome() instanceof CrossClassLoaderProxyTest.WidgetHome);

        // verify ejb object handle
View Full Code Here

      }

      System.out.println("Testing serialization of Home handle");

      // Serialize the HomeHandle for the cabin bean.
      HomeHandle homeHandle = home.getHomeHandle();
      fos = new FileOutputStream("handle.ser");
      outStream = new ObjectOutputStream(fos);
      System.out.println("Writing Home handle to file...");
      outStream.writeObject(homeHandle);
      outStream.flush();
      fos.close();
      homeHandle = null;

      // Deserialize the HomeHandle for the cabin bean.
      fis = new FileInputStream("handle.ser");
      inStream = new ObjectInputStream(fis);
      System.out.println("Reading Home handle from file...");
      homeHandle = (HomeHandle)inStream.readObject();
      fis.close();

      System.out.println("Acquiring reference using deserialized Home handle...");
      Object hometemp = homeHandle.getEJBHome();
      CabinHomeRemote home2 = (CabinHomeRemote)
        PortableRemoteObject.narrow(hometemp,CabinHomeRemote.class);


      System.out.println("Acquiring reference to bean using new Home interface...");
View Full Code Here

TOP

Related Classes of javax.ejb.HomeHandle

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.