Package org.mule.api.endpoint

Examples of org.mule.api.endpoint.InboundEndpoint


        assertTrue(filter2 instanceof NotFilter);
        Filter filter3 = ((NotFilter) filter2).getFilter();
        assertNotNull(filter3);
        assertTrue(filter3 instanceof JmsPropertyFilter);

        InboundEndpoint inboundEndpoint = (InboundEndpoint) ((ServiceCompositeMessageSource) muleContext.getRegistry().lookupService("testService").getMessageSource()).getEndpoints().get(0);
        assertNotNull(inboundEndpoint);
        assertEquals(1, inboundEndpoint.getProperties().size());
        assertEquals("testCustomDurableName", inboundEndpoint.getProperty(JmsConstants.DURABLE_NAME_PROPERTY));
    }
View Full Code Here


        connector.setQueryRunner(new TestQueryRunner());
        connector.setResultSetHandler(new TestResultSetHandler());
        connector.setDataSource(new TestDataSource());
        muleContext.getRegistry().registerConnector(connector);
       
        InboundEndpoint ep = muleContext.getEndpointFactory().getInboundEndpoint(
            "jdbc://select * from test");
        ep.request(0);
    }
View Full Code Here

                // Lookup/create JCA Model
                JcaModel model = getJcaModel(modelName);

                // Create Endpoint
                InboundEndpoint endpoint = createMessageInflowEndpoint(muleActivationSpec);

                // Create Service
                Service service = createJcaService(endpointFactory, model, endpoint);

                // Keep reference to JcaService descriptor for endpointDeactivation
View Full Code Here

        SftpConnector c = (SftpConnector) registry.lookupConnector("sftp");
        assertNotNull(c);

        EndpointBuilder epb = registry.lookupEndpointBuilder("InvalidEndpoint");
        InboundEndpoint ep = epb.buildInboundEndpoint();

        // Verify that failed creations of sftp-clients don't leak resources (e.g.
        // ssh-servers)
        // In v2.2.1-RC2 this tests fails after 132 attempts on a Mac OSX 10.6
        // machine
View Full Code Here

            receiver = (MessageReceiver)iterator.next();
            String filterAddress = receiver.getEndpointURI().getAddress();
            WildcardFilter filter = new WildcardFilter(filterAddress);
            if (filter.accept(endpointUri.getAddress()))
            {
                InboundEndpoint endpoint = receiver.getEndpoint();
                EndpointURI newEndpointURI = new MuleEndpointURI(endpointUri, filterAddress);
                receiver.setEndpoint(new DynamicURIInboundEndpoint(endpoint, newEndpointURI));

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

    {
        try
        {
            // TODO MULE-2228 Simplify this API
            Service c = MuleTestUtils.getTestService("testComponentWithoutInterfaces", ComponentWithoutInterfaces.class, null, muleContext, false);
            InboundEndpoint ep = muleContext.getEndpointFactory().getInboundEndpoint(getComponentWithoutInterfacesEndpoint());
            ((CompositeMessageSource) c.getMessageSource()).addSource(ep);
            muleContext.getRegistry().registerService(c);
            fail("Expected exception");
        }
        catch (MuleException e)
View Full Code Here

     * @return the message received or null if no message was received
     * @throws org.mule.api.MuleException
     */
    public MuleMessage request(String url, long timeout) throws MuleException
    {
        InboundEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint(url);

        try
        {
            return endpoint.request(timeout);
        }
        catch (Exception e)
        {
            throw new ReceiveException(endpoint, timeout, e);
        }
View Full Code Here

        for (EndpointUri uri : uris)
        {
            if (!uri.isDynamic())
            {
                InboundEndpoint ei = client.getInboundEndpoint(uri.getUri());
                uri.checkResultUri(ei);
            }
            if (!uri.getUri().startsWith("imap:"))
            {
                OutboundEndpoint oi = client.getOutboundEndpoint(uri.getUri());
View Full Code Here

        //DO NOTHING
    }

    public void start() throws MuleException
    {
        InboundEndpoint endpoint = (InboundEndpoint) muleContext.getRegistry().lookupObject(this.inboundPollingEndpointName);
        AbstractConnector connector = (AbstractConnector) endpoint.getConnector();
        receiver = (AbstractPollingMessageReceiver) connector.getReceiver(null, endpoint);
        receiver.disableNativeScheduling();
    }
View Full Code Here

            logger.debug("Attempting to receive event on: " + jobConfig.getEndpointRef());
            TransactionTemplate<Void> tt;
            final AtomicBoolean pollGlobalEndpoint = new AtomicBoolean(false);

            //TODO MULE-5050 work around because the builder is no longer idempotent, we now cache the endpoint instance
            InboundEndpoint endpoint = muleContext.getRegistry().lookupObject(jobConfig.getEndpointRef() + ".quartz-job");
            if(endpoint==null)
            {
                final EndpointBuilder epBuilder = muleContext.getRegistry().lookupEndpointBuilder(jobConfig.getEndpointRef());
                pollGlobalEndpoint.set(epBuilder != null);

                if (pollGlobalEndpoint.get())
                {
                    // referencing a global endpoint, fetch configuration from it
                    endpoint = epBuilder.buildInboundEndpoint();

                    //TODO MULE-5050 work around because the builder is no longer idempotent, we now cache the endpoint instance
                    muleContext.getRegistry().registerObject(jobConfig.getEndpointRef() + ".quartz-job", endpoint);
                    tt = new TransactionTemplate<Void>(endpoint.getTransactionConfig(), muleContext);
                }
                else
                {
                    // a simple inline endpoint
                    tt = new TransactionTemplate<Void>(new MuleTransactionConfig(), muleContext);
                }
            }
            else
            {
                tt = new TransactionTemplate<Void>(endpoint.getTransactionConfig(), muleContext);
            }


            final InboundEndpoint finalEndpoint = endpoint;
            TransactionCallback<Void> cb = new TransactionCallback<Void>()
            {
                public Void doInTransaction() throws Exception
                {
                    Transaction tx = TransactionCoordination.getInstance().getTransaction();
                    if (tx != null)
                    {
                        tx.begin();
                    }

                    MuleMessage result = null;
                    if (pollGlobalEndpoint.get())
                    {
                        result = finalEndpoint.getConnector().request(finalEndpoint, jobConfig.getTimeout());
                    }
                    else
                    {
                        MuleClient client = new MuleClient(connector.getMuleContext());
                        result = client.request(jobConfig.getEndpointRef(), jobConfig.getTimeout());
                    }

                    if (result != null)
                    {
                        if (logger.isDebugEnabled())
                        {
                            logger.debug("Received event on: " + jobConfig.getEndpointRef());
                        }
                        if (pollGlobalEndpoint.get())
                        {
                            result.applyTransformers(null, finalEndpoint.getTransformers());
                        }

                        //we need to do this because
                        result = (MuleMessage) ((ThreadSafeAccess) result).newThreadCopy();
View Full Code Here

TOP

Related Classes of org.mule.api.endpoint.InboundEndpoint

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.