Package aQute.bnd.testing
Class DSTestWiring
- java.lang.Object
-
- aQute.bnd.testing.DSTestWiring
-
public class DSTestWiring extends java.lang.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
Nested Classes Modifier and Type Class Description class
DSTestWiring.Component<T>
A representation of a component.static class
DSTestWiring.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> T
get(java.lang.Class<T> c)
void
setContext(org.osgi.framework.BundleContext context)
void
wire()
-
-
-
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)
-
-