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

         // 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

      {
         // 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

   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

   }
  
   @Override
   protected StatefulHandleRemoteImpl createHandle()
   {
      EJBObject proxy = this.createProxyEjb21(null);
      return this.createHandle(proxy);
   }
View Full Code Here

Examples of javax.ejb.EJBObject

   }
  
   @Override
   public final StatelessHandleRemoteImpl createHandle()
   {
      EJBObject proxy = this.createProxyEjb21(null);
      StatelessHandleRemoteImpl handle = new StatelessHandleRemoteImpl(proxy);
      return handle;
   }
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

         StatefulContainerInvocation newStatefulInvocation = buildInvocation(
                 info, statefulInvocation);

         ProxyFactory proxyFactory = this.getProxyFactory(this.getAnnotation(RemoteBinding.class));
         BaseStatefulRemoteProxyFactory statefulRemoteProxyFactory = (BaseStatefulRemoteProxyFactory) proxyFactory;
         EJBObject proxy = (EJBObject) statefulRemoteProxyFactory.createProxyEjb21(newStatefulInvocation.getId(), null);
         StatefulHandleRemoteImpl handle = new StatefulHandleRemoteImpl(proxy);
         InvocationResponse response = marshallResponse(statefulInvocation, handle, null);
         return response;
      }
      else if (unadvisedMethod.getName().equals("remove"))
      {
         try
         {
            destroySession(statefulInvocation.getId());
         }
         catch(NoSuchEJBException e)
         {
            if(log.isTraceEnabled())
               log.trace("Throwing " + e.getClass().getName(), e);
            throw new NoSuchObjectException(e.getMessage());
         }

         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

   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
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.