当前位置: 首页>>代码示例>>Java>>正文


Java ManagedServiceFactory类代码示例

本文整理汇总了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);
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:19,代码来源:HttpProxyConfigurationActivator.java

示例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);
	}
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:11,代码来源:ManagedServiceFactoryFactoryBean.java

示例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);
}
 
开发者ID:AdeptJ,项目名称:adeptj-modules,代码行数:12,代码来源:InfinispanActivator.java

示例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);
}
 
开发者ID:AdeptJ,项目名称:adeptj-modules,代码行数:14,代码来源:EhcacheActivator.java

示例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);
}
 
开发者ID:AdeptJ,项目名称:adeptj-modules,代码行数:13,代码来源:HazelcastActivator.java

示例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);
}
 
开发者ID:AdeptJ,项目名称:adeptj-modules,代码行数:11,代码来源:GeodeActivator.java

示例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);
}
 
开发者ID:apache,项目名称:aries-rsa,代码行数:9,代码来源:Activator.java

示例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");
}
 
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:10,代码来源:FileInventoryServiceFactory.java

示例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());
}
 
开发者ID:lathil,项目名称:Ptoceti,代码行数:19,代码来源:SensorNodeDriverFactory.java

示例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());
}
 
开发者ID:lathil,项目名称:Ptoceti,代码行数:15,代码来源:SensorNodeFactory.java

示例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));
}
 
开发者ID:lathil,项目名称:Ptoceti,代码行数:19,代码来源:ModbusDeviceFactory.java

示例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());
}
 
开发者ID:lathil,项目名称:Ptoceti,代码行数:19,代码来源:ModbusDriverFactory.java

示例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());
	
}
 
开发者ID:lathil,项目名称:Ptoceti,代码行数:13,代码来源:MqttClientFactory.java

示例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);
	}
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:10,代码来源:ManagedServiceFactoryFactoryBean.java

示例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");
    }
}
 
开发者ID:buschmais,项目名称:extended-objects,代码行数:12,代码来源:XOUnitBundleListener.java


注:本文中的org.osgi.service.cm.ManagedServiceFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。