fr.velossity.sample.device.Device.getType()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中fr.velossity.sample.device.Device.getType()方法的一些代码示例,展示了Device.getType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.getType()方法的具体详情如下:
包路径:fr.velossity.sample.device.Device
类名称:Device
方法名:getType

Device.getType介绍

暂无

代码示例

代码示例来源:origin: fr.velossity.osgi/ServiceProvider

/**
 * @see BundleActivator#start(BundleContext)
 */
public void start(BundleContext context) throws Exception {
  
  // Set meta-data properties for the device
  Dictionary<String, String> properties = new Hashtable<String, String>();
  properties.put("type", myDevice.getType());
  
  // PUBLISHES the Device service
  context.registerService(Device.class, myDevice, properties);
}

代码示例来源:origin: fr.velossity.osgi/ServiceProvider2

/**
 * @see BundleActivator#start(BundleContext)
 */
public void start(BundleContext context) throws Exception {
  
  // Set meta-data properties for the device
  Dictionary<String, String> properties = new Hashtable<String, String>();
  properties.put(Device.DEVICE_PROPERTY_IDENTIFIER, myDevice.getIdentifier());
  properties.put(Device.DEVICE_PROPERTY_TYPE, myDevice.getType());
  
  // PUBLISHES the Device service
  context.registerService(Device.class, myDevice, properties);
}

代码示例来源:origin: fr.velossity.osgi/ServiceProvider1

/**
 * @see BundleActivator#start(BundleContext)
 */
public void start(BundleContext context) throws Exception {
  
  // Set meta-data properties for the device
  Dictionary<String, String> properties = new Hashtable<String, String>();
  properties.put(Device.DEVICE_PROPERTY_IDENTIFIER, myDevice.getIdentifier());
  properties.put(Device.DEVICE_PROPERTY_TYPE, myDevice.getType());
  
  // PUBLISHES the Device service
  context.registerService(Device.class, myDevice, properties);
}

代码示例来源:origin: fr.velossity.osgi/NativeAdapter

/**
 * @see ServiceTracker#addingService(ServiceReference)
 */
public ServiceRegistration<Device> addingService(ServiceReference<AdapteeDevice> ref) {
  AdapteeDevice adaptee = context.getService(ref);
  Device adapter = new DeviceAdapterImpl(adaptee);
  
  // REGISTERS with mandatory properties 
  Dictionary<String, String> properties = new Hashtable<String, String>();
  properties.put(Device.DEVICE_PROPERTY_IDENTIFIER, adapter.getIdentifier());
  properties.put(Device.DEVICE_PROPERTY_TYPE, adapter.getType());
  return context.registerService(Device.class, adapter, properties);
}

相关文章