Examples of StatefulSessionContainerMethodInvocation


Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

            }
           
            SerializableMethod invoked = new SerializableMethod(method, method.getClass());
           
            //StatefulContainerInvocation nextInvocation = new StatefulContainerInvocation(info, id);
            StatefulSessionContainerMethodInvocation nextInvocation = new StatefulSessionContainerMethodInvocation(info);
            nextInvocation.setSessionId(id);
            nextInvocation.setAdvisor(getAdvisor());
            nextInvocation.setArguments(args);
           
            ProxyUtils.addLocalAsynchronousInfo(nextInvocation, provider);
           
            //invokedMethod.push(invoked);
            return nextInvocation.invokeNext();
         }
         finally
         {
            if (unadvisedMethod != null)
            {
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

         {
            initParameterTypes = unadvisedMethod.getParameterTypes();
            initParameterValues = statefulInvocation.getArguments();
         }

         StatefulSessionContainerMethodInvocation newStatefulInvocation = buildNewInvocation(
                 info, statefulInvocation, initParameterTypes,
                 initParameterValues);

         // Get JNDI Registrar
         JndiSessionRegistrarBase sfsbJndiRegistrar = this.getJndiRegistrar();
        
         // Determine if local/remote
         boolean isLocal = EJBLocalObject.class.isAssignableFrom(unadvisedMethod.getDeclaringClass());
        
         // Find the Proxy Factory Key for this SFSB
         String proxyFactoryKey = sfsbJndiRegistrar.getProxyFactoryRegistryKey(this.getMetaData(), isLocal);

         // Lookup the Proxy Factory in the Object Store
         StatefulSessionProxyFactory proxyFactory = Ejb3RegistrarLocator.locateRegistrar().lookup(proxyFactoryKey,
               StatefulSessionProxyFactory.class);
        
         // Create a new EJB2.x Proxy
         Object proxy = proxyFactory.createProxyEjb2x((Serializable)newStatefulInvocation.getSessionId());
        
         InvocationResponse response = marshallResponse(statefulInvocation, proxy, newStatefulInvocation.getResponseContextInfo());
         if (newStatefulInvocation.getSessionId() != null)
            response.addAttachment(StatefulConstants.NEW_ID,
                    newStatefulInvocation.getSessionId());
         return response;
      }
      else if (unadvisedMethod.getName().equals("remove"))
      {
         Object argument = statefulInvocation.getArguments()[0];
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

   private StatefulSessionContainerMethodInvocation buildNewInvocation(MethodInfo info,
         StatefulRemoteInvocation statefulInvocation, Class<?>[] initParameterTypes,
         Object[] initParameterValues)
   {
      StatefulSessionContainerMethodInvocation newStatefulInvocation = null;

      StatefulBeanContext ctx = null;
      if (initParameterTypes.length > 0)
         ctx = getCache().create(initParameterTypes, initParameterValues);
      else
         ctx = getCache().create(null, null);

      Object newId = ctx.getId();
      newStatefulInvocation = new StatefulSessionContainerMethodInvocation(info);
      newStatefulInvocation.setSessionId(newId);

      newStatefulInvocation.setArguments(statefulInvocation.getArguments());
      newStatefulInvocation.setMetaData(statefulInvocation.getMetaData());
      newStatefulInvocation.setAdvisor(getAdvisor());
     
      SerializableMethod invokedMethod = new SerializableMethod(info.getUnadvisedMethod());
      newStatefulInvocation.getMetaData().addMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION,
            SessionSpecRemotingMetadata.KEY_INVOKED_METHOD, invokedMethod, PayloadKey.AS_IS);

      return newStatefulInvocation;
   }
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

            }
           
            SerializableMethod invoked = new SerializableMethod(method, method.getClass());
           
            //StatefulContainerInvocation nextInvocation = new StatefulContainerInvocation(info, id);
            StatefulSessionContainerMethodInvocation nextInvocation = new StatefulSessionContainerMethodInvocation(info);
            nextInvocation.setSessionId(id);
            nextInvocation.setAdvisor(getAdvisor());
            nextInvocation.setArguments(args);
           
            ProxyUtils.addLocalAsynchronousInfo(nextInvocation, provider);
           
            //invokedMethod.push(invoked);
            return nextInvocation.invokeNext();
         }
         finally
         {
            if (unadvisedMethod != null)
            {
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

         if (bindings != null)
            binding = bindings.value()[0];
         else
            binding = this.getAnnotation(RemoteBinding.class);

         StatefulSessionContainerMethodInvocation newStatefulInvocation = buildNewInvocation(
                 info, statefulInvocation, initParameterTypes,
                 initParameterValues);

         StatefulRemoteProxyFactory factory = new StatefulRemoteProxyFactory(this, binding);
         factory.init();

         Object proxy = null;
         String businessInterfaceType = unadvisedMethod.getReturnType().getName();
         if (newStatefulInvocation.getSessionId() != null)
            proxy = factory.createProxyEjb21(newStatefulInvocation.getSessionId(), businessInterfaceType);
         else
            proxy = factory.createProxyEjb21(businessInterfaceType);

         InvocationResponse response = marshallResponse(statefulInvocation, proxy, newStatefulInvocation.getResponseContextInfo());
         if (newStatefulInvocation.getSessionId() != null)
            response.addAttachment(StatefulConstants.NEW_ID,
                    newStatefulInvocation.getSessionId());
         return response;
      }
      else if (unadvisedMethod.getName().equals("remove"))
      {
         remove(statefulInvocation.getArguments()[0]);
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

   private StatefulSessionContainerMethodInvocation buildNewInvocation(MethodInfo info,
         StatefulRemoteInvocation statefulInvocation, Class<?>[] initParameterTypes,
         Object[] initParameterValues)
   {
      StatefulSessionContainerMethodInvocation newStatefulInvocation = null;

      StatefulBeanContext ctx = null;
      if (initParameterTypes.length > 0)
         ctx = getCache().create(initParameterTypes, initParameterValues);
      else
         ctx = getCache().create(null, null);

      Object newId = ctx.getId();
      newStatefulInvocation = new StatefulSessionContainerMethodInvocation(info);
      newStatefulInvocation.setSessionId(newId);

      newStatefulInvocation.setArguments(statefulInvocation.getArguments());
      newStatefulInvocation.setMetaData(statefulInvocation.getMetaData());
      newStatefulInvocation.setAdvisor(getAdvisor());

      return newStatefulInvocation;
   }
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

   }

   private StatefulSessionContainerMethodInvocation _buildNewInvocation(MethodInfo info,
         StatefulRemoteInvocation statefulInvocation, Class<?>[] initParameterTypes, Object[] initParameterValues)
   {
      StatefulSessionContainerMethodInvocation newStatefulInvocation = null;

      StatefulBeanContext ctx = null;

      // ENC is required in scope to create a session
      this.pushEnc();

      try
      {
         ctx = getCache().create(initParameterTypes, initParameterValues);
      }
      finally
      {
         // Pop the ENC off the stack
         this.popEnc();
      }

      Object newId = ctx.getId();
      newStatefulInvocation = new StatefulSessionContainerMethodInvocation(info);
      newStatefulInvocation.setSessionId(newId);

      newStatefulInvocation.setArguments(statefulInvocation.getArguments());
      newStatefulInvocation.setMetaData(statefulInvocation.getMetaData());
      newStatefulInvocation.setAdvisor(getAdvisor());

      SerializableMethod invokedMethod = new SerializableMethod(info.getUnadvisedMethod());
      newStatefulInvocation.getMetaData().addMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION,
            SessionSpecRemotingMetadata.KEY_INVOKED_METHOD, invokedMethod, PayloadKey.AS_IS);

      return newStatefulInvocation;
   }
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

   }

   private StatefulSessionContainerMethodInvocation _buildNewInvocation(MethodInfo info,
         StatefulRemoteInvocation statefulInvocation, Class<?>[] initParameterTypes, Object[] initParameterValues)
   {
      StatefulSessionContainerMethodInvocation newStatefulInvocation = null;

      StatefulBeanContext ctx = null;

      // ENC is required in scope to create a session
      this.pushEnc();

      try
      {
         ctx = getCache().create(initParameterTypes, initParameterValues);
      }
      finally
      {
         // Pop the ENC off the stack
         this.popEnc();
      }

      Object newId = ctx.getId();
      newStatefulInvocation = new StatefulSessionContainerMethodInvocation(info);
      newStatefulInvocation.setSessionId(newId);

      newStatefulInvocation.setArguments(statefulInvocation.getArguments());
      newStatefulInvocation.setMetaData(statefulInvocation.getMetaData());
      newStatefulInvocation.setAdvisor(getAdvisor());

      SerializableMethod invokedMethod = new SerializableMethod(info.getUnadvisedMethod());
      newStatefulInvocation.getMetaData().addMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION,
            SessionSpecRemotingMetadata.KEY_INVOKED_METHOD, invokedMethod, PayloadKey.AS_IS);

      return newStatefulInvocation;
   }
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

   }

   private StatefulSessionContainerMethodInvocation _buildNewInvocation(MethodInfo info,
         StatefulRemoteInvocation statefulInvocation, Class<?>[] initParameterTypes, Object[] initParameterValues)
   {
      StatefulSessionContainerMethodInvocation newStatefulInvocation = null;

      StatefulBeanContext ctx = null;

      // ENC is required in scope to create a session
      this.pushEnc();

      try
      {
         ctx = getCache().create(initParameterTypes, initParameterValues);
      }
      finally
      {
         // Pop the ENC off the stack
         this.popEnc();
      }

      Object newId = ctx.getId();
      newStatefulInvocation = new StatefulSessionContainerMethodInvocation(info);
      newStatefulInvocation.setSessionId(newId);

      newStatefulInvocation.setArguments(statefulInvocation.getArguments());
      newStatefulInvocation.setMetaData(statefulInvocation.getMetaData());
      newStatefulInvocation.setAdvisor(getAdvisor());

      SerializableMethod invokedMethod = new SerializableMethod(info.getUnadvisedMethod());
      newStatefulInvocation.getMetaData().addMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION,
            SessionSpecRemotingMetadata.KEY_INVOKED_METHOD, invokedMethod, PayloadKey.AS_IS);

      return newStatefulInvocation;
   }
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation

   }

   private StatefulSessionContainerMethodInvocation _buildNewInvocation(MethodInfo info,
         StatefulRemoteInvocation statefulInvocation, Class<?>[] initParameterTypes, Object[] initParameterValues)
   {
      StatefulSessionContainerMethodInvocation newStatefulInvocation = null;

      StatefulBeanContext ctx = null;

      // ENC is required in scope to create a session
      this.pushEnc();

      try
      {
         ctx = getCache().create(initParameterTypes, initParameterValues);
      }
      finally
      {
         // Pop the ENC off the stack
         this.popEnc();
      }

      Object newId = ctx.getId();
      newStatefulInvocation = new StatefulSessionContainerMethodInvocation(info);
      newStatefulInvocation.setSessionId(newId);

      newStatefulInvocation.setArguments(statefulInvocation.getArguments());
      newStatefulInvocation.setMetaData(statefulInvocation.getMetaData());
      newStatefulInvocation.setAdvisor(getAdvisor());

      SerializableMethod invokedMethod = new SerializableMethod(info.getUnadvisedMethod());
      newStatefulInvocation.getMetaData().addMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION,
            SessionSpecRemotingMetadata.KEY_INVOKED_METHOD, invokedMethod, PayloadKey.AS_IS);

      return newStatefulInvocation;
   }
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.