org.ops4j.pax.exam.rbc.internal
Interface RemoteBundleContext

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
RemoteBundleContextImpl

public interface RemoteBundleContext
extends java.rmi.Remote

Remote BundleContext like access.

Since:
0.3.0, December 10, 2008
Author:
Alin Dreghiciu (adreghiciu@gmail.com)

Field Summary
static long NO_WAIT
          Timeout specifing that there should be no waiting.
static long WAIT_FOREVER
          Timeout specifing that it should wait forever.
 
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<?>[] methodParamTypes, 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.
 

Field Detail

NO_WAIT

static final long NO_WAIT
Timeout specifing that there should be no waiting.

See Also:
Constant Field Values

WAIT_FOREVER

static final long WAIT_FOREVER
Timeout specifing that it should wait forever.

See Also:
Constant Field Values
Method Detail

remoteCall

java.lang.Object remoteCall(java.lang.Class<?> serviceType,
                            java.lang.String methodName,
                            java.lang.Class<?>[] methodParamTypes,
                            long timeoutInMillis,
                            java.lang.Object... actualParams)
                            throws java.rmi.RemoteException,
                                   NoSuchServiceException,
                                   java.lang.NoSuchMethodException,
                                   java.lang.IllegalAccessException,
                                   java.lang.reflect.InvocationTargetException
Makes a remote call on a service.

Parameters:
serviceType - service class of the remote service
methodName - method name
methodParamTypes - method parameters types
timeoutInMillis - timeout for looking up the service
actualParams - actual parameters (must match the given method params)
Returns:
remote call rsult
Throws:
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 invocation
java.rmi.RemoteException - - Remote communication related exception (mandatory by RMI)

installBundle

long installBundle(java.lang.String bundleUrl)
                   throws java.rmi.RemoteException,
                          org.osgi.framework.BundleException
Installs a bundle remotly.

Parameters:
bundleUrl - url of the bundle to be installed. The url must be accessible from the remote OSGi container.
Returns:
bundle id of the installed bundle
Throws:
java.rmi.RemoteException - - Remote communication related exception (mandatory by RMI)
org.osgi.framework.BundleException - - Re-thrown from installing the bundle

installBundle

long installBundle(java.lang.String bundleLocation,
                   byte[] bundle)
                   throws java.rmi.RemoteException,
                          org.osgi.framework.BundleException
Installs a bundle remotly given the bundle content.

Parameters:
bundleLocation - bundle location
bundle - bundle content as a byte array
Returns:
bundle id of the installed bundle
Throws:
java.rmi.RemoteException - - Remote communication related exception (mandatory by RMI)
org.osgi.framework.BundleException - - Re-thrown from installing the bundle

startBundle

void startBundle(long bundleId)
                 throws java.rmi.RemoteException,
                        org.osgi.framework.BundleException
Starts a bundle.

Parameters:
bundleId - id of the bundle to be started
Throws:
java.rmi.RemoteException - - Remote communication related exception (mandatory by RMI)
org.osgi.framework.BundleException - - Re-thrown from starting the bundle

stopBundle

void stopBundle(long bundleId)
                throws java.rmi.RemoteException,
                       org.osgi.framework.BundleException
Stops a bundle.

Parameters:
bundleId - id of the bundle to be stopped
Throws:
java.rmi.RemoteException - - Remote communication related exception (mandatory by RMI)
org.osgi.framework.BundleException - - Re-thrown from stopping the bundle

setBundleStartLevel

void setBundleStartLevel(long bundleId,
                         int startLevel)
                         throws java.rmi.RemoteException,
                                org.osgi.framework.BundleException
Sets bundle start level.

Parameters:
bundleId - id of the bundle to which the start level should be set
startLevel - bundle start level
Throws:
java.rmi.RemoteException - - Remote communication related exception (mandatory by RMI)
org.osgi.framework.BundleException - - If bundle level cannot be set

waitForState

void waitForState(long bundleId,
                  int state,
                  long timeoutInMillis)
                  throws java.rmi.RemoteException,
                         org.osgi.framework.BundleException,
                         TimeoutException
Waits for a bundle to be in a certain state and returns.

Parameters:
bundleId - bundle id
state - expected state
timeoutInMillis - max time to wait for state
Throws:
java.rmi.RemoteException - - Remote communication related exception (mandatory by RMI)
org.osgi.framework.BundleException - - If bundle cannot be found
TimeoutException - - if timeout occured and expected state has not being reached


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.