use of java.util.Dictionary in project opennms by OpenNMS.
the class SyslogdReceiverCamelNettyBlueprintIT method addServicesOnStartup.
@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
// Register any mock OSGi services here
final MessageDispatcherFactory messageProducerFactory = mock(MessageDispatcherFactory.class);
final MinionIdentity minionIdentity = mock(MinionIdentity.class);
services.put(MessageDispatcherFactory.class.getName(), new KeyValueHolder<Object, Dictionary>(messageProducerFactory, new Properties()));
services.put(MinionIdentity.class.getName(), new KeyValueHolder<Object, Dictionary>(minionIdentity, new Properties()));
}
use of java.util.Dictionary in project opennms by OpenNMS.
the class LocationAwareDetectorClientIT method addServicesOnStartup.
@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
services.put(MinionIdentity.class.getName(), new KeyValueHolder<Object, Dictionary>(new MinionIdentity() {
@Override
public String getId() {
return "0";
}
@Override
public String getLocation() {
return REMOTE_LOCATION_NAME;
}
}, new Properties()));
Properties props = new Properties();
props.setProperty("alias", "opennms.broker");
services.put(Component.class.getName(), new KeyValueHolder<Object, Dictionary>(queuingservice, props));
services.put(ServiceDetectorRegistry.class.getName(), new KeyValueHolder<Object, Dictionary>(serviceDetectorRegistry, new Properties()));
}
use of java.util.Dictionary in project opennms by OpenNMS.
the class SyslogdReceiverJavaNetBlueprintIT method addServicesOnStartup.
@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
// Register any mock OSGi services here
final MessageDispatcherFactory messageProducerFactory = mock(MessageDispatcherFactory.class);
final MinionIdentity minionIdentity = mock(MinionIdentity.class);
services.put(MessageDispatcherFactory.class.getName(), new KeyValueHolder<Object, Dictionary>(messageProducerFactory, new Properties()));
services.put(MinionIdentity.class.getName(), new KeyValueHolder<Object, Dictionary>(minionIdentity, new Properties()));
}
use of java.util.Dictionary in project jetty.project by eclipse.
the class Activator method start.
/**
*
* @param context
*/
public void start(BundleContext context) throws Exception {
//Create webappA as a Service and target it at the default server
WebAppContext webapp = new WebAppContext();
webapp.addServlet(new ServletHolder(new TestServlet()), "/mime");
Dictionary props = new Hashtable();
props.put("war", "webappA");
props.put("contextPath", "/acme");
props.put("managedServerName", "defaultJettyServer");
_srA = context.registerService(WebAppContext.class.getName(), webapp, props);
//Create a second webappB as a Service and target it at a custom Server
//deployed by another bundle
WebAppContext webappB = new WebAppContext();
Dictionary propsB = new Hashtable();
propsB.put("war", "webappB");
propsB.put("contextPath", "/acme");
propsB.put("managedServerName", "fooServer");
_srB = context.registerService(WebAppContext.class.getName(), webappB, propsB);
}
use of java.util.Dictionary in project aries by apache.
the class BaseManagedServiceFactory method internalDelete.
private void internalDelete(String pid, int code) {
Pair<T, ServiceRegistration> pair = services.remove(pid);
if (pair != null) {
registrations.remove(pair.getSecond());
Dictionary properties = JavaUtils.getProperties(pair.getSecond().getReference());
try {
preUnregister(pair.getFirst(), properties, pair.getSecond());
pair.getSecond().unregister();
} catch (Throwable t) {
LOGGER.info("Error unregistering service", t);
}
try {
doDestroy(pair.getFirst(), properties, code);
} catch (Throwable t) {
LOGGER.info("Error destroying service", t);
}
}
}
Aggregations