|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ops4j.pax.exam.rbc.internal.RemoteBundleContextImpl
public class RemoteBundleContextImpl
RemoteBundleContext
implementaton.
Field Summary |
---|
Fields inherited from interface org.ops4j.pax.exam.rbc.internal.RemoteBundleContext |
---|
NO_WAIT, WAIT_FOREVER |
Constructor Summary | |
---|---|
RemoteBundleContextImpl(org.osgi.framework.BundleContext bundleContext)
Constructor. |
Method Summary | |
---|---|
long |
installBundle(java.lang.String bundleUrl)
Installs a bundle remotly. |
long |
installBundle(java.lang.String bundleLocation,
byte[] bundle)
Installs a bundle remotly given the bundle content. |
java.lang.Object |
remoteCall(java.lang.Class<?> serviceType,
java.lang.String methodName,
java.lang.Class<?>[] methodParams,
long timeoutInMillis,
java.lang.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 |
waitForState(long bundleId,
int state,
long timeoutInMillis)
Waits for a bundle to be in a certain state and returns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RemoteBundleContextImpl(org.osgi.framework.BundleContext bundleContext)
bundleContext
- bundle context (cannot be null)
java.lang.IllegalArgumentException
- - If bundle context is nullMethod Detail |
---|
public java.lang.Object remoteCall(java.lang.Class<?> serviceType, java.lang.String methodName, java.lang.Class<?>[] methodParams, long timeoutInMillis, java.lang.Object... actualParams) throws NoSuchServiceException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
remoteCall
in interface RemoteBundleContext
serviceType
- service class of the remote servicemethodName
- method namemethodParams
- method parameters typestimeoutInMillis
- timeout for looking up the serviceactualParams
- actual parameters (must match the given method params)
NoSuchServiceException
- - If a service of the specified type cannot be located
java.lang.NoSuchMethodException
- - If the given method cannot be found
java.lang.IllegalAccessException
- - Specified method cannot be accessed
java.lang.reflect.InvocationTargetException
- - Wraps an eventual exception occured during method invocationpublic long installBundle(java.lang.String bundleUrl) throws org.osgi.framework.BundleException
installBundle
in interface RemoteBundleContext
bundleUrl
- 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(java.lang.String bundleLocation, byte[] bundle) throws org.osgi.framework.BundleException
installBundle
in interface RemoteBundleContext
bundleLocation
- bundle locationbundle
- bundle content as a byte array
org.osgi.framework.BundleException
- - Re-thrown from installing the bundlepublic void startBundle(long bundleId) throws org.osgi.framework.BundleException
startBundle
in interface RemoteBundleContext
bundleId
- id of the bundle to be started
org.osgi.framework.BundleException
- - Re-thrown from starting the bundlepublic void stopBundle(long bundleId) throws org.osgi.framework.BundleException
stopBundle
in interface RemoteBundleContext
bundleId
- id of the bundle to be stopped
org.osgi.framework.BundleException
- - Re-thrown from stopping the bundlepublic void setBundleStartLevel(long bundleId, int startLevel) throws java.rmi.RemoteException, org.osgi.framework.BundleException
setBundleStartLevel
in interface RemoteBundleContext
bundleId
- id of the bundle to which the start level should be setstartLevel
- bundle start level
java.rmi.RemoteException
- - Remote communication related exception (mandatory by RMI)
org.osgi.framework.BundleException
- - If bundle level cannot be setpublic void waitForState(long bundleId, int state, long timeoutInMillis) throws TimeoutException
waitForState
in interface RemoteBundleContext
bundleId
- bundle idstate
- expected statetimeoutInMillis
- max time to wait for state
TimeoutException
- - if timeout occured and expected state has not being reached
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |