Package org.apache.servicemix.common

Examples of org.apache.servicemix.common.ServiceUnit


        /* (non-Javadoc)
         * @see org.servicemix.common.BaseLifeCycle#doInit()
         */
        protected void doInit() throws Exception {
            super.doInit();
            su = new ServiceUnit();
            su.setComponent(WSNSpringComponent.this);
            WSNDeployer deployer = new WSNDeployer(WSNSpringComponent.this);
            if (resources != null) {
                for (int i = 0; i < resources.length; i++) {
                    Endpoint ep = deployer.createEndpoint(resources[i].getURL());
View Full Code Here


        // lets register the deployer so that any endpoints activated are added
        // to this SU
        component.deployer = this;

        // lets install the context class loader
        ServiceUnit serviceUnit = super.deploy(serviceUnitName, serviceUnitRootPath);
        Thread.currentThread().setContextClassLoader(serviceUnit.getConfigurationClassLoader());
        return serviceUnit;
    }
View Full Code Here

    private ServiceUnit serviceUnit;

    public WSNLifeCycle(BaseComponent component) {
        super(component);
        configuration = new WSNConfiguration();
        serviceUnit = new ServiceUnit();
        serviceUnit.setComponent(component);
    }
View Full Code Here

    protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception {
        // We receive an exchange for an EPR that has not been used yet.
        // Register a provider endpoint and restart processing.
        HttpEndpoint httpEp = new HttpEndpoint();
        httpEp.setServiceUnit(new ServiceUnit(component));
        httpEp.setService(ep.getServiceName());
        httpEp.setEndpoint(ep.getEndpointName());
        httpEp.setRole(MessageExchange.Role.PROVIDER);
        URI uri = new URI(ep.getEndpointName());
        Map map = URISupport.parseQuery(uri.getQuery());
View Full Code Here

   
    protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception {
        // We receive an exchange for an EPR that has not been used yet.
        // Register a provider endpoint and restart processing.
        JmsEndpoint jmsEp = new JmsEndpoint();
        jmsEp.setServiceUnit(new ServiceUnit(component));
        jmsEp.setService(ep.getServiceName());
        jmsEp.setEndpoint(ep.getEndpointName());
        jmsEp.setRole(MessageExchange.Role.PROVIDER);
        URI uri = new URI(ep.getEndpointName());
        Map map = URISupport.parseQuery(uri.getQuery());
View Full Code Here

        BPEComponent bpe = new BPEComponent();
        ((BPELifeCycle) bpe.getLifeCycle()).doInit();
        BPEDeployer deployer = new BPEDeployer(bpe);
        assertTrue(deployer.canDeploy("loanbroker", path.getAbsolutePath()));

        ServiceUnit su = deployer.deploy("loanbroker", path.getAbsolutePath());
        assertNotNull(su);
    }
View Full Code Here

       
    }
   
    public void testDeployWithProperties() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean", getServiceUnitPath("xbean"));
        assertNotNull(su);
        assertEquals(1, su.getEndpoints().size());
        XBeanEndpoint ep = (XBeanEndpoint) su.getEndpoints().iterator().next();
        assertEquals("value", ep.getProp());
    }
View Full Code Here

        assertEquals("value", ep.getProp());
    }
   
    public void testDeployWithClasspathXml() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean-cp", getServiceUnitPath("xbean-cp"));
        assertNotNull(su);
        ClassLoader cl = su.getConfigurationClassLoader();
        assertNotNull(cl);
        assertTrue(cl instanceof JarFileClassLoader);
        assertEquals(2, ((JarFileClassLoader) cl).getURLs().length);
        assertNotNull(cl.getResource("test.xml"));
    }
View Full Code Here

        assertNotNull(cl.getResource("test.xml"));
    }
   
    public void testDeployWithInlineClasspath() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean-inline", getServiceUnitPath("xbean-inline"));
        assertNotNull(su);
        ClassLoader cl = su.getConfigurationClassLoader();
        assertNotNull(cl);
        assertTrue(cl instanceof JarFileClassLoader);
        assertEquals(2, ((JarFileClassLoader) cl).getURLs().length);
        assertNotNull(cl.getResource("test.xml"));
    }
View Full Code Here

        assertNotNull(cl.getResource("test.xml"));
    }
   
    public void testDeployWithDefaultClasspath() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean-lib", getServiceUnitPath("xbean-lib"));
        assertNotNull(su);
        ClassLoader cl = su.getConfigurationClassLoader();
        assertNotNull(cl);
        assertTrue(cl instanceof JarFileClassLoader);
        assertEquals(2, ((JarFileClassLoader) cl).getURLs().length);
        assertNotNull(cl.getResource("test.xml"));
    }
View Full Code Here

TOP

Related Classes of org.apache.servicemix.common.ServiceUnit

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.