aQute.bnd.testing
Class DSTestWiring

java.lang.Object
  extended by aQute.bnd.testing.DSTestWiring

public class DSTestWiring
extends Object

Intended to wire a number components for testing using the DS (from bnd) annotations.

TODO add the OSGi Annotations and support more options. needs cleanup


Nested Class Summary
 class DSTestWiring.Component<T>
          A representation of a component.
static class DSTestWiring.Reference
           
 
Constructor Summary
DSTestWiring()
           
 
Method Summary
<T> DSTestWiring.Component<T>
add(Class<T> type)
           
 DSTestWiring.Component<?> add(String cname)
          Add the class by name.
<T> DSTestWiring.Component<T>
add(T instance)
           
<T> T
get(Class<T> c)
           
 void setContext(org.osgi.framework.BundleContext context)
           
 void wire()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSTestWiring

public DSTestWiring()
Method Detail

setContext

public void setContext(org.osgi.framework.BundleContext context)

wire

public void wire()
          throws Exception
Throws:
Exception

add

public <T> DSTestWiring.Component<T> add(Class<T> type)
                              throws Exception
Throws:
Exception

add

public DSTestWiring.Component<?> add(String cname)
                              throws ClassNotFoundException,
                                     Exception
Add the class by name. If the class cannot be found in the local class loader, and a Bundle Context is specified, try each bundle for that class.

Parameters:
cname - the name of the class
Returns:
the class
Throws:
ClassNotFoundException - if not found
Exception - if something goes wrong

add

public <T> DSTestWiring.Component<T> add(T instance)
                              throws Exception
Throws:
Exception

get

public <T> T get(Class<T> c)


Copyright © 2014 aQute SARL. All rights reserved.