Package org.apache.servicemix.jbi.deployer

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


     *
     * @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

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

        prefs.put("state", State.Stopped.name());
        prefs.flush();
        replay(prefs);

        final List<ServiceRegistration> wires = new LinkedList<ServiceRegistration>();
        ServiceAssembly sa = new ServiceAssemblyImpl(null, descriptor, new ArrayList<ServiceUnitImpl>(), prefs, new AssemblyReferencesListener(), false) {
            @Override
            protected ServiceRegistration registerWire(Wire wire) {
                ServiceRegistration registration = createMock(ServiceRegistration.class);
                wires.add(registration);
                return registration;
            }
        };
        sa.start();
        assertEquals(2, wires.size());
       
        // ServiceRegistrations should be unregistered when the SA is stopped
        for (final ServiceRegistration registration : wires) {
            registration.unregister();
            replay(registration);
        }
        sa.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());
        pending.put(exchange, assembly);
    }
View Full Code Here

                        handle(component);
                        continue;
                    }
                }
                if ((!isComponent && !isAssembly) || isAssembly) {
                    ServiceAssembly assembly = getServiceAssembly(artifact);
                    if (assembly != null) {
                        handle(assembly);
                        continue;
                    }
                }
View Full Code Here

        storage.put("state", State.Stopped.name());
        storage.save();
        replay(storage);

        final List<ServiceRegistration> wires = new LinkedList<ServiceRegistration>();
        ServiceAssembly sa = new ServiceAssemblyImpl(null, descriptor, new ArrayList<ServiceUnitImpl>(), storage, new AssemblyReferencesListener(), false) {
            @Override
            protected ServiceRegistration registerWire(Wire wire) {
                ServiceRegistration registration = createMock(ServiceRegistration.class);
                wires.add(registration);
                return registration;
            }
        };
        sa.start();
        assertEquals(2, wires.size());
       
        // ServiceRegistrations should be unregistered when the SA is stopped
        for (final ServiceRegistration registration : wires) {
            registration.unregister();
            replay(registration);
        }
        sa.stop();
    }
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.