Package org.switchyard.deploy

Examples of org.switchyard.deploy.ServiceHandler


        super(context, types);
    }

    @Override
    public ServiceHandler activateService(QName serviceName, ComponentModel config) {
        ServiceHandler handler = null;

        // add switchyard property parser to camel PropertiesComponent
        PropertiesComponent propertiesComponent = getCamelContext().getComponent("properties", PropertiesComponent.class);
        PropertyResolver pr = config.getModelConfiguration().getPropertyResolver();
        propertiesComponent.setPropertiesParser(new SwitchYardPropertiesParser(pr));
View Full Code Here


                Activator activator = findActivator(binding.getType());
                if (activator == null) {
                    continue;
                }

                ServiceHandler handler = activator.activateBinding(reference.getQName(), binding);
                Activation activation = new Activation(activator, reference.getQName(), binding, handler);
                ServiceInterface si = getCompositeReferenceInterface(reference);
                Binding bindingMetadata = new Binding(binding);
                validateServiceRegistration(refQName);
                ServiceMetadata metadata = ServiceMetadataBuilder.create().registrant(bindingMetadata).build();
                Service svc = getDomain().registerService(refQName, si, handler, metadata);
                activation.addService(svc);
                _referenceBindings.add(activation);

                handler.start();
            }
        }
    }
View Full Code Here

                } catch (Exception e) {
                    throw new SwitchYardException(e);
                }
                requires.addAll(requiresImpl);

                ServiceHandler handler = activator.activateService(service.getQName(), component);
                Activation activation = new Activation(activator, component.getQName(), null, handler);
                ServiceInterface serviceIntf = getComponentServiceInterface(service);
                ServiceMetadata metadata = ServiceMetadataBuilder.create()
                        .security(getDomain().getServiceSecurity(service.getSecurity()))
                        .requiredPolicies(requires)
                        .registrant(impl)
                        .build();
               
                Service svc = getDomain().registerService(service.getQName(), serviceIntf, handler, metadata);
                activation.addService(svc);
                activation.addReferences(references);
               
                // register any service promotions
                for (CompositeServiceModel compositeService : getConfig().getComposite().getServices()) {
                    ComponentServiceModel componentService = compositeService.getComponentService();
                    if (componentService != null && componentService.equals(service)) {
                        // avoid duplicates
                        if (!service.getQName().equals(compositeService.getQName())) {
                            validateServiceRegistration(compositeService.getQName());
                            Service promotedService = getDomain().registerService(
                                    compositeService.getQName(), serviceIntf, handler, metadata);
                            activation.addPromotion(promotedService);
                        }
                    }
                }
               
                _components.add(activation);
                handler.start();

            } else {
                // we don't have a distinct call for activateReference right now,
                // so this catches cases where an implementation has one or more
                // references, but no services.  (this is pretty crappy)
View Full Code Here

                Activator activator = findActivator(binding.getType());
                if (activator == null) {
                    continue;
                }
               
                ServiceHandler handler = activator.activateBinding(service.getQName(), binding);
                Activation activation = new Activation(activator, service.getQName(), binding, handler);
                activation.addReference(reference);
                _serviceBindings.add(activation);
               
                handler.start();
            }
        }
    }
View Full Code Here

    private void undeployImplementations() {
        _log.debug("Undeploying services for deployment " + getName());
        try {
            for (Activation activation : _components) {
                _log.debug("Deactivating " + activation.getName());
                final ServiceHandler handler = activation.getHandler();
                if (handler != null) {
                    try {
                        handler.stop();
                    } catch (Throwable e) {
                        BaseDeployLogger.ROOT_LOGGER.errorStoppingService(e);
                    }
                }
View Full Code Here

TOP

Related Classes of org.switchyard.deploy.ServiceHandler

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.