本文整理汇总了Java中org.osgi.service.cm.ManagedServiceFactory类的典型用法代码示例。如果您正苦于以下问题:Java ManagedServiceFactory类的具体用法?Java ManagedServiceFactory怎么用?Java ManagedServiceFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ManagedServiceFactory类属于org.osgi.service.cm包,在下文中一共展示了ManagedServiceFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void start(final BundleContext context) throws Exception {
this.context = context;
// ensure we receive configurations for the proxy selector
final Hashtable<String, Object> props = new Hashtable<String, Object>();
props.put(Constants.SERVICE_PID, getName());
props.put(Constants.SERVICE_VENDOR, context.getBundle().getHeaders(Constants.BUNDLE_VENDOR));
props.put(Constants.SERVICE_DESCRIPTION, SERVICE_FACTORY_NAME);
configurator = context.registerService(ManagedServiceFactory.class.getName(), this, props);
clientFactory = context.registerService(HttpClientBuilderFactory.class.getName(),
new OSGiClientBuilderFactory(context, registeredConfigurations, trackedHttpClients),
props);
}
示例2: registerService
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
private void registerService() {
synchronized (monitor) {
Dictionary props = new Hashtable(2);
props.put(Constants.SERVICE_PID, factoryPid);
configurationWatcher =
bundleContext.registerService(ManagedServiceFactory.class.getName(), new ConfigurationWatcher(),
props);
}
}
示例3: start
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
Hashtable<String, Object> props = new Hashtable<>();
props.put(Constants.SERVICE_VENDOR, "AdeptJ");
props.put(Constants.SERVICE_PID, InfinispanCacheProvider.SERVICE_PID);
props.put(Constants.SERVICE_DESCRIPTION, "AdeptJ Modules Infinispan Cache Factory");
this.infinispanCacheProvider = new InfinispanCacheProvider();
this.svcReg = context.registerService(
new String[] { ManagedServiceFactory.class.getName(), CacheProvider.class.getName() },
this.infinispanCacheProvider, props);
}
示例4: start
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
Hashtable<String, Object> props = new Hashtable<>();
props.put(Constants.SERVICE_VENDOR, "AdeptJ");
// SERVICE_PID should match the name property of the @Component annotation on EhcacheCacheProvider.
// Otherwise ConfigurationAdmin won't be able to bind the factory configuration.
props.put(Constants.SERVICE_PID, EhcacheCacheProvider.FACTORY_PID);
props.put(Constants.SERVICE_DESCRIPTION, "AdeptJ Modules Ehcache Cache Factory");
this.cacheMgr = CacheManagerBuilder.newCacheManagerBuilder().build(true);
this.svcReg = context.registerService(
new String[] { ManagedServiceFactory.class.getName(), CacheProvider.class.getName() },
new EhcacheCacheProvider(this.cacheMgr), props);
}
示例5: start
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
Hashtable<String, Object> props = new Hashtable<>();
props.put(Constants.SERVICE_VENDOR, "AdeptJ");
props.put(Constants.SERVICE_PID, HazelcastCacheProvider.FACTORY_PID);
props.put(Constants.SERVICE_DESCRIPTION, "AdeptJ Modules Hazelcast CacheProvider");
this.hazelcastCacheProvider = new HazelcastCacheProvider(context);
this.hazelcastCacheProvider.open();
this.svcReg = context.registerService(
new String[] { ManagedServiceFactory.class.getName(), CacheProvider.class.getName() },
this.hazelcastCacheProvider, props);
}
示例6: start
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
Hashtable<String, Object> props = new Hashtable<>();
props.put(Constants.SERVICE_VENDOR, "AdeptJ");
props.put(Constants.SERVICE_PID, GeodeCacheProvider.SERVICE_PID);
props.put(Constants.SERVICE_DESCRIPTION, "AdeptJ OSGi CacheProvider Factory");
this.svcReg = context.registerService(
new String[] { ManagedServiceFactory.class.getName(), CacheProvider.class.getName() },
new GeodeCacheProvider(), props);
}
示例7: start
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
public void start(BundleContext context) {
ConfigDiscovery configDiscovery = new ConfigDiscovery();
listenerTracker = new EPListenerTracker(context, configDiscovery);
listenerTracker.open();
Hashtable<String, Object> props = new Hashtable<>();
props.put(Constants.SERVICE_PID, FACTORY_PID);
registration = context.registerService(ManagedServiceFactory.class, configDiscovery, props);
}
示例8: init
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void init() {
Dictionary properties = new Properties();
properties.put( Constants.SERVICE_PID, "camelinaction.fileinventoryroutefactory");
registration = bundleContext.registerService(ManagedServiceFactory.class.getName(), this, properties);
LOG.info("FileInventoryRouteCamelServiceFactory ready to accept " +
"new config with PID=camelinaction.fileinventoryroutefactory-xxx");
}
示例9: SensorNodeDriverFactory
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
/**
*
* Create the SensorNode factory instance. register this one in the framework as a ManagedServiceFactory so that
* it will receive factory instances configuration.
*
*/
SensorNodeDriverFactory() {
// create a new hastable that will contain references to all the sensorNodedDriver services.
sensorNodeDrivers = new Hashtable<String, SensorNodeDriver>();
// register the class as a service factory.
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put( Constants.SERVICE_PID, this.getClass().getName());
sReg = Activator.bc.registerService(ManagedServiceFactory.class.getName(),
this, properties );
Activator.log(LogService.LOG_INFO, "Registered " + SensorNodeDriverFactory.class.getName()
+ " as " + ManagedServiceFactory.class.getName());
}
示例10: SensorNodeFactory
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
/**
* Register the class instance as a ManagedServiceFactory.
*/
public SensorNodeFactory() {
// create a new hastable that will contain references to all the sensorNode services.
sensorNodes = new Hashtable<String, SensorNode>();
// register the class as a service factory.
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put( Constants.SERVICE_PID, this.getClass().getName());
sensorNodesFactoryReg = Activator.bc.registerService(ManagedServiceFactory.class.getName(),this, properties );
Activator.log(LogService.LOG_INFO, "Registered " + SensorNodeFactory.class.getName()
+ " as " + ManagedServiceFactory.class.getName());
}
示例11: ModbusDeviceFactory
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
/**
* Create a new ModbusDeviceFactory instance. Register the class instance as a ManagedServiceFactory.
* The class will be recognised as such by the framework allowing it to pass on configuration data.
*
* @throws Exception
*/
public ModbusDeviceFactory() throws Exception {
// create a new hastable that will contain references to all the ModbusDevice modules.
modbusDevServices = new Hashtable<String, ModbusDevice>();
// register the class as a service factory.
Hashtable properties = new Hashtable();
properties.put( Constants.SERVICE_PID, "com.ptoceti.osgi.modbusdevice.ModbusDeviceFactory");
modbusDevFactoryReg = Activator.bc.registerService(ManagedServiceFactory.class.getName(),
this, properties );
Activator.log(LogService.LOG_INFO, "Registered " + ModbusDeviceFactory.class.getName()
+ " as " + ManagedServiceFactory.class.getName() + ", Pid = " + (String)properties.get(Constants.SERVICE_PID));
}
示例12: ModbusDriverFactory
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
/**
* Create a new ModbusDriverFactory instance. Register the class instance as a ManagedServiceFactory.
* The class will be recognised as such by the framework allowing it to pass on configuration data.
*
* @throws Exception
*/
public ModbusDriverFactory() throws Exception {
// create a new hastable that will contain references to all the modbusdriver services.
modbusDrivers = new Hashtable();
// register the class as a service factory.
Hashtable properties = new Hashtable();
properties.put( Constants.SERVICE_PID, this.getClass().getName());
modbusDriverFactoryReg = Activator.bc.registerService(ManagedServiceFactory.class.getName(),
this, properties );
Activator.log(LogService.LOG_INFO, "Registered " + ModbusDriverFactory.class.getName()
+ " as " + ManagedServiceFactory.class.getName());
}
示例13: MqttClientFactory
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
public MqttClientFactory() {
mqttClients = new Hashtable<String, MqttClientWrapper>();
// register the class as a service factory.
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put( Constants.SERVICE_PID, this.getClass().getName());
mqttClientFactoryReg = Activator.bc.registerService(ManagedServiceFactory.class.getName(),this, properties );
Activator.log(LogService.LOG_INFO, "Registered " + MqttClientFactory.class.getName()
+ " as " + ManagedServiceFactory.class.getName());
}
示例14: registerService
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
private void registerService() {
synchronized (monitor) {
Dictionary props = new Hashtable(2);
props.put(Constants.SERVICE_PID, factoryPid);
configurationWatcher = bundleContext.registerService(ManagedServiceFactory.class.getName(),
new ConfigurationWatcher(), props);
}
}
示例15: start
import org.osgi.service.cm.ManagedServiceFactory; //导入依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
context.addBundleListener(this);
Dictionary<String,String> props = new Hashtable<String,String>();
props.put(Constants.SERVICE_PID, XOManagerFactory.FACTORY_PID);
serviceFactory = new XOManagerFactoryServiceFactory(context);
serviceFactoryRegistration = context.registerService(ManagedServiceFactory.class, serviceFactory, props);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("ConfigAdmin listener registered");
}
}