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;
public final class RemoteService {
	private final ServiceInfo serviceInfo;
	private final Object endpointAcquisitionLock = new Object();
	private volatile Endpoint endpoint;
	public RemoteService(ServiceInfo serviceInfoServiceRegistry serviceRegistry) {
		if (serviceRegistry == null) {
			throw new IllegalArgumentException("serviceRegistry cannot be null");
		this. = serviceInfo;
		this. = serviceRegistry;
	private static void validateServiceInfo(ServiceInfo serviceInfo) {
		if (serviceInfo == null) {
			throw new IllegalArgumentException("serviceInfo cannot be null");
		if (serviceInfo.getServiceId() == null) {
			throw new IllegalArgumentException("serviceInfo must have a serviceId but was null");
	public QName getServiceName() {
		return ;
	public Endpoint getEndpoint() {
		// double-checked locking idiom - see Effective Java, Item 71
		Endpoint internalEndpoint = this.;
		if (internalEndpoint == null) {
			synchronized () {
				internalEndpoint = this.;
				if (internalEndpoint == null) {
					this. = internalEndpoint = new LazyEndpoint(constructServiceConfiguration()); 
		return internalEndpoint;
		if (serviceDescriptor == null) {
			throw new IllegalStateException("Failed to locate ServiceDescriptor for ServiceInfo with serviceDescriptorId=" + .getServiceDescriptorId());
else if (StringUtils.isBlank(serviceDescriptor.getDescriptor())) {
			throw new IllegalStateException("ServiceDescriptor descriptor value is blank or null for descriptor with serviceEndpointId=" + .getServiceId());
		return ServiceConfigurationSerializationHandler.unmarshallFromXml(serviceDescriptor.getDescriptor());
    public boolean equals(Object obj) {
		if (!(obj instanceof RemoteService)) {
			return false;
    public int hashCode() {
        return .hashCode();
New to GrepCode? Check out our FAQ X