Package org.jboss.wsf.spi.invocation

Examples of org.jboss.wsf.spi.invocation.Invocation


   private static final Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
  
   @Override
   protected Invocation setupInvocation(Endpoint ep, EndpointInvocation epInv, InvocationContext invContext) throws Exception
   {
      Invocation inv = super.setupInvocation(ep, epInv, invContext);

      // Attach the handler callback
      ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
      invContext.addAttachment(HandlerCallback.class, new HandlerCallbackImpl(sepMetaData));
View Full Code Here


                  reqMessage = msgContext.getMessageAbstraction();
                  sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
               }

               // Invoke an instance of the SEI implementation bean
               Invocation inv = setupInvocation(endpoint, sepInv, invContext);
               InvocationHandler invHandler = endpoint.getInvocationHandler();
              
               try
               {
                  invHandler.invoke(endpoint, inv);
               }
               catch (InvocationTargetException th)
               {
                  //Unwrap the throwable raised by the service endpoint implementation
                  Throwable targetEx = th.getTargetException();
                  throw (targetEx instanceof Exception ? (Exception)targetEx : new UndeclaredThrowableException(targetEx));
               }
               finally
               {
                  // JBWS-2486
                  if (endpoint.getAttachment(Object.class) == null)
                  {
                     endpoint.addAttachment(Object.class, inv.getInvocationContext().getTargetBean());
                  }
               }

               // Handler processing might have replaced the endpoint invocation
               sepInv = inv.getInvocationContext().getAttachment(EndpointInvocation.class);
            }
            finally
            {
               msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
            }
View Full Code Here

         invContext.addAttachment(ServletEndpointContext.class, servletEndpointContext);
      }

      invContext.addAttachment(EndpointInvocation.class, epInv);

      Invocation wsInv = new DelegatingInvocation();
      wsInv.setInvocationContext(invContext);
      wsInv.setJavaMethod(getImplMethod(endpoint, epInv));
      // JBWS-2486, see endpoint attachment initialization above
      wsInv.getInvocationContext().setTargetBean(endpoint.getAttachment(Object.class));

      return wsInv;
   }
View Full Code Here

   private static final Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
  
   @Override
   protected Invocation setupInvocation(Endpoint ep, EndpointInvocation epInv, InvocationContext invContext) throws Exception
   {
      Invocation inv = super.setupInvocation(ep, epInv, invContext);

      // Attach the handler callback
      ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
      invContext.addAttachment(HandlerCallback.class, new HandlerCallbackImpl(sepMetaData));
View Full Code Here

        private JAXRPCHandlersInterceptor() {}

        @Override
        public Object processInvocation(final InterceptorContext context) throws Exception {
            final SOAPMessageContext msgContext = (SOAPMessageContext) context.getPrivateData(MessageContext.class);
            final Invocation wsInvocation = (Invocation) context.getPrivateData(Invocation.class);
            final HandlerCallback callback = (HandlerCallback) context.getPrivateData(HandlerCallback.class);
            if (msgContext == null || callback == null || wsInvocation == null) {
                // not for us
                return context.proceed();
            }

            // Handlers need to be Tx. Therefore we must invoke the handler chain after the TransactionInterceptor.
            try {
                // call the request handlers
                boolean handlersPass = callback.callRequestHandlerChain(wsInvocation, HandlerType.ENDPOINT);
                handlersPass = handlersPass && callback.callRequestHandlerChain(wsInvocation, HandlerType.POST);

                // Call the next interceptor in the chain
                if (handlersPass) {
                    // The SOAPContentElements stored in the EndpointInvocation might have changed after
                    // handler processing. Get the updated request payload. This should be a noop if request
                    // handlers did not modify the incomming SOAP message.
                    final Object[] reqParams = wsInvocation.getArgs();
                    context.setParameters(reqParams);
                    final Object resObj = context.proceed();

                    // Setting the message to null should trigger binding of the response message
                    msgContext.setMessage(null);
                    wsInvocation.setReturnValue(resObj);
                }

                // call the response handlers
                handlersPass = callback.callResponseHandlerChain(wsInvocation, HandlerType.POST);
                handlersPass = handlersPass && callback.callResponseHandlerChain(wsInvocation, HandlerType.ENDPOINT);

                // update the return value after response handler processing
                return wsInvocation.getReturnValue();
            }
            catch (final Exception ex) {
                try {
                    // call the fault handlers
                    boolean handlersPass = callback.callFaultHandlerChain(wsInvocation, HandlerType.POST, ex);
View Full Code Here

                  reqMessage = msgContext.getMessageAbstraction();
                  sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
               }

               // Invoke an instance of the SEI implementation bean
               Invocation inv = setupInvocation(endpoint, sepInv, invContext);
               InvocationHandler invHandler = endpoint.getInvocationHandler();
              
               try
               {
                  invHandler.invoke(endpoint, inv);
               }
               catch (InvocationTargetException th)
               {
                  //Unwrap the throwable raised by the service endpoint implementation
                  Throwable targetEx = th.getTargetException();
                  throw (targetEx instanceof Exception ? (Exception)targetEx : new UndeclaredThrowableException(targetEx));
               }

               // Handler processing might have replaced the endpoint invocation
               sepInv = inv.getInvocationContext().getAttachment(EndpointInvocation.class);
            }
            finally
            {
               msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
            }
View Full Code Here

         invContext.addAttachment(ServletEndpointContext.class, servletEndpointContext);
      }

      invContext.addAttachment(EndpointInvocation.class, epInv);

      Invocation wsInv = new DelegatingInvocation();
      wsInv.setInvocationContext(invContext);
      wsInv.setJavaMethod(getImplMethod(endpoint, epInv));

      return wsInv;
   }
View Full Code Here

                     }
                  }
               }
              
               // Invoke an instance of the SEI implementation bean
               Invocation inv = setupInvocation(endpoint, sepInv, invContext);
               InvocationHandler invHandler = endpoint.getInvocationHandler();
              
               try
               {
                  invHandler.invoke(endpoint, inv);
                 
               }
               catch (InvocationTargetException th)
               {
                  //Unwrap the throwable raised by the service endpoint implementation
                  Throwable targetEx = th.getTargetException();
                  throw (targetEx instanceof Exception ? (Exception)targetEx : new UndeclaredThrowableException(targetEx));
               }
               finally
               {
                  // JBWS-2486
                  if (endpoint.getAttachment(Object.class) == null)
                  {
                     endpoint.addAttachment(Object.class, inv.getInvocationContext().getTargetBean());
                  }
               }

               // Handler processing might have replaced the endpoint invocation
               sepInv = inv.getInvocationContext().getAttachment(EndpointInvocation.class);
            }
            finally
            {
               msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
            }
View Full Code Here

        private JAXRPCHandlersInterceptor() {}

        @Override
        public Object processInvocation(final InterceptorContext context) throws Exception {
            final SOAPMessageContext msgContext = (SOAPMessageContext) context.getPrivateData(MessageContext.class);
            final Invocation wsInvocation = (Invocation) context.getPrivateData(Invocation.class);
            final HandlerCallback callback = (HandlerCallback) context.getPrivateData(HandlerCallback.class);
            if (msgContext == null || callback == null || wsInvocation == null) {
                // not for us
                return context.proceed();
            }

            // Handlers need to be Tx. Therefore we must invoke the handler chain after the TransactionInterceptor.
            try {
                // call the request handlers
                boolean handlersPass = callback.callRequestHandlerChain(wsInvocation, HandlerType.ENDPOINT);
                handlersPass = handlersPass && callback.callRequestHandlerChain(wsInvocation, HandlerType.POST);

                // Call the next interceptor in the chain
                if (handlersPass) {
                    // The SOAPContentElements stored in the EndpointInvocation might have changed after
                    // handler processing. Get the updated request payload. This should be a noop if request
                    // handlers did not modify the incomming SOAP message.
                    final Object[] reqParams = wsInvocation.getArgs();
                    context.setParameters(reqParams);
                    final Object resObj = context.proceed();

                    // Setting the message to null should trigger binding of the response message
                    msgContext.setMessage(null);
                    wsInvocation.setReturnValue(resObj);
                }

                // call the response handlers
                handlersPass = callback.callResponseHandlerChain(wsInvocation, HandlerType.POST);
                handlersPass = handlersPass && callback.callResponseHandlerChain(wsInvocation, HandlerType.ENDPOINT);

                // update the return value after response handler processing
                return wsInvocation.getReturnValue();
            }
            catch (final Exception ex) {
                try {
                    // call the fault handlers
                    boolean handlersPass = callback.callFaultHandlerChain(wsInvocation, HandlerType.POST, ex);
View Full Code Here

                     }
                  }
               }
              
               // Invoke an instance of the SEI implementation bean
               Invocation inv = setupInvocation(endpoint, sepInv, invContext);
               InvocationHandler invHandler = endpoint.getInvocationHandler();
              
               try
               {
                  invHandler.invoke(endpoint, inv);
                 
               }
               catch (InvocationTargetException th)
               {
                  //Unwrap the throwable raised by the service endpoint implementation
                  Throwable targetEx = th.getTargetException();
                  throw (targetEx instanceof Exception ? (Exception)targetEx : new UndeclaredThrowableException(targetEx));
               }
               finally
               {
                  // JBWS-2486
                  if (endpoint.getAttachment(Object.class) == null)
                  {
                     endpoint.addAttachment(Object.class, inv.getInvocationContext().getTargetBean());
                  }
               }

               // Handler processing might have replaced the endpoint invocation
               sepInv = inv.getInvocationContext().getAttachment(EndpointInvocation.class);
            }
            finally
            {
               msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
            }
View Full Code Here

TOP

Related Classes of org.jboss.wsf.spi.invocation.Invocation

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.