Package aQute.bnd.testing
Class DSTestWiring
- java.lang.Object
-
- aQute.bnd.testing.DSTestWiring
-
public class DSTestWiring extends java.lang.ObjectIntended 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
Nested Classes Modifier and Type Class Description classDSTestWiring.Component<T>A representation of a component.static classDSTestWiring.Reference
-
Constructor Summary
Constructors Constructor Description DSTestWiring()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> DSTestWiring.Component<T>add(java.lang.Class<T> type)DSTestWiring.Component<?>add(java.lang.String cname)Add the class by name.<T> DSTestWiring.Component<T>add(T instance)<T> Tget(java.lang.Class<T> c)voidsetContext(org.osgi.framework.BundleContext context)voidwire()
-
-
-
Method Detail
-
setContext
public void setContext(org.osgi.framework.BundleContext context)
-
wire
public void wire() throws java.lang.Exception- Throws:
java.lang.Exception
-
add
public <T> DSTestWiring.Component<T> add(java.lang.Class<T> type) throws java.lang.Exception
- Throws:
java.lang.Exception
-
add
public DSTestWiring.Component<?> add(java.lang.String cname) throws java.lang.ClassNotFoundException, java.lang.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:
java.lang.ClassNotFoundException- if not foundjava.lang.Exception- if something goes wrong
-
add
public <T> DSTestWiring.Component<T> add(T instance) throws java.lang.Exception
- Throws:
java.lang.Exception
-
get
public <T> T get(java.lang.Class<T> c)
-
-