Examples of EJBObject


Examples of javax.ejb.EJBObject

      {
         // object has no identity
         if(id == null)
            return false;
        
         EJBObject bean = (EJBObject) args[0];

         Object primaryKey = bean.getPrimaryKey();
         if(primaryKey == null)
            return false;

         boolean isIdentical = id.equals(primaryKey);
View Full Code Here

Examples of javax.ejb.EJBObject

      {
         // object has no identity
         if(id == null)
            return false;
        
         EJBObject bean = (EJBObject) args[0];

         Object primaryKey = bean.getPrimaryKey();
         if(primaryKey == null)
            return false;

         boolean isIdentical = id.equals(primaryKey);
View Full Code Here

Examples of javax.ejb.EJBObject

      {
         return id;
      }
      else if (unadvisedMethod.getName().equals("isIdentical"))
      {
         EJBObject bean = (EJBObject) args[0];

         Object primaryKey = bean.getPrimaryKey();

         boolean isIdentical = id.equals(primaryKey);

         return isIdentical;
      }
View Full Code Here

Examples of javax.ejb.EJBObject

         // Lookup the Proxy Factory in the Object Store
         StatefulSessionProxyFactory proxyFactory = Ejb3RegistrarLocator.locateRegistrar().lookup(proxyFactoryKey,
               StatefulSessionProxyFactory.class);

         // Create a new EJB2.x Proxy
         EJBObject proxy = (EJBObject) proxyFactory.createProxyEjb2x((Serializable) newStatefulInvocation.getId());

         StatefulHandleRemoteImpl handle = new StatefulHandleRemoteImpl(proxy);
         InvocationResponse response = marshallResponse(statefulInvocation, handle, null);
         return response;
      }

      // SFSB remove()
      else if (unadvisedMethod.getName().equals(Ejb2xMethodNames.METHOD_NAME_HOME_REMOVE))
      {
         try
         {
            // Attempt to remove the bean
            destroySession(statefulInvocation.getId());
         }
         catch (NoSuchEJBException e)
         {
            String invokingClassName = method.getActualClassName();
            Throwable newException = this.constructProperNoSuchEjbException(e, invokingClassName);
            throw newException;
         }

         InvocationResponse response = new InvocationResponse(null);
         return response;
      }
      else if (unadvisedMethod.getName().equals("getEJBHome"))
      {
         HomeHandleImpl homeHandle = null;

         RemoteBinding remoteBindingAnnotation = this.getAnnotation(RemoteBinding.class);
         if (remoteBindingAnnotation != null)
            homeHandle = new HomeHandleImpl(ProxyFactoryHelper.getHomeJndiName(this));

         EJBHome ejbHome = homeHandle.getEJBHome();

         InvocationResponse response = marshallResponse(statefulInvocation, ejbHome, null);
         return response;
      }
      else if (unadvisedMethod.getName().equals("getPrimaryKey"))
      {
         Object id = statefulInvocation.getId();

         InvocationResponse response = marshallResponse(statefulInvocation, id, null);
         return response;
      }
      else if (unadvisedMethod.getName().equals("isIdentical"))
      {
         Object id = statefulInvocation.getId();
         EJBObject bean = (EJBObject) statefulInvocation.getArguments()[0];

         Object primaryKey = bean.getPrimaryKey();

         boolean isIdentical = id.equals(primaryKey);

         InvocationResponse response = marshallResponse(statefulInvocation, isIdentical, null);
         return response;
View Full Code Here

Examples of javax.ejb.EJBObject

   @Override
   public EJBObject getEJBObject() throws IllegalStateException
   {
      try
      {
         EJBObject proxy = (EJBObject) container.createProxyRemoteEjb21();
         return proxy;
      }
      catch (Exception e)
      {
         throw new IllegalStateException(e);
View Full Code Here

Examples of javax.ejb.EJBObject

         // Lookup the Proxy Factory in the Object Store
         StatelessSessionProxyFactoryBase proxyFactory = Ejb3RegistrarLocator.locateRegistrar().lookup(proxyFactoryKey,
               StatelessSessionProxyFactoryBase.class);

         // Create a new EJB2.x Proxy
         EJBObject proxy = (EJBObject) proxyFactory.createProxyEjb2x();

         // Create a Handle
         StatelessHandleRemoteImpl handle = new StatelessHandleRemoteImpl(proxy);

         // Return
View Full Code Here

Examples of javax.ejb.EJBObject

    // Test handle methods
    //
    public void test01_getEJBObject(){

        try{
            EJBObject object = ejbHandle.getEJBObject();
            assertNotNull( "The EJBObject is null", object );
            // Wait until isIdentical is working.
            //assertTrue("EJBObjects are not identical", object.isIdentical(ejbObject));
        } catch (Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
View Full Code Here

Examples of javax.ejb.EJBObject

    // Test handle methods
    //
    public void test01_getEJBObject(){

        try{
            EJBObject object = ejbHandle.getEJBObject();
            assertNotNull( "The EJBObject is null", object );
            assertTrue("EJBObjects are not identical", object.isIdentical(ejbObject));
        } catch (Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
        }
    }
View Full Code Here

Examples of javax.ejb.EJBObject

        delegate.writeEJBObject(getEJBObject(), oostream);
    }

    private void readObject(ObjectInputStream oistream) throws IOException, ClassNotFoundException {
        HandleDelegate delegate = HandleDelegateImpl.getDelegate();
        EJBObject obj = delegate.readEJBObject(oistream);
        this.ior = CorbaORBService.getCurrent().object_to_string((org.omg.CORBA.Object) obj);
        this.stubClass = obj.getClass();
    }
View Full Code Here

Examples of javax.ejb.EJBObject

                        // 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
                       
                        EJBObject obj = fieldPort.getEjbObject();
                        Trc.event(
                            this,
                            "Invoking EJB method ",
                            methods[a],
                            " object ",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.