Examples of EJBObject


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

   protected Object invokeEJBObjectMethod(MethodInfo info, MethodInvocation invocation) throws Throwable
   {
      Method unadvisedMethod = info.getUnadvisedMethod();
      if (unadvisedMethod.getName().equals("getHandle"))
      {
         EJBObject proxy;
         if(CurrentRemoteProxyFactory.isSet())
         {
            proxy = CurrentRemoteProxyFactory.get(EJB2RemoteProxyFactory.class).create(null);
         }
         else
View Full Code Here

Examples of javax.ejb.EJBObject

   protected Object invokeEJBObjectMethod(MethodInfo info, MethodInvocation invocation) throws Throwable
   {
      Method unadvisedMethod = info.getUnadvisedMethod();
      if (unadvisedMethod.getName().equals("getHandle"))
      {
         EJBObject proxy;
         if(CurrentRemoteProxyFactory.isSet())
         {
            proxy = CurrentRemoteProxyFactory.get(EJB2RemoteProxyFactory.class).create(null);
         }
         else
View Full Code Here

Examples of javax.ejb.EJBObject

                if (deploymentInfo.getComponentType() == BeanType.STATEFUL) {
                    RegistryId id = (RegistryId)((EjbObjectProxyHandler)ejbProxyHandler).getRegistryId();
                    primaryKey = id.getPrimaryKey();
                }
                else if (deploymentInfo.getComponentType() != BeanType.STATELESS) {
                    EJBObject ejbObject = (EJBObject) proxy;
                    primaryKey = ejbObject.getPrimaryKey();
                }
                return refGenerator.genObjectReference(primaryKey);
            } else {
                log.error("Encountered unknown local invocation handler of type " + proxy.getClass().getSuperclass() + ":" + deploymentId);
                throw new MARSHAL("Internal server error while marshaling the reply", 0, CompletionStatus.COMPLETED_YES);
View Full Code Here

Examples of javax.ejb.EJBObject

                                }
                                Class remoteInterface = ejbDeployment.getRemoteInterface();


                                try {
                                    EJBObject narrowed = (EJBObject)PortableRemoteObject.narrow(handle.getEJBObject(), remoteInterface);
                                    if (narrowed == null) {
                                        throw new RemoteException("Handle does not hold a " + remoteInterface.getName());
                                    }
                                } catch (ClassCastException e) {
                                    throw new RemoteException("Handle does not hold a " + remoteInterface.getName(), e);
View Full Code Here

Examples of javax.ejb.EJBObject

                if (beanContext.getComponentType() == BeanType.STATEFUL) {
                    RegistryId id = (RegistryId)((EjbObjectProxyHandler)ejbProxyHandler).getRegistryId();
                    primaryKey = id.getPrimaryKey();
                }
                else if (beanContext.getComponentType() != BeanType.STATELESS) {
                    EJBObject ejbObject = (EJBObject) proxy;
                    primaryKey = ejbObject.getPrimaryKey();
                }
                return refGenerator.genObjectReference(primaryKey);
            } else {
                log.error("Encountered unknown local invocation handler of type " + proxy.getClass().getSuperclass() + ":" + deploymentId);
                throw new MARSHAL("Internal server error while marshaling the reply", 0, CompletionStatus.COMPLETED_YES);
View Full Code Here

Examples of javax.ejb.EJBObject

public class CorbaApplicationServer implements ApplicationServer {
    public EJBObject getEJBObject(ProxyInfo proxyInfo) {
        try {
            RefGenerator refGenerator = AdapterWrapper.getRefGenerator((String) proxyInfo.getBeanContext().getDeploymentID());
            org.omg.CORBA.Object object = refGenerator.genObjectReference(proxyInfo.getPrimaryKey());
            EJBObject ejbObject = (EJBObject) PortableRemoteObject.narrow(object, EJBObject.class);
            return ejbObject;
        } catch (Throwable e) {
            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);
        }
    }
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
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.