org.jboss.osgi.testing.internal
Class EmbeddedRuntime

java.lang.Object
  extended by org.jboss.osgi.testing.internal.OSGiRuntimeImpl
      extended by org.jboss.osgi.testing.internal.EmbeddedRuntime
All Implemented Interfaces:
OSGiRuntime

public class EmbeddedRuntime
extends OSGiRuntimeImpl

An embedded implementation of the OSGiRuntime

Since:
25-Sep-2008
Author:
Thomas.Diesler@jboss.org

Constructor Summary
EmbeddedRuntime(OSGiRuntimeHelper helper)
           
 
Method Summary
 void addCapability(Capability capability)
          Add a Capability to the runtime.
 OSGiBundle getBundle(long bundleId)
          Get the OSGiBundle for a given bundle id.
 OSGiBundle[] getBundles()
          Get the array of installed OSGiBundles
static MBeanServer getLocalMBeanServer()
           
 MBeanServerConnection getMBeanServer()
          Get the MBeanServerConnection for this OSGiRuntime
 OSGiServiceReference getServiceReference(String clazz)
          Returns a ServiceReference object for a service that implements and was registered under the specified class.
 OSGiServiceReference[] getServiceReferences(String clazz, String filter)
          Returns an array of ServiceReference objects.
 boolean isRemoteRuntime()
          Return true if this OSGiRuntime connects to a remote Framework.
 void shutdown()
          Shutdown the OSGiRuntime.
 
Methods inherited from class org.jboss.osgi.testing.internal.OSGiRuntimeImpl
getBundle, getBundleStateMBean, getClipboardMBean, getFrameworkMBean, getInitialContext, getMBeanProxy, getPackageStateMBean, getServerHost, getServiceReference, getServiceStateMBean, getTestHelper, installBundle, installBundle, installBundle, removeCapability
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedRuntime

public EmbeddedRuntime(OSGiRuntimeHelper helper)
Method Detail

getLocalMBeanServer

public static MBeanServer getLocalMBeanServer()

getBundles

public OSGiBundle[] getBundles()
Description copied from interface: OSGiRuntime
Get the array of installed OSGiBundles


getBundle

public OSGiBundle getBundle(long bundleId)
Description copied from interface: OSGiRuntime
Get the OSGiBundle for a given bundle id.

Returns:
The bundle or null if there is none

getServiceReference

public OSGiServiceReference getServiceReference(String clazz)
Description copied from interface: OSGiRuntime
Returns a ServiceReference object for a service that implements and was registered under the specified class.

Returns:
A ServiceReference object, or null if no services are registered which implement the named class.

getServiceReferences

public OSGiServiceReference[] getServiceReferences(String clazz,
                                                   String filter)
Description copied from interface: OSGiRuntime
Returns an array of ServiceReference objects. The returned array of ServiceReference objects contains services that were registered under the specified class and match the specified filter criteria.


addCapability

public void addCapability(Capability capability)
                   throws org.osgi.framework.BundleException
Description copied from interface: OSGiRuntime
Add a Capability to the runtime. Adding a capability recursively adds the orderded set of dependent capabilities before it installs and starts the orderded set bundles.

Specified by:
addCapability in interface OSGiRuntime
Overrides:
addCapability in class OSGiRuntimeImpl
Throws:
org.osgi.framework.BundleException

shutdown

public void shutdown()
Description copied from interface: OSGiRuntime
Shutdown the OSGiRuntime. This will remove all installed OSGiBundles and added Capability.

Specified by:
shutdown in interface OSGiRuntime
Overrides:
shutdown in class OSGiRuntimeImpl

getMBeanServer

public MBeanServerConnection getMBeanServer()
Description copied from interface: OSGiRuntime
Get the MBeanServerConnection for this OSGiRuntime


isRemoteRuntime

public boolean isRemoteRuntime()
Description copied from interface: OSGiRuntime
Return true if this OSGiRuntime connects to a remote Framework.



Copyright © 2010. All Rights Reserved.