Examples of MessageContext

  • org.springframework.binding.message.MessageContext
    A context for recording and retrieving messages for display.
  • org.springframework.ws.context.MessageContext
    Context holder for message requests.

    Contains both the message request as well as the response. Response message are usually lazily created (but do not have to be).

    Also contains properties, which can be used to by {@link EndpointInterceptor interceptors} to pass information on toendpoints. @author Arjen Poutsma @since 1.0.0

  • xsul.message_router.MessageContext

  • Examples of org.apache.axis2.jaxws.context.sei.MessageContext

            String value_expected = "META-INF/MessageContext.wsdl";
            runTest(javax.xml.ws.handler.MessageContext.WSDL_DESCRIPTION, type_expected, value_expected, false);
        }

        private void runTest(String propName, String exType, String exValue, boolean isValueFullySpecified) {
            MessageContext port = getPort();

            Holder<String> type = new Holder<String>();
            Holder<String> value = new Holder<String>();
            Holder<Boolean> isFound = new Holder<Boolean>();
            Holder<String> propertyName = new Holder<String>(propName);

            port.isPropertyPresent(propertyName, value, type, isFound);

            System.out.println("Property = " + propName + " found=" + isFound.value);
            System.out.println("Value = " + value.value + "/" + exValue);
            System.out.println("Type = " + type.value + "/" + exType);
    View Full Code Here

    Examples of org.apache.axis2.jaxws.core.MessageContext

        public EndpointInvocationContext invoke(EndpointInvocationContext eic) throws AxisFault, WebServiceException {
            if (log.isDebugEnabled()) {
                log.debug("Invocation pattern: synchronous");
            }
           
            MessageContext request = eic.getRequestMessageContext();
            boolean good = true;
            try {
                good = handleRequest(eic);

                if (!good) {
                    return eic;
                }
                MessageContext response = null;
                EndpointDispatcher dispatcher = eic.getDispatcher();
                if (request != null && dispatcher != null) {
                    response = dispatcher.invoke(request);   
                    // Note that response may be null in the case of a Provider returning null
                    eic.setResponseMessageContext(response);
    View Full Code Here

    Examples of org.apache.cxf.jaxrs.ext.MessageContext

       
        protected void marshal(Marshaller ms, Object actualObject, Class<?> actualClass,
                      Type genericType, String enc, OutputStream os, boolean isCollection) throws Exception {
            OutputStream actualOs = os;
           
            MessageContext mc = getContext();
            if (mc != null && MessageUtils.isTrue(mc.get(Marshaller.JAXB_FORMATTED_OUTPUT))) {
                actualOs = new CachedOutputStream();   
            }
            XMLStreamWriter writer = createWriter(actualObject, actualClass, genericType, enc,
                                                  actualOs, isCollection);
            ms.marshal(actualObject, writer);
    View Full Code Here

    Examples of org.apache.deltaspike.core.api.message.MessageContext

                    .localeResolver(localeResolver)
                    .messageResolver(new TestMessageResolver())
                    .message().template("{hello}").argument("hans");
            Assert.assertEquals("Test Nachricht an hans", message.toString());

            final MessageContext messageContext2 = this.messageContext.clone().localeResolver(
                    new FixedEnglishLocalResolver());
            Assert.assertEquals("test message to hans", message.toString(messageContext2));
        }
    View Full Code Here

    Examples of org.apache.maven.continuum.notification.MessageContext

        private MimeMessage sendNotificationAndGetMessage( Project project, BuildResult build, BuildDefinition buildDef,
                                                           String buildOutput, String toOverride )
            throws Exception
        {
            MessageContext context = new MessageContext();

            context.setProject( project );

            context.setBuildResult( build );

            context.setBuildDefinition( buildDef );

            ProjectNotifier projectNotifier = new ProjectNotifier();
            projectNotifier.setType( "mail" );
            Map<String, String> config = new HashMap<String, String>();
            config.put( MailContinuumNotifier.ADDRESS_FIELD, "foo@bar" );
            projectNotifier.setConfiguration( config );
            List<ProjectNotifier> projectNotifiers = new ArrayList<ProjectNotifier>();
            projectNotifiers.add( projectNotifier );
            context.setNotifier( projectNotifiers );

            //context.put( ContinuumNotificationDispatcher.CONTEXT_BUILD_OUTPUT, buildOutput );

            //context.put( "buildHost", "foo.bar.com" );
    View Full Code Here

    Examples of org.apache.myfaces.extensions.cdi.message.api.MessageContext

        }

        @Test
        public void newContextTest()
        {
            MessageContext newMessageContext = this.messageContext.cloneContext();

            this.messageContext.config().change().localeResolver(new TestGermanLocaleResolver());
            newMessageContext.config().change().localeResolver(new TestEnglishLocaleResolver());

            if (newMessageContext.equals(this.messageContext))
            {
                fail("different context expected - old context: " + this.messageContext.toString() + " new context: " + newMessageContext.toString());
            }

            assertEquals(Locale.GERMAN, this.messageContext.config().getLocaleResolver().getLocale());
            assertEquals(Locale.ENGLISH, newMessageContext.config().getLocaleResolver().getLocale());
        }
    View Full Code Here

    Examples of org.apache.synapse.MessageContext

                log.debug("Start Sending the Message ");
            }

            try {

                MessageContext messageOut = MessageHelper.cloneMessageContext(messageIn);
                Options options = new Options();
                options.setTo(new EndpointReference(serviceUrl));
                if(messageIn.getSoapAction() != null) {

                    options.setAction(messageIn.getSoapAction());

                } else {

                    if (messageIn.isSOAP11()) {
                        options.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, true);
                    } else {
                        Axis2MessageContext axis2smc = (Axis2MessageContext) messageOut;
                        org.apache.axis2.context.MessageContext axis2MessageCtx =
                                axis2smc.getAxis2MessageContext();
                        axis2MessageCtx.getTransportOut().addParameter(
                                new Parameter(HTTPConstants.OMIT_SOAP_12_ACTION, true));
                    }

                }

               //After setting all the options we need to find the MEP of the Message
               org.apache.axis2.context.MessageContext axis2Ctx =
                       ((Axis2MessageContext)messageOut).getAxis2MessageContext();

               boolean outOnlyMessage = "true".equals(messageIn.getProperty(
                    SynapseConstants.OUT_ONLY)) || WSDL2Constants.MEP_URI_IN_ONLY.equals(
                    axis2Ctx.getOperationContext()
                            .getAxisOperation().getMessageExchangePattern());

                // Here We consider all other Messages that evaluates to outOnlyMessage == false
                // follows out in mep.
                if(log.isDebugEnabled()) {
                    log.debug("Invoking service Url " + serviceUrl + " with Message" +
                            messageIn.getMessageID());
                }





                options.setProperty(
                        AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);

                //clean existing headers
                // otherwise when retrying same header element will add multiple times
                sc.removeHeaders();

                axis2Ctx.getAttachmentMap();
                Iterator itr = axis2Ctx.getEnvelope().getHeader().getChildren();
                while (itr.hasNext()) {
                    Object o =itr.next();
                    if ( o instanceof OMElement ){
                        sc.addHeader((OMElement)o);
                    }
                }

                sc.setOptions(options);
                OMElement result = null;
                try {
                    OMElement payload = axis2Ctx.getEnvelope().getBody().getFirstElement();
                    if(outOnlyMessage) {
                        sc.sendRobust(payload);
                    } else {
                        result = sc.sendReceive(payload);
                    }

                } catch (Exception axisFault) {

                    // Here if Message is not a Out only Message
                    // To indicate that it is a Error we set a new Message Context property
                    // and return the message context
                    // If its not we throw an Exception
                    if (!outOnlyMessage) {
                        messageOut.setProperty(ForwardingProcessorConstants.BLOCKING_SENDER_ERROR,
                                "true");

                        return messageOut;
                    }
    View Full Code Here

    Examples of org.apache.synapse.MessageContext

         */
        public static MessageContext cloneMessageContext(MessageContext synCtx) throws AxisFault {

            // creates the new MessageContext and clone the internal axis2 MessageContext
            // inside the synapse message context and place that in the new one
            MessageContext newCtx = synCtx.getEnvironment().createMessageContext();
            Axis2MessageContext axis2MC = (Axis2MessageContext) newCtx;
            axis2MC.setAxis2MessageContext(
                cloneAxis2MessageContext(((Axis2MessageContext) synCtx).getAxis2MessageContext()));

            newCtx.setConfiguration(synCtx.getConfiguration());
            newCtx.setEnvironment(synCtx.getEnvironment());
            newCtx.setContextEntries(synCtx.getContextEntries());

            // set the parent correlation details to the cloned MC -
            //                              for the use of aggregation like tasks
            newCtx.setProperty(EIPConstants.AGGREGATE_CORRELATION, synCtx.getMessageID());

            // copying the core parameters of the synapse MC
            newCtx.setTo(synCtx.getTo());
            newCtx.setReplyTo(synCtx.getReplyTo());
            newCtx.setSoapAction(synCtx.getSoapAction());
            newCtx.setWSAAction(synCtx.getWSAAction());
            newCtx.setResponse(synCtx.isResponse());

            // copy all the synapse level properties to the newCtx
            for (Object o : synCtx.getPropertyKeySet()) {
                // If there are non String keyed properties neglect them rather than trow exception
                if (o instanceof String) {
                    newCtx.setProperty((String) o, synCtx.getProperty((String) o));
                }
            }
           
            // Make deep copy of fault stack so that parent will not be lost it's fault stack
            Stack<FaultHandler> faultStack = synCtx.getFaultStack();
            if (!faultStack.isEmpty()) {
               
                List<FaultHandler> newFaultStack = new ArrayList<FaultHandler>();
                newFaultStack.addAll(faultStack);
               
                for (FaultHandler faultHandler : newFaultStack) {
                    if (faultHandler != null) {
                        newCtx.pushFaultHandler(faultHandler);
                    }
                }
            }

            if (log.isDebugEnabled()) {
                log.info("Parent's Fault Stack : " + faultStack
                        + " : Child's Fault Stack :" + newCtx.getFaultStack());
            }
           
            return newCtx;
        }
    View Full Code Here

    Examples of org.apache.uima.aae.message.MessageContext

          latch.await();
          if (controller != null && controller.isStopped()) {
            return; // throw away the message, we are stopping
          }
          if (UimaMessageValidator.isValidMessage(aMessage, controller)) {
            MessageContext msgContext = aMessage.toMessageContext(controller.getName());
            if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINEST)) {
              UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(),
                      "onMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                      "UIMAEE_new_msg_recvd__FINEST",
                      new Object[] { controller.getComponentName(), aMessage.toString() });
    View Full Code Here

    Examples of org.apache.wink.server.handlers.MessageContext

        public void testXHttpMethodOverride() {

            MockHttpServletRequest request = new MockHttpServletRequest();
            request.setMethod("POST");
            request.addHeader(HttpHeadersEx.X_HTTP_METHOD_OVERRIDE, "PUT");
            MessageContext context =
                new ServerMessageContext(
                                         request,
                                         new MockHttpServletResponse(),
                                         getDeploymentConfiguration("X-HTTP-Method-Override,X-Method-Override"));
            assertEquals("HTTP method", HttpMethod.PUT, context.getHttpMethod());
        }
    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.