public class

RemoteBundleContextImpl

extends Object
implements Serializable RemoteBundleContext
java.lang.Object
   ↳ org.ops4j.pax.exam.rbc.internal.RemoteBundleContextImpl

Class Overview

RemoteBundleContext implementaton.

Summary

[Expand]
Inherited Constants
From interface org.ops4j.pax.exam.rbc.internal.RemoteBundleContext
Public Constructors
RemoteBundleContextImpl(BundleContext bundleContext)
Constructor.
Public Methods
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, 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, RelativeTimeout timeout)
Waits for a bundle to be in a certain state and returns.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.ops4j.pax.exam.rbc.internal.RemoteBundleContext

Public Constructors

public RemoteBundleContextImpl (BundleContext bundleContext)

Constructor.

Parameters
bundleContext bundle context (cannot be null)
Throws
IllegalArgumentException - If bundle context is null

Public Methods

public long installBundle (String bundleUrl)

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
BundleException

public long installBundle (String bundleLocation, byte[] bundle)

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
BundleException

public Object remoteCall (Class<?> serviceType, String methodName, Class[]<?> methodParams, String filter, RelativeTimeout timeout, Object... actualParams)

Makes a remote call on a service.

Parameters
serviceType service class of the remote service
methodName method name
methodParams method parameters types
timeout timeout for looking up the service
actualParams actual parameters (must match the given method params)
Returns
  • remote call rsult
Throws
NoSuchServiceException
NoSuchMethodException
IllegalAccessException
InvocationTargetException

public void setBundleStartLevel (long bundleId, int startLevel)

Sets bundle start level.

Parameters
bundleId id of the bundle to which the start level should be set
startLevel bundle start level
Throws
RemoteException
BundleException

public void startBundle (long bundleId)

Starts a bundle.

Parameters
bundleId id of the bundle to be started
Throws
BundleException

public void stopBundle (long bundleId)

Stops a bundle.

Parameters
bundleId id of the bundle to be stopped
Throws
BundleException

public void uninstallBundle (long id)

Throws
BundleException

public void waitForState (long bundleId, int state, RelativeTimeout timeout)

Waits for a bundle to be in a certain state and returns.

Parameters
bundleId bundle id
state expected state