public interface RemoteFramework extends Remote
Framework interface.| Modifier and Type | Field and Description |
|---|---|
static String |
RMI_NAME_KEY
System property key for the name to be used for the remote framework in the
RMI registry.
|
static String |
RMI_PORT_KEY
System property key for RMI registry port.
|
static String |
TIMEOUT_KEY
System property key for the framework shutdown timeout (milliseconds in
decimal representation).
|
| Modifier and Type | Method and Description |
|---|---|
void |
callService(String filter,
String methodName)
Looks up a service matching the given filter and invokes a service method with the given
name.
|
int |
getBundleState(long bundleId)
Returns the state of the bundle with the given ID.
|
RemoteServiceReference[] |
getServiceReferences(String filter)
Fetch an array of
RemoteServiceReference to interact with them, this is a snapshot of
the current state and must be recalled to update |
RemoteServiceReference[] |
getServiceReferences(String filter,
long timeout,
TimeUnit timeUnit)
Fetch an array of
RemoteServiceReference to interact with them, this is a snapshot of
the current state and must be recalled to update |
void |
init()
Initializes the framework.
|
long |
installBundle(String bundleUrl)
Installs a bundle remotely.
|
long |
installBundle(String bundleUrl,
boolean start,
int startLevel)
Installs a bundle remotely, sets its start level and optionally starts it.
|
long |
installBundle(String bundleLocation,
byte[] bundle)
Installs a bundle remotely, given the bundle content.
|
long |
installBundle(String bundleLocation,
byte[] bundleData,
boolean start,
int startLevel)
Installs a bundle remotely, given the bundle content, autostart it if requested and set its
startlevel
|
Object |
invokeMethodOnService(RemoteServiceReference reference,
String methodName,
Class<?>[] parameterTypes,
Object[] args)
Invokes a method on this reference in the remote framework
|
Object |
invokeMethodOnService(RemoteServiceReference reference,
String methodName,
Object... args)
Invokes a method on this reference in the remote framework
|
void |
setBundleStartLevel(long bundleId,
int startLevel)
Sets bundle start level.
|
void |
setFrameworkStartLevel(int startLevel)
Sets the framework startlevel.
|
boolean |
setFrameworkStartLevel(int startLevel,
long timeout)
Sets the framework startlevel and waits for at most the given timeout (in ms) for the
startlevel to be reached.
|
void |
start()
Starts the framework.
|
void |
startBundle(long bundleId)
Starts a bundle.
|
void |
stop()
Stops the framework.
|
void |
stopBundle(long bundleId)
Stops a bundle.
|
void |
uninstallBundle(long id) |
void |
waitForState(long bundleId,
int state,
long timeoutInMillis)
Waits for a bundle to be in a certain state and returns.
|
static final String RMI_PORT_KEY
static final String RMI_NAME_KEY
static final String TIMEOUT_KEY
void init()
throws RemoteException,
org.osgi.framework.BundleException
RemoteExceptionorg.osgi.framework.BundleExceptionFramework#init}void start()
throws RemoteException,
org.osgi.framework.BundleException
RemoteExceptionorg.osgi.framework.BundleExceptionFramework#start}void stop()
throws RemoteException,
org.osgi.framework.BundleException
RemoteExceptionorg.osgi.framework.BundleExceptionFramework#start}long installBundle(String bundleUrl) throws RemoteException, org.osgi.framework.BundleException
bundleUrl - url of the bundle to be installed. The url must be accessible from the
remote framework.RemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - Re-thrown from installing the bundlelong installBundle(String bundleUrl, boolean start, int startLevel) throws RemoteException, org.osgi.framework.BundleException
bundleUrl - url of the bundle to be installed. The url must be accessible from the
remote framework.start - indicates whether the bundle will be startedstartLevel - start level for this bundleRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - Re-thrown from installing the bundlelong installBundle(String bundleLocation, byte[] bundleData, boolean start, int startLevel) throws RemoteException, org.osgi.framework.BundleException
bundleLocation - The location identifier of the bundle to installbundleData - bundle content as a byte arraystart - indicates whether the bundle will be startedstartLevel - start level for this bundleRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - Re-thrown from installing the bundlelong installBundle(String bundleLocation, byte[] bundle) throws RemoteException, org.osgi.framework.BundleException
bundleLocation - The location identifier of the bundle to installbundle - bundle content as a byte arrayRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - Re-thrown from installing the bundlevoid startBundle(long bundleId)
throws RemoteException,
org.osgi.framework.BundleException
bundleId - id of the bundle to be startedRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - Re-thrown from starting the bundlevoid stopBundle(long bundleId)
throws RemoteException,
org.osgi.framework.BundleException
bundleId - id of the bundle to be stoppedRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - Re-thrown from stopping the bundlevoid setBundleStartLevel(long bundleId,
int startLevel)
throws RemoteException,
org.osgi.framework.BundleException
bundleId - 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 setvoid waitForState(long bundleId,
int state,
long timeoutInMillis)
throws RemoteException,
org.osgi.framework.BundleException
bundleId - bundle idstate - expected statetimeoutInMillis - max time to wait for stateRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - If bundle cannot be foundorg.ops4j.pax.exam.TimeoutException - - if timeout occured and expected state has not
being reachedvoid uninstallBundle(long id)
throws RemoteException,
org.osgi.framework.BundleException
id - of bundle to uninstallRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - If bundle cannot be foundvoid callService(String filter, String methodName) throws RemoteException, org.osgi.framework.BundleException
filter - LDAP service filtermethodName - service method nameRemoteException - - Remote communication related exception (mandatory by RMI)org.osgi.framework.BundleException - - If bundle cannot be foundObject invokeMethodOnService(RemoteServiceReference reference, String methodName, Object... args) throws RemoteException, Exception
name - args - RemoteExceptionExceptionObject invokeMethodOnService(RemoteServiceReference reference, String methodName, Class<?>[] parameterTypes, Object[] args) throws RemoteException, Exception
name - args - RemoteExceptionExceptionRemoteServiceReference[] getServiceReferences(String filter) throws RemoteException, org.osgi.framework.BundleException, org.osgi.framework.InvalidSyntaxException
RemoteServiceReference to interact with them, this is a snapshot of
the current state and must be recalled to updatefilter - RemoteExceptionorg.osgi.framework.BundleExceptionorg.osgi.framework.InvalidSyntaxExceptionRemoteServiceReference[] getServiceReferences(String filter, long timeout, TimeUnit timeUnit) throws RemoteException, org.osgi.framework.BundleException, org.osgi.framework.InvalidSyntaxException
RemoteServiceReference to interact with them, this is a snapshot of
the current state and must be recalled to updatefilter - timeout - wait the specified amout of time in relation to the timeunit for a service
matchign the filter to appearRemoteExceptionorg.osgi.framework.BundleExceptionorg.osgi.framework.InvalidSyntaxExceptionvoid setFrameworkStartLevel(int startLevel)
throws RemoteException
startLevel - RemoteExceptionStartLevel#setStartLevel(int)}boolean setFrameworkStartLevel(int startLevel,
long timeout)
throws RemoteException
startLevel - RemoteExceptionStartLevel#setStartLevel(int)}int getBundleState(long bundleId)
throws RemoteException,
org.osgi.framework.BundleException
bundleId - bundle IDRemoteExceptionorg.osgi.framework.BundleException - if there is no bundle with the given IDorg.osgi.framework.Bundle#getState()}Copyright © 2006–2015 OPS4J - Open Participation Software for Java. All rights reserved.