Examples of MuleSession


Examples of org.mule.api.MuleSession

        OutboundEndpoint endpoint =
            muleContext.getEndpointFactory().getOutboundEndpoint(endpointBuilder);

        MuleMessage message = new DefaultMuleMessage("test1", muleContext);
        MuleSession session = new DefaultMuleSession(message,
            ((AbstractConnector) endpoint.getConnector()).getSessionHandler(), muleContext);
        MuleEvent event = new DefaultMuleEvent(message, endpoint.getExchangePattern(), session);
        MuleMessage reply = endpoint.process(event).getMessage();

        assertNotNull(reply);
View Full Code Here

Examples of org.mule.api.MuleSession

        if (event == null || decoupled)
        {
            // we've got an out of band WS-RM message or a message from a standalone client
            MuleContext muleContext = configuration.getMuleContext();
            MuleMessage muleMsg = new DefaultMuleMessage(handler, muleContext);
            MuleSession session = new DefaultMuleSession(muleContext);
           
            String url = setupURL(message);
           
            try
            {
View Full Code Here

Examples of org.mule.api.MuleSession

                        }
                        else
                        {
                            handler = new MuleSessionHandler();
                        }
                        MuleSession session;
                        try
                        {
                            session = handler.retrieveSessionInfoFromMessage(muleMessage);
                        }
                        catch (SerializationException e)
View Full Code Here

Examples of org.mule.api.MuleSession

        {
            request.setOutboundProperty(HttpConstants.HEADER_IF_NONE_MATCH, etag);
        }
        request.setOutboundProperty(HttpConnector.HTTP_METHOD_PROPERTY, "GET");

        MuleSession session = new DefaultMuleSession(flowConstruct, connector.getMuleContext());


        MuleEvent event = new DefaultMuleEvent(request, outboundEndpoint.getExchangePattern(), session);

        MuleEvent result = outboundEndpoint.process(event);
View Full Code Here

Examples of org.mule.api.MuleSession

            Object flowConstruct = muleContext.getRegistry().lookupObject(destComponent);
            if (!(flowConstruct instanceof FlowConstruct && flowConstruct instanceof MessageProcessor))
            {
                return handleException(null, new DefaultMuleException(ClientMessages.noSuchFlowConstruct(destComponent)));
            }
            MuleSession session = new DefaultMuleSession((FlowConstruct) flowConstruct, muleContext);
            // Need to do this otherise when the event is invoked the
            // transformer associated with the Mule Admin queue will be invoked, but
            // the message will not be of expected type

            EndpointBuilder builder = new EndpointURIEndpointBuilder(RequestContext.getEvent().getEndpoint());
View Full Code Here

Examples of org.mule.api.MuleSession

        if (transformers != null)
        {
            trans = TransformerUtils.getTransformers(transformers, muleContext);
        }

        MuleSession session = new DefaultMuleSession(service, muleContext);
        InboundEndpoint endpoint = getDefaultClientEndpoint(service, message.getPayload(), true);
        MuleEvent event = new DefaultMuleEvent(message, endpoint, session);

        if (logger.isDebugEnabled())
        {
View Full Code Here

Examples of org.mule.api.MuleSession

        Service service = muleContext.getRegistry().lookupService(componentName);
        if (service == null)
        {
            throw new ServiceException(CoreMessages.objectNotRegistered("Service", componentName));
        }
        MuleSession session = new DefaultMuleSession(service, muleContext);
        InboundEndpoint endpoint = getDefaultClientEndpoint(service, message.getPayload(), false);
        MuleEvent event = new DefaultMuleEvent(message, endpoint, session);

        if (logger.isDebugEnabled())
        {
View Full Code Here

Examples of org.mule.api.MuleSession

    {
        final Object cookiesObject = message.getOutboundProperty(HttpConnector.HTTP_COOKIES_PROPERTY);
        final String cookieName = MuleProperties.MULE_SESSION_PROPERTY;
        final String cookieValue = CookieHelper.getCookieValueFromCookies(cookiesObject, cookieName);

        MuleSession session = null;

        if (cookieValue != null)
        {
            byte[] serializedSession = Base64.decode(cookieValue);
           
View Full Code Here

Examples of org.mule.api.MuleSession

    public static MuleEvent getTestEvent(Object data,
                                         FlowConstruct flowConstruct,
                                         InboundEndpoint endpoint,
                                         MuleContext context) throws Exception
    {
        final MuleSession session = getTestSession(flowConstruct, context);

        final MuleMessageFactory factory = endpoint.getConnector().createMuleMessageFactory();
        final MuleMessage message = factory.create(data, endpoint.getEncoding());

        return new DefaultMuleEvent(message, endpoint, session);
View Full Code Here

Examples of org.mule.impl.MuleSession

    public void onMessage(MessageExchange messageExchange) throws MessagingException {
        try {
            UMOMessageDispatcher dispatcher = endpoint.getConnector().getDispatcher(endpoint.getEndpointURI().getAddress());
            NormalizedMessage out = getOutMessage(messageExchange);
            UMOMessage message = JbiUtils.createMessage(out);
            UMOEvent event = new MuleEvent(message, endpoint, new MuleSession(), endpoint.isSynchronous());
            if (endpoint.isSynchronous()) {
                UMOMessage result = dispatcher.send(event);
                //todo send result back
            } else {
                dispatcher.dispatch(event);
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.