Examples of DefaultMuleSession


Examples of org.mule.session.DefaultMuleSession

                    applicationEvent.getMuleEventContext().setStopFurtherProcessing(true);
                    applicationEvent.getMuleEventContext().dispatchEvent(message, endpoint);
                }
                else
                {
                    MuleSession session = new DefaultMuleSession(service, muleContext);
                    DefaultMuleEvent event = new DefaultMuleEvent(message, endpoint.getExchangePattern(),
                        session);
                    RequestContext.setEvent(event);
                    // transform if necessary
                    if (endpoint.getTransformers() != null)
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

    }

    public void testEventMetaDataPropagation() throws MuleException
    {
        Service service = muleContext.getRegistry().lookupService("component1");
        MuleSession session = new DefaultMuleSession(service, muleContext);
        MuleEvent event = new DefaultMuleEvent(new DefaultMuleMessage("Test MuleEvent", muleContext),
            ((ServiceCompositeMessageSource) service.getMessageSource()).getEndpoints().get(0), session);
        service.sendEvent(event);
    }
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

            if (endpoint == null)
            {
                throw new InitialisationException(CoreMessages.propertiesNotSet("endpoint"), this);
            }
            // Create a session for sending notifications
            session = new DefaultMuleSession(muleContext);
        }
        catch (Exception e)
        {
            throw new InitialisationException(e, this);
        }
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

            {
                session = event.getSession();
            }
            else
            {
                session = new DefaultMuleSession(muleContext);
            }

            logger.info("Making Axis soap request on: " + uri);
            if (logger.isDebugEnabled())
            {
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

    int maxRedelivery;

    public MessageRedeliveredException(String messageId, int redeliveryCount, int maxRedelivery, InboundEndpoint endpoint, FlowConstruct flow, MuleMessage muleMessage)
    {       
        super(JmsMessages.tooManyRedeliveries(messageId, redeliveryCount, maxRedelivery, endpoint),
            new DefaultMuleEvent(muleMessage, endpoint, new DefaultMuleSession(flow, endpoint.getMuleContext())));
        this.messageId = messageId;
        this.redeliveryCount = redeliveryCount;
        this.maxRedelivery = maxRedelivery;
        this.endpoint = endpoint;
    }
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

     * Packages a mule event for the current request
     */
    protected MuleEvent getEvent(MuleMessage message, OutboundEndpoint endpoint)
        throws MuleException
    {
        MuleSession session = new DefaultMuleSession(message, ((AbstractConnector)endpoint.getConnector()).getSessionHandler(), muleContext);

        if (credentials != null)
        {
            message.setOutboundProperty(MuleProperties.MULE_USER_PROPERTY, "Plain " + credentials.getToken());
        }
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

    /** @see MULE-4720 */
    public void testSecurityContext() throws Exception
    {
        DefaultMuleMessage message = new DefaultMuleMessage("Test Message", muleContext);
        SessionHandler handler = new SerializeAndEncodeSessionHandler();
        MuleSession session = new DefaultMuleSession(muleContext);
       
        Credentials credentials = new MuleCredentials("joe", "secret".toCharArray());
        SecurityContext sc = new DefaultSecurityContextFactory().create(new DefaultMuleAuthentication(credentials));
        session.setSecurityContext(sc);

        handler.storeSessionInfoToMessage(session, message);
        // store save session to outbound, move it to the inbound
        // for retrieve to deserialize
        Object s = message.removeProperty(MuleProperties.MULE_SESSION_PROPERTY);
        message.setInboundProperty(MuleProperties.MULE_SESSION_PROPERTY, s);
        session = handler.retrieveSessionInfoFromMessage(message);

        sc = session.getSecurityContext();
        assertEquals("joe", sc.getAuthentication().getPrincipal());
    }   
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

    /** @see EE-1774 */
    public void testNotSerializableSecurityContext() throws Exception
    {
        MuleMessage message = new DefaultMuleMessage("Test Message", muleContext);
        SessionHandler handler = new SerializeAndEncodeSessionHandler();
        MuleSession session = new DefaultMuleSession(muleContext);
       
        session.setSecurityContext(new NotSerializableSecurityContext());
       
        try
        {
            handler.storeSessionInfoToMessage(session, message);
            fail("Should throw a SerializationException");
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

    protected ThreadSafeAccess dummyEvent() throws Exception
    {
        MuleMessage message = new DefaultMuleMessage(new Object(), (Map) null, muleContext);
        return new DefaultMuleEvent(message,
                MuleTestUtils.getTestInboundEndpoint("test", MessageExchangePattern.ONE_WAY, muleContext, null),
                new DefaultMuleSession(new SedaService(muleContext), muleContext));
    }
View Full Code Here

Examples of org.mule.session.DefaultMuleSession

            for (String s : attachments.keySet())
            {
                message.addOutboundAttachment(s, attachments.get(s));
            }
        }
        return new DefaultMuleEventContext(new DefaultMuleEvent(message, getTestInboundEndpoint("null"), new DefaultMuleSession(muleContext)));
    }
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.