Package org.apache.servicemix.jbi.deployer

Examples of org.apache.servicemix.jbi.deployer.ServiceAssembly


        smxJsr181.start();
        smxHttp.start();
        saBundle.start();

        System.out.println("Waiting for JBI Service Assembly");
        ServiceAssembly sa = getOsgiService(ServiceAssembly.class);
        assertNotNull(sa);

        final List<Throwable> errors = new CopyOnWriteArrayList<Throwable>();
        final int nbThreads = 2;
        final int nbMessagesPerThread = 2;
View Full Code Here


        smxJsr181.start();
        smxHttp.start();
        saBundle.start();

        System.out.println("Waiting for JBI Service Assembly");
        ServiceAssembly sa = getOsgiService(ServiceAssembly.class);
        assertNotNull(sa);
        assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());

        saBundle.stop();

        saBundle.start();
        sa = getOsgiService(ServiceAssembly.class);
        assertNotNull(sa);
        assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());

        saBundle.update();
        sa = getOsgiService(ServiceAssembly.class);
        assertNotNull(sa);
        assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());

        smxHttp.stop();
        try {
            getOsgiService(ServiceAssembly.class, 1);
            fail("ServiceAssembly OSGi service should have been unregistered");
        } catch (RuntimeException e) {
            // Ignore
        }

        smxHttp.start();
        sa = getOsgiService(ServiceAssembly.class);
        assertNotNull(sa);
        assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());
        smxHttp.stop();
        smxJsr181.stop();
        smxShared.stop();

    }
View Full Code Here

            }
        }
    }

    public void endpointRegistered(InternalEndpoint endpoint) {
        ServiceAssembly assembly = this.assembly.get();
        if (assembly != null) {
            endpoints.put(endpoint, assembly);
            if (references.get(assembly) == null) {
                references.put(assembly, new AtomicInteger());
            }
View Full Code Here

    private boolean isSync(Exchange exchange) {
        return exchange.getProperty(DeliveryChannelImpl.SEND_SYNC) != null && exchange.getProperty(DeliveryChannelImpl.SEND_SYNC, Boolean.class).booleanValue();
    }

    private void pending(InternalExchange exchange) {
        ServiceAssembly assembly = endpoints.get(exchange.getSource());
        if (assembly != null) {
          pending.put(exchange, assembly);
        }
    }
View Full Code Here

                    ServiceUnitImpl su = deployer.createServiceUnit(sud, null, component);
                    sus.add(su);
                }
            }
            postInstall();
            ServiceAssembly sa = deployer.registerServiceAssembly(bundle, descriptor.getServiceAssembly(), sus);
            return deployer.getEnvironment().getManagedObjectName(sa);
        } catch (Exception e) {
            LOGGER.error(e.getMessage());
            throw new JBIException(e);
        }
View Full Code Here

     *
     * @param name
     * @return
     */
    public String undeployServiceAssembly(String name) throws Exception {
        ServiceAssembly sa = deployer.getServiceAssembly(name);
        if (sa == null) {
            throw ManagementSupport.failure("start", "Service assembly does not exist: " + name);
        }
        try {
            return getDeploymentService().undeploy(name);
View Full Code Here

     *
     * @param name
     * @return
     */
    public String startServiceAssembly(String name) throws Exception {
        ServiceAssembly sa = deployer.getServiceAssembly(name);
        if (sa == null) {
            throw ManagementSupport.failure("start", "Service assembly does not exist: " + name);
        }
        try {
            sa.start();
            return ManagementSupport.createSuccessMessage("Service assembly started", name);
        } catch (Throwable e) {
            throw ManagementSupport.failure("startServiceAssembly", name, e);
        }
    }
View Full Code Here

     *
     * @param name
     * @return
     */
    public String stopServiceAssembly(String name) throws Exception {
        ServiceAssembly sa = deployer.getServiceAssembly(name);
        if (sa == null) {
            throw ManagementSupport.failure("stop", "Service assembly does not exist: " + name);
        }
        try {
            sa.stop();
            return ManagementSupport.createSuccessMessage("Service assembly stopped", name);
        } catch (Throwable e) {
            throw ManagementSupport.failure("stopServiceAssembly", name, e);
        }
    }
View Full Code Here

     *
     * @param name
     * @return
     */
    public String shutdownServiceAssembly(String name) throws Exception {
        ServiceAssembly sa = deployer.getServiceAssembly(name);
        if (sa == null) {
            throw ManagementSupport.failure("shutdown", "Service assembly does not exist: " + name);
        }
        try {
            sa.shutDown();
            return ManagementSupport.createSuccessMessage("Service assembly shut down", name);
        } catch (Throwable e) {
            throw ManagementSupport.failure("shutdownServiceAssembly", name, e);
        }
    }
View Full Code Here

            }
        }
    }

    public String undeploy(String saName) throws Exception {
        ServiceAssembly assembly = deployer.getServiceAssembly(saName);
        if (assembly == null) {
            throw ManagementSupport.failure("undeploy", "SA has not been deployed: " + saName);
        }
        AbstractInstaller installer = deployer.getInstaller(assembly);
        if (installer == null) {
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.deployer.ServiceAssembly

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.