001 /**
002 * Copyright 2005-2012 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.ksb.api.bus;
017
018 /**
019 * An {@code Endpoint} contains a reference to the {@link ServiceConfiguration}
020 * for a service as well as a proxy to the service endpoint that can be invoked.
021 *
022 * <p>This service can be cast to the appropriate service interface in order to
023 * invoke the desired operations.
024 */
025 public interface Endpoint {
026
027 /**
028 * Returns the service configuration information for this endpoint.
029 *
030 * @return the service configuration for this endpoint, should never return null
031 */
032 ServiceConfiguration getServiceConfiguration();
033
034 /**
035 * Returns a reference to the service that can be invoked through this
036 * endpoint. This could potentially be a proxy to the service (in the case
037 * that the endpoint is pointing to a remote service) so calling code
038 * should cast this object to the appropriate service interface before
039 * using.
040 *
041 * <p>It is the client's responsibility to ensure that they are casting the
042 * service to the correct interface(s) based on their knowledge of what
043 * interface the service should implement.
044 *
045 * @return a reference to the service object which can be used to invoke
046 * operations against the endpoint, should never return null
047 */
048 Object getService();
049
050 }