org.osgi.framework.ServiceReference Maven / Gradle / Ivy
/*
* Copyright (c) OSGi Alliance (2000, 2010). All Rights Reserved.
*
* Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
*
* 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.osgi.framework;
import java.util.Dictionary;
/**
* A reference to a service.
*
*
* The Framework returns {@code ServiceReference} objects from the
* {@code BundleContext.getServiceReference} and
* {@code BundleContext.getServiceReferences} methods.
*
* A {@code ServiceReference} object may be shared between bundles and can
* be used to examine the properties of the service and to get the service
* object.
*
* Every service registered in the Framework has a unique
* {@code ServiceRegistration} object and may have multiple, distinct
* {@code ServiceReference} objects referring to it.
* {@code ServiceReference} objects associated with a
* {@code ServiceRegistration} object have the same {@code hashCode}
* and are considered equal (more specifically, their {@code equals()}
* method will return {@code true} when compared).
*
* If the same service object is registered multiple times,
* {@code ServiceReference} objects associated with different
* {@code ServiceRegistration} objects are not equal.
*
* @param Type of Service.
* @see BundleContext#getServiceReference
* @see BundleContext#getServiceReferences
* @see BundleContext#getService
* @ThreadSafe
* @noimplement
* @version $Id: 771b9b4d4f65dbe593154d02912edba51a085b0c $
*/
public interface ServiceReference extends Comparable