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 http://www.opensource.org/licenses/ecl2.php 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;
 
 
 
 public final class LocalService {
 	
 	private final Endpoint endpoint;
 	private final ServiceEndpoint serviceEndpoint;
 	
 	LocalService(String instanceIdServiceDefinition serviceDefinition) {
 		this(instanceIdserviceDefinitionnull);
 	}
 	
 	LocalService(String instanceIdServiceDefinition serviceDefinitionServiceEndpoint serviceEndpoint) {
 		if (StringUtils.isBlank(instanceId)) {
 			throw new IllegalArgumentException("instanceId was blank or null");
 		}
 		if (serviceDefinition == null) {
 			throw new IllegalArgumentException("serviceDefinition was null");
 		}
 		this. = serviceDefinition;
 		this. = serviceDefinition.establishEndpoint();
 		if (serviceEndpoint != null) {
 			this. = serviceEndpoint;
 		} else {
 			this. = constructServiceEndpoint(instanceIdthis.);
 		}
 	}
 	
 	LocalService(LocalService currentLocalServiceServiceEndpoint newServiceEndpoint) {
 		this(newServiceEndpoint.getInfo().getInstanceId(), currentLocalService.getServiceDefinition(), newServiceEndpoint);
 	}
 	
 	public QName getServiceName() {
 	}
 		
 	}
 	
 	public Endpoint getEndpoint() {
 		return ;
 	}
 	
 		return this.;
 	}
 		
 	static ServiceEndpoint constructServiceEndpoint(String instanceIdEndpoint endpoint) {
 		ServiceInfo.Builder serviceInfo = constructServiceInfo(instanceIdendpoint.getServiceConfiguration());
 		ServiceEndpoint.Builder builder = ServiceEndpoint.Builder.create(serviceInfoserviceDescriptor);
 		return builder.build();
 	}
 	
 	static ServiceInfo.Builder constructServiceInfo(String instanceIdServiceConfiguration serviceConfiguration) {
 		ServiceInfo.Builder builder = ServiceInfo.Builder.create();
 		builder.setInstanceId(instanceId);
 		builder.setApplicationId(serviceConfiguration.getApplicationId());
 		builder.setChecksum(ChecksumUtils.calculateChecksum(serviceConfiguration));
 		builder.setEndpointUrl(serviceConfiguration.getEndpointUrl().toExternalForm());
 		builder.setServerIpAddress(RiceUtilities.getIpNumber());
		builder.setServiceName(serviceConfiguration.getServiceName());
		builder.setServiceVersion(serviceConfiguration.getServiceVersion());
		builder.setType(serviceConfiguration.getType());
		return builder;
	}
		ServiceDescriptor.Builder builder = ServiceDescriptor.Builder.create();
		builder.setDescriptor(ServiceConfigurationSerializationHandler.marshallToXml(serviceConfiguration));
		return builder;
	}
New to GrepCode? Check out our FAQ X