org.glassfish.fighterfish.test.util
Class OSGiUtil
java.lang.Object
org.glassfish.fighterfish.test.util.OSGiUtil
public class OSGiUtil
- extends java.lang.Object
- Author:
- Sanjeeb.Sahoo@Sun.COM
|
Method Summary |
static
|
getService(org.osgi.framework.BundleContext ctx,
java.lang.Class<T> type)
|
static
|
getService(org.osgi.framework.BundleContext ctx,
java.lang.Class<T> type,
long timeout)
|
static java.lang.Object |
waitForService(org.osgi.framework.BundleContext ctx,
org.osgi.framework.Bundle b,
java.lang.String service,
long timeout)
Wait for a specified amount of time for a service of a given type to be made available by a given bundle. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OSGiUtil
public OSGiUtil()
getService
public static <T> T getService(org.osgi.framework.BundleContext ctx,
java.lang.Class<T> type)
getService
public static <T> T getService(org.osgi.framework.BundleContext ctx,
java.lang.Class<T> type,
long timeout)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
waitForService
public static java.lang.Object waitForService(org.osgi.framework.BundleContext ctx,
org.osgi.framework.Bundle b,
java.lang.String service,
long timeout)
throws java.lang.InterruptedException
- Wait for a specified amount of time for a service of a given type to be made available by a given bundle.
- Parameters:
ctx - BundleContext that should be used to track the serviceb - Bundle registering the serviceservice - FQN of the service typetimeout - no of milliseconds to wait for the service to be available before returning null
- Returns:
- a reference to the service being tracked
- Throws:
java.lang.InterruptedException
Copyright © 2013. All Rights Reserved.