Package org.mule.model.seda

Examples of org.mule.model.seda.SedaService


{
    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 SedaService(muleContext));
    }
View Full Code Here


    protected Service createService() throws MuleException
    {
        SedaModel model = new SedaModel();
        muleContext.getRegistry().registerModel(model);
        Service service = new SedaService(muleContext);
        service.setName("test");
        service.setComponent(new PassThroughComponent());
        service.setModel(model);
        return service;
    }
View Full Code Here

    {
        final SedaModel model = new SedaModel();
        model.setMuleContext(context);
        context.getRegistry().applyLifecycle(model);

        final Service service = new SedaService(context);
        service.setName(name);
        final SingletonObjectFactory of = new SingletonObjectFactory(clazz, props);
        of.initialise();
        final JavaComponent component = new DefaultJavaComponent(of);
        ((MuleContextAware) component).setMuleContext(context);
        service.setComponent(component);
        service.setModel(model);
        if (initialize)
        {
            context.getRegistry().registerService(service);
        }
View Full Code Here

    }

    protected Service createUninitializedService() throws Exception
    {
        TestComponent component = new TestComponent();
        Service service = new SedaService(muleContext);
        service.setName("name");
        service.setComponent(component);
        service.setModel(muleContext.getRegistry().lookupSystemModel());
        return service;
    }
View Full Code Here


    public ServiceBuilder(String name, MuleContext muleContext)
    {
        this.muleContext = muleContext;
        service = new SedaService(muleContext);
        service.setName(name);
    }
View Full Code Here

    }
   
    @Test
    public void testServicePropagatedLifecycle() throws InitialisationException
    {
        Service service = new SedaService(muleContext);
        service.setName("service");
        service.setModel(muleContext.getRegistry().lookupSystemModel());
        LifecycleTrackerComponent component = new LifecycleTrackerComponent();
        service.setComponent(component);
       
        service.initialise();
       
        assertTrue(component.getTracker().contains("initialise"));
    }
View Full Code Here

    @Test
    public void testUndeploy() throws Exception
    {
        final String domainOriginal = "TEST_DOMAIN_1";

        final SedaService service = new SedaService(muleContext);
        service.setName("TEST_SERVICE");
        SingletonObjectFactory factory = new SingletonObjectFactory(Object.class);
        final DefaultJavaComponent component = new DefaultJavaComponent(factory);
        component.setMuleContext(muleContext);
        service.setComponent(component);

        ThreadingProfile defaultThreadingProfile = ThreadingProfile.DEFAULT_THREADING_PROFILE;
        defaultThreadingProfile.setMuleContext(muleContext);
        service.setThreadingProfile(defaultThreadingProfile);
        SedaModel model = new SedaModel();
        model.setMuleContext(muleContext);
        service.setModel(model);
        muleContext.getRegistry().registerModel(model);
        muleContext.getRegistry().registerService(service);
        muleContext.start();

        final ServiceService jmxService = new ServiceService("TEST_SERVICE", muleContext);
View Full Code Here

            }
            // now strip off the service name
            String newEndpoint = endpoint;
            int i = newEndpoint.indexOf(serviceName);
            newEndpoint = newEndpoint.substring(0, i - 1);
            SedaService s = new SedaService(muleContext);
            s.setName(serviceName);
            s.setModel(muleContext.getRegistry().lookupSystemModel());

            QueueProfile queueProfile = QueueProfile.newInstancePersistingToDefaultMemoryQueueStore(muleContext);
            s.setQueueProfile(queueProfile);

            ((CompositeMessageSource) s.getMessageSource()).addSource(
                muleContext.getEndpointFactory().getInboundEndpoint(newEndpoint));
            final DefaultJavaComponent component = new DefaultJavaComponent(new SingletonObjectFactory(listener));
            component.setMuleContext(muleContext);
            s.setComponent(component);
            muleContext.getRegistry().registerService(s);
            return true;
        }
        else
        {
View Full Code Here

        Service service = muleContext.getRegistry().lookupService(EVENT_MULTICASTER_DESCRIPTOR_NAME);
        if (service != null)
        {
            muleContext.getRegistry().unregisterService(service.getName());
        }
        service = new SedaService(muleContext);
        service.setName(EVENT_MULTICASTER_DESCRIPTOR_NAME);
        service.setModel(model);
        if (subscriptions == null)
        {
            logger.info("No receive endpoints have been set, using default '*'");
 
View Full Code Here

        Service service = muleContext.getRegistry().lookupService(AXIS_SERVICE_PROPERTY + getName());

        if (service == null)
        {
            // TODO MULE-2228 Simplify this API
            service = new SedaService(muleContext);
            service.setName(AXIS_SERVICE_PROPERTY + getName());
            service.setModel(muleContext.getRegistry().lookupSystemModel());

            Map props = new HashMap();
            props.put(AXIS, axis);
View Full Code Here

TOP

Related Classes of org.mule.model.seda.SedaService

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.