Package org.jboss.ws.core

Examples of org.jboss.ws.core.CommonMessageContext


      try
      {
         // Construct the endpoint invocation object
         EndpointInvocation epInv = new EndpointInvocation(opMetaData);

         CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
         if (msgContext == null)
            throw new WSException("MessageContext not available");

         ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
         QName xmlName = paramMetaData.getXmlName();
View Full Code Here


   }

   public MessageAbstraction bindFaultMessage(Exception ex)
   {
      SOAPMessageImpl faultMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      if (msgContext != null)
      {
         msgContext.setSOAPMessage(faultMessage);
      }
      else
      {
         log.warn("Cannot set fault message in message context");
      }
View Full Code Here

      throw new WebServiceException(ex);
   }

   private boolean handleMessage(Handler currHandler, MessageContext msgContext)
   {
      CommonMessageContext context = (CommonMessageContext)msgContext;
      if (currHandler instanceof LogicalHandler)
      {
         if (msgContext instanceof SOAPMessageContextJAXWS)
            msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
      }

      if (executedHandlers.contains(currHandler) == false)
         executedHandlers.add(currHandler);

      try
      {
         context.put(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
         context.setCurrentScope(Scope.HANDLER);
         return currHandler.handleMessage(msgContext);
      }
      finally
      {
         context.setCurrentScope(Scope.APPLICATION);
         context.remove(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM);
      }
   }
View Full Code Here

      }
   }

   private boolean handleFault(Handler currHandler, MessageContext msgContext)
   {
      CommonMessageContext context = (CommonMessageContext)msgContext;
      if (currHandler instanceof LogicalHandler)
      {
         if (msgContext instanceof SOAPMessageContextJAXWS)
            msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
      }

      if (executedHandlers.contains(currHandler) == false)
         executedHandlers.add(currHandler);

      try
      {
         context.put(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
         context.setCurrentScope(Scope.HANDLER);
         return currHandler.handleFault(msgContext);
      }
      finally
      {
         context.setCurrentScope(Scope.APPLICATION);
         context.remove(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM);
      }
   }
View Full Code Here

      QName xmlType = container.getXmlType();
      Class javaType = container.getJavaType();

      log.debug("getObjectValue [xmlType=" + xmlType + ",javaType=" + javaType + "]");

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      if (msgContext == null)
         throw new WSException("MessageContext not available");

      SerializationContext serContext = msgContext.getSerializationContext();
      ParameterMetaData pmd = container.getParamMetaData();
      OperationMetaData opMetaData = pmd.getOperationMetaData();
      serContext.setProperty(ParameterMetaData.class.getName(), pmd);
      serContext.setJavaType(javaType);
      List<Class> registeredTypes = opMetaData.getEndpointMetaData().getRegisteredTypes();
View Full Code Here

      stack.push(msgContext);
   }

   public static CommonMessageContext peekMessageContext()
   {
      CommonMessageContext msgContext = null;
      Stack<CommonMessageContext> stack = ThreadLocalAssociation.localMsgContextAssoc().get();
      if (stack != null && stack.isEmpty() == false)
      {
         msgContext = stack.peek();
      }
View Full Code Here

      return msgContext;
   }

   public static CommonMessageContext popMessageContext()
   {
      CommonMessageContext msgContext = null;
      Stack<CommonMessageContext> stack = ThreadLocalAssociation.localMsgContextAssoc().get();
      if (stack != null && stack.isEmpty() == false)
      {
         msgContext = stack.pop();
      }
View Full Code Here

   @Override
   protected void setOutboundContextProperties()
   {
      // Mark the message context as outbound
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);

      // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
      msgContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
   }
View Full Code Here

          */

         saveRequired = false;
      }

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      if(msgContext!=null) msgContext.setModified(true);
   }
View Full Code Here

         else if (type == HandlerType.POST)
         {
            handlerPass = delegate.callRequestHandlerChain(sepMetaData, type);
           
            // Verify that the the message has not been mofified
            CommonMessageContext messageContext = MessageContextAssociation.peekMessageContext();
            if(handlerPass && messageContext.isModified())
            {
               try
               {
                  OperationMetaData opMetaData = messageContext.getOperationMetaData();
                  CommonBindingProvider bindingProvider = new CommonBindingProvider(opMetaData.getEndpointMetaData());
                  CommonBinding binding = bindingProvider.getCommonBinding();
                 
                  log.debug("Handler modified payload, unbind message and update invocation args");
                  EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, messageContext.getMessageAbstraction());
                  wsInv.getInvocationContext().addAttachment(EndpointInvocation.class, epInv);
               }
               catch (BindingException ex)
               {
                  throw new WSException(ex);
View Full Code Here

TOP

Related Classes of org.jboss.ws.core.CommonMessageContext

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.