Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2012 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package org.kuali.rice.ksb.impl.bus;
 import java.util.List;


Kuali Rice Team (
 public class LazyRemoteServiceRegistryConnector implements ServiceRegistry {
     private static final String SERVICE_REGISTRY_SECURITY_CONFIG = "";
 	private final Object initLock = new Object();
 	private volatile ServiceRegistry delegate;
 	// injected
 	private Bus cxfBus;
 	public void setCxfBus(Bus cxfBus) {
 		this. = cxfBus;
 	public List<ServiceInfogetOnlineServicesByName(QName serviceName)
 		return getDelegate().getOnlineServicesByName(serviceName);
 	public List<ServiceInfogetAllServicesForInstance(String instanceId) {
 		return getDelegate().getAllServicesForInstance(instanceId);
     public List<ServiceInfogetAllServicesForApplication(String applicationId) {
         return getDelegate().getAllServicesForApplication(applicationId);
 	public ServiceDescriptor getServiceDescriptor(String serviceDescriptorId)
 		return getDelegate().getServiceDescriptor(serviceDescriptorId);
 		return getDelegate().getServiceDescriptors(serviceDescriptorIds);
 	public ServiceEndpoint publishService(ServiceEndpoint serviceEndpoint)
		return getDelegate().publishService(serviceEndpoint);
		return getDelegate().publishServices(serviceEndpoints);
		return getDelegate().removeServiceEndpoint(serviceId);
		return getDelegate().removeServiceEndpoints(serviceIds);
			List<ServiceEndpointpublishServiceEndpoints) {
		return getDelegate().removeAndPublish(removeServiceIdspublishServiceEndpoints);
	public boolean updateStatus(String serviceIdServiceEndpointStatus statusthrows RiceIllegalArgumentException {
		return getDelegate().updateStatus(serviceIdstatus);
		return getDelegate().updateStatuses(serviceIdsstatus);
	public void takeInstanceOffline(String instanceId)
		// double-checked locking idiom - see Effective Java, Item 71
		ServiceRegistry internalDelegate = this.;
		if (internalDelegate == null) {
			synchronized () {
				internalDelegate = this.;
				if (internalDelegate == null) {
					this. = internalDelegate = initializeRemoteServiceRegistry();
		return internalDelegate;
		if (StringUtils.isBlank(registryBootstrapUrl)) {
			throw new RiceRuntimeException("Failed to load registry bootstrap service from url: " + registryBootstrapUrl);
        boolean registrySecurity = ConfigContext.getCurrentContextConfig().getBooleanProperty(true);
		// Set security interceptors
		clientFactory.getOutInterceptors().add(new CXFWSS4JOutInterceptor(registrySecurity));
		clientFactory.getInInterceptors().add(new CXFWSS4JInInterceptor(registrySecurity));
        //Set transformation interceptors
        clientFactory.getInInterceptors().add(new ImmutableCollectionsInInterceptor());
		Object service = clientFactory.create();
		if (!(service instanceof ServiceRegistry)) {
			throw new RiceRuntimeException("Endpoint to service registry at URL '" + registryBootstrapUrl + "' was not an instance of ServiceRegistry, instead was: " + service);
		return (ServiceRegistry)service;
New to GrepCode? Check out our FAQ X