Package: OsgiServiceHolder

OsgiServiceHolder

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2008, 2010 VMware Inc.
3: * All rights reserved. This program and the accompanying materials
4: * are made available under the terms of the Eclipse Public License v1.0
5: * which accompanies this distribution, and is available at
6: * http://www.eclipse.org/legal/epl-v10.html
7: *
8: * Contributors:
9: * VMware Inc. - initial contribution
10: *******************************************************************************/
11:
12: package org.eclipse.virgo.kernel.osgi.framework;
13:
14: import org.osgi.framework.ServiceReference;
15:
16: /**
17: * An <code>OsgiServiceHolder</code> holds a service retrieved from the OSGi service registry and a
18: * <code>ServiceReference</code> for the held service.
19: * <p />
20: * An <code>OsgiServiceHolder</code> is {@link Comparable} and uses the encapsulated {@link ServiceReference}. to
21: * determine its ordering.
22: *
23: * <strong>Concurrent Semantics</strong><br />
24: *
25: * Implementations must be thread-safe.
26: *
27: * @param <T> Type of service to hold
28: */
29: public interface OsgiServiceHolder<T> extends Comparable<OsgiServiceHolder<?>> {
30:
31: T getService();
32:
33: ServiceReference<T> getServiceReference();
34: }