/** * Removes all service providers from the domain with the specified name. * @param serviceName qualified name of the service */ public void removeService(QName serviceName) { for (Service service : getServiceDomain().getServices(serviceName)) { service.unregister(); } }
/** * Removes all service providers from the domain with the specified name. * @param serviceName qualified name of the service */ public void removeService(QName serviceName) { for (Service service : getServiceDomain().getServices(serviceName)) { service.unregister(); } }
@Override protected void doStart() { QName serviceName = _bindingModel.getService().getQName(); _endpointPublisher.addService(serviceName, _domain); List<Service> services = _domain.getServices(serviceName); if (services.isEmpty()) { throw SCAMessages.MESSAGES.failedToResolveServiceInDomain(serviceName.toString()); } if (_bindingModel.isClustered()) { // The registry can be null in test environments or if the cache is misconfigured if (_registry != null) { _endpoint = RemoteEndpoint.fromService(services.get(0)); _endpoint.setEndpoint(_endpointPublisher.getAddress()); _registry.addEndpoint(_endpoint); } else { SCALogger.ROOT_LOGGER.cannotEnableClusteredSCABindingFor(serviceName.toString()); } } }
@Override protected void doStart() { QName serviceName = _bindingModel.getService().getQName(); _endpointPublisher.addService(serviceName, _domain); List<Service> services = _domain.getServices(serviceName); if (services.isEmpty()) { throw SCAMessages.MESSAGES.failedToResolveServiceInDomain(serviceName.toString()); } if (_bindingModel.isClustered()) { // The registry can be null in test environments or if the cache is misconfigured if (_registry != null) { _endpoint = RemoteEndpoint.fromService(services.get(0)); _endpoint.setEndpoint(_endpointPublisher.getAddress()); _registry.addEndpoint(_endpoint); } else { SCALogger.ROOT_LOGGER.cannotEnableClusteredSCABindingFor(serviceName.toString()); } } }
/** * Replaces an existing service registration (e.g. reference binding) with a test handler using * the same contract as the existing service provider. If multiple services are registered with * the specified name, the first one found is used. Generally speaking, it's not a good idea * to use this method if you have multiple services registered with the same name. In that * situation, use the removeService() and registerService() methods instead. * @param name name of the service to replace * @param handler implementation to use as the service provider * @throws SwitchYardException if a service with the specified name does not exist */ public void replaceService(QName name, ExchangeHandler handler) throws SwitchYardException { List<Service> services = getServiceDomain().getServices(name); if (services.isEmpty()) { throw new SwitchYardException("Failed to replace service: " + name + ". No service is registered with that name."); } // select the service to replace Service replacedService = services.get(0); replacedService.unregister(); // add the replacement service getServiceDomain().registerService(name, replacedService.getInterface(), handler, replacedService.getServiceMetadata()); }
/** * Replaces an existing service registration (e.g. reference binding) with a test handler using * the same contract as the existing service provider. If multiple services are registered with * the specified name, the first one found is used. Generally speaking, it's not a good idea * to use this method if you have multiple services registered with the same name. In that * situation, use the removeService() and registerService() methods instead. * @param name name of the service to replace * @param handler implementation to use as the service provider * @throws SwitchYardException if a service with the specified name does not exist */ public void replaceService(QName name, ExchangeHandler handler) throws SwitchYardException { List<Service> services = getServiceDomain().getServices(name); if (services.isEmpty()) { throw new SwitchYardException("Failed to replace service: " + name + ". No service is registered with that name."); } // select the service to replace Service replacedService = services.get(0); replacedService.unregister(); // add the replacement service getServiceDomain().registerService(name, replacedService.getInterface(), handler, replacedService.getServiceMetadata()); }
List<Service> services = _domain.getServices(exchange.getConsumer().getTargetServiceName()); if (services == null || services.isEmpty()) { throw RuntimeMessages.MESSAGES.noRegisteredService(exchange.getConsumer().getName().toString());
List<Service> services = _domain.getServices(exchange.getConsumer().getTargetServiceName()); if (services == null || services.isEmpty()) { throw RuntimeMessages.MESSAGES.noRegisteredService(exchange.getConsumer().getName().toString());