public class RemoteBundleContextImpl extends Object implements RemoteBundleContext, Serializable
RemoteBundleContext implementaton.NO_WAIT, WAIT_FOREVER| Constructor and Description |
|---|
RemoteBundleContextImpl(org.osgi.framework.BundleContext bundleContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
installBundle(String bundleUrl)
Installs a bundle remotly.
|
long |
installBundle(String bundleLocation,
byte[] bundle)
Installs a bundle remotly given the bundle content.
|
Object |
remoteCall(Class<?> serviceType,
String methodName,
Class<?>[] methodParams,
String filter,
org.ops4j.pax.exam.RelativeTimeout timeout,
Object... actualParams)
Makes a remote call on a service.
|
void |
setBundleStartLevel(long bundleId,
int startLevel)
Sets bundle start level.
|
void |
startBundle(long bundleId)
Starts a bundle.
|
void |
stopBundle(long bundleId)
Stops a bundle.
|
void |
uninstallBundle(long id) |
void |
waitForState(long bundleId,
int state,
org.ops4j.pax.exam.RelativeTimeout timeout)
Waits for a bundle to be in a certain state and returns.
|
public RemoteBundleContextImpl(org.osgi.framework.BundleContext bundleContext)
bundleContext - bundle context (cannot be null)IllegalArgumentException - - If bundle context is nullpublic Object remoteCall(Class<?> serviceType, String methodName, Class<?>[] methodParams, String filter, org.ops4j.pax.exam.RelativeTimeout timeout, Object... actualParams) throws NoSuchServiceException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
RemoteBundleContextremoteCall in interface RemoteBundleContextserviceType - service class of the remote servicemethodName - method namemethodParams - method parameters typesfilter - service filtertimeout - timeout for looking up the serviceactualParams - actual parameters (must match the given method params)NoSuchServiceException - - If a service of the specified type cannot be locatedNoSuchMethodException - - If the given method cannot be foundIllegalAccessException - - Specified method cannot be accessedInvocationTargetException - - Wraps an eventual exception occured during method invocationpublic long installBundle(String bundleUrl) throws org.osgi.framework.BundleException
RemoteBundleContextinstallBundle in interface RemoteBundleContextbundleUrl - url of the bundle to be installed. The url must be accessible from the remote OSGi
container.org.osgi.framework.BundleException - - Re-thrown from installing the bundlepublic long installBundle(String bundleLocation, byte[] bundle) throws org.osgi.framework.BundleException
RemoteBundleContextinstallBundle in interface RemoteBundleContextbundleLocation - bundle locationbundle - bundle content as a byte arrayorg.osgi.framework.BundleException - - Re-thrown from installing the bundlepublic void uninstallBundle(long id)
throws org.osgi.framework.BundleException
uninstallBundle in interface RemoteBundleContextid - of bundle to uninstallorg.osgi.framework.BundleException - - If bundle cannot be foundpublic void startBundle(long bundleId)
throws org.osgi.framework.BundleException
RemoteBundleContextstartBundle in interface RemoteBundleContextbundleId - id of the bundle to be startedorg.osgi.framework.BundleException - - Re-thrown from starting the bundlepublic void stopBundle(long bundleId)
throws org.osgi.framework.BundleException
RemoteBundleContextstopBundle in interface RemoteBundleContextbundleId - id of the bundle to be stoppedorg.osgi.framework.BundleException - - Re-thrown from stopping the bundlepublic void setBundleStartLevel(long bundleId,
int startLevel)
throws RemoteException,
org.osgi.framework.BundleException
RemoteBundleContextsetBundleStartLevel in interface RemoteBundleContextbundleId - id of the bundle to which the start level should be setstartLevel - bundle start levelRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - If bundle level cannot be setpublic void waitForState(long bundleId,
int state,
org.ops4j.pax.exam.RelativeTimeout timeout)
RemoteBundleContextwaitForState in interface RemoteBundleContextbundleId - bundle idstate - expected statetimeout - max time to wait for stateCopyright © 2006–2016 OPS4J - Open Participation Software for Java. All rights reserved.