DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Gliffy Diagram | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Code Example
...
| Code Block |
|---|
public class Activator extends DependencyActivatorBase {
public void init(BundleContext context, DependencyManager manager) throws Exception {
manager.add(createComponent()
.setInterface(UserStore.class, new Properties() {{ put("store.id", "users"); }})
.setImplementation(UserStoreImpl.class)
.add(createServiceDependency()
.setService(Store.class)
.setRequired(true)
)
.add(createServiceDependency()
.setService(LogService.class)
.setRequired(false)
)
);
}
public void destroy(BundleContext context, DependencyManager manager) throws Exception {}
}
|
Aspect Service
Provides an aspect on top of a specific type of service.
...
| Gliffy Diagram | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Code Example
...
| Code Block |
|---|
public class Activator extends DependencyActivatorBase {
public void init(BundleContext context, DependencyManager manager) throws Exception {
manager.add(createAspectService(Manageable.class, "(monitor=true)", 50)
.setImplementation(ManageableMonitor.class)
);
}
public void destroy(BundleContext context, DependencyManager manager) throws Exception {}
}
public interface Manageable {
public void setProperty(String key, String value);
}
public class ManageableMonitor implements Manageable {
private volatile Manageable m_manageable;
public void setProperty(String key, String value) {
System.out.println("Someone set " + key + " to " + value);
m_manageable.setProperty(key, value);
}
}
|
Adapter Service
Provides an adapter for a specific type of service.
...
| Gliffy Diagram | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Code Example
...
| Code Block |
|---|
public class Activator extends DependencyActivatorBase {
public void init(BundleContext context, DependencyManager manager) throws Exception {
manager.add(createAdapterService(Manageable.class, "(publish=servlet)")
.setInterface(HttpServlet.class.getName(), null)
.setImplementation(ManageableServlet.class)
);
}
public void destroy(BundleContext context, DependencyManager manager) throws Exception {}
}
public interface Manageable {
public void setProperty(String key, String value);
}
public class ManageableServlet implements HttpServlet {
private volatile Manageable m_manageable;
public void doPost(HttpRequest req, HttpResponse response) {
String key = req.getProperty("key");
String value = req.getProperty("value");
m_manageable.setProperty(key, value);
}
}
|
Resource Adapter Service
Provides an adapter for a specific type of resource.
...
| Gliffy Diagram | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Temporal Dependency
...