Package javax.ejb

Examples of javax.ejb.Handle


            assertNotNull("The EJBHome returned from JNDI is null", home);

            EncStatelessObject object = home.create();
            assertNotNull("The EJBObject created is null", object);

            Handle expected[] = new Handle[3];
            for (int i=0; i < expected.length; i++){
                expected[i] = object.getHandle();
                assertNotNull("The EJBObject Handle returned is null", expected[i]);
            }
View Full Code Here


            throw new org.omg.CORBA.MARSHAL(e.getClass().getName() + " thrown while marshaling the reply: " + e.getMessage(), 0, org.omg.CORBA.CompletionStatus.COMPLETED_YES);
        }
    }

    public javax.ejb.Handle getHandle(ProxyInfo proxyInfo) {
        Handle handle = new CORBAHandle(getEJBObject(proxyInfo), proxyInfo.getPrimaryKey());
        return handle;
    }
View Full Code Here


    public String getRemoteViaHandleMessage() throws RemoteException {

        final IIOPBasicRemote object = home.create();
        final Handle handle = object.getHandle();
        final IIOPBasicRemote newObject = (IIOPBasicRemote) PortableRemoteObject.narrow(handle.getEJBObject(), IIOPBasicRemote.class);
        return newObject.hello();
    }
View Full Code Here

    }

    public String getRemoteViaWrappedHandle() throws RemoteException {

        final IIOPBasicRemote object = home.create();
        final Handle handle = object.wrappedHandle().getHandle();
        Assert.assertEquals(HandleImplIIOP.class, handle.getClass());
        final IIOPBasicRemote newObject = (IIOPBasicRemote) PortableRemoteObject.narrow(handle.getEJBObject(), IIOPBasicRemote.class);
        return newObject.hello();
    }
View Full Code Here

    private final Interceptor interceptor;

    private EntityBeanHomeRemoveByHandleInterceptorFactory() {
        interceptor = new Interceptor() {
            public Object processInvocation(final InterceptorContext interceptorContext) throws Exception {
                final Handle handle = (Handle) interceptorContext.getParameters()[0];
                handle.getEJBObject().remove();
                return null;
            }
        };
    }
View Full Code Here

            throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(e.getClass().getName() + " thrown while marshaling the reply: " + e.getMessage(), 0, org.omg.CORBA.CompletionStatus.COMPLETED_YES).initCause(e);
        }
    }

    public javax.ejb.Handle getHandle(ProxyInfo proxyInfo) {
        Handle handle = new CORBAHandle(getEJBObject(proxyInfo), proxyInfo.getPrimaryKey());
        return handle;
    }
View Full Code Here

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

        // verify ejb object handle
        Handle objectHandle = widget.getHandle();
        assertTrue("objectHandle.getEJBObject() should be an instance of WidgetHome", objectHandle.getEJBObject() instanceof CrossClassLoaderProxyTest.WidgetRemote);
    }
View Full Code Here

    private HomeRemoveInterceptor() {
    }

    @Override
    public Object processInvocation(final InterceptorContext context) throws Exception {
        final Handle handle = (Handle) context.getParameters()[0];
        handle.getEJBObject().remove();
        return null;
    }
View Full Code Here

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

        // verify ejb object handle
        Handle objectHandle = widget.getHandle();
        assertTrue("objectHandle.getEJBObject() should be an instance of WidgetHome", objectHandle.getEJBObject() instanceof CrossClassLoaderProxyTest.WidgetRemote);
    }
View Full Code Here

      Integer pk_1 = new Integer(100);
      CabinRemote cabin_1 = home.findByPrimaryKey(pk_1);

      // Serialize the Handle for cabin 100 to a file.
      Handle handle = cabin_1.getHandle();
      FileOutputStream fos = new FileOutputStream("handle100.ser");
      ObjectOutputStream outStream = new ObjectOutputStream(fos);
      System.out.println("Writing handle to file...");
      outStream.writeObject(handle);
      outStream.flush();
      fos.close();
      handle = null;

      // Deserialize the Handle for cabin 100.
      FileInputStream fis = new FileInputStream("handle100.ser");
      ObjectInputStream inStream = new ObjectInputStream(fis);
      System.out.println("Reading handle from file...");
      handle = (Handle)inStream.readObject();
      fis.close();

      // Reobtain a remote reference to cabin 100 and read its name.
      System.out.println("Acquiring reference using deserialized handle...");
      ref = handle.getEJBObject();
      CabinRemote cabin_2 = (CabinRemote)
        PortableRemoteObject.narrow(ref, CabinRemote.class);

      if(cabin_1.isIdentical(cabin_2)) {
        System.out.println("cabin_1.isIdentical(cabin_2) returns true - This is correct");
View Full Code Here

TOP

Related Classes of javax.ejb.Handle

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.