public DescriptorBuilder with(String key, String value){ if(key == null || value == null){ throw new NullPointerException(); } myFilters.add(OSGiUtils.createFilter(key, value)); return this; }
public DescriptorBuilder with(Properties props){ if(props == null){ throw new NullPointerException(); } for(Entry e : props.entrySet()){ myFilters.add(OSGiUtils.createFilter( e.getKey().toString(), e.getValue().toString())); } return this; } /**
private static List<DependencyDescriptor> buildDescriptorList(SceneSpec spec){ List<String> chanURIs = getRequiredChannelURIs(spec); List<DependencyDescriptor> descriptors = new ArrayList<DependencyDescriptor>(); for(String uri : chanURIs){ descriptors.add(new DependencyDescriptor(uri, Channel.class, OSGiUtils.createFilter(ChannelBindingLifecycle.URI_PROPERTY_NAME, uri), DependencyType.REQUIRED)); } return descriptors; }
private static List<DependencyDescriptor> buildDescriptorList(SceneSpec spec){ List<String> chanURIs = getRequiredChannelURIs(spec); List<DependencyDescriptor> descriptors = new ArrayList<DependencyDescriptor>(); for(String uri : chanURIs){ descriptors.add(new DependencyDescriptor(uri, Channel.class, OSGiUtils.createFilter(ChannelBindingLifecycle.URI_PROPERTY_NAME, uri), DependencyType.REQUIRED)); } return descriptors; }
private boolean uniquePropertiesAvailable(){ if(myUniqueProperties == null){ return true; } for(Entry e : myUniqueProperties.entrySet()){ String key = e.getKey().toString(); String val = e.getValue().toString(); String filter = OSGiUtils.createFilter(key, val); if(OSGiUtils.serviceExists( myContext, myRegistrationClassNames, filter)){ getLogger().warn("Unique service property already in use: ({}={}).", key, val); return false; } } return true; }
public static void test(BundleContext context){ Properties sceProps = new Properties(); sceProps.put("ServiceChannelExtenderId", "svc_chan_ext_19"); final ServiceChannelExtender sce = new ServiceChannelExtender(context, OSGiUtils.createFilter("ChannelBindingGroupId", "chan_bind_grp_19"), sceProps); Runnable sceRun = new Runnable() { @Override public void run() { Properties sseProps = new Properties(); sseProps.put("SceneSpecExtenderId", "scene_spec_ext_19"); final SceneSpecExtender sse = new SceneSpecExtender(context, OSGiUtils.createFilter("SceneSpecGroupId", "scene_spec_grp_19"), sseProps); Runnable sseRun = new Runnable() { @Override public void run() { String speechTestFilterString = OSGiUtils.createFilter(SpeechService.PROP_ID, "testService"); bindingConfig.initExplicitly(ChannelType.SPEECH_BLOCK_OUT, "fakeURI", speechTestFilterString);
public static void test(BundleContext context){ Properties sceProps = new Properties(); sceProps.put("ServiceChannelExtenderId", "svc_chan_ext_19"); final ServiceChannelExtender sce = new ServiceChannelExtender(context, OSGiUtils.createFilter("ChannelBindingGroupId", "chan_bind_grp_19"), sceProps); Runnable sceRun = new Runnable() { @Override public void run() { Properties sseProps = new Properties(); sseProps.put("SceneSpecExtenderId", "scene_spec_ext_19"); final SceneSpecExtender sse = new SceneSpecExtender(context, OSGiUtils.createFilter("SceneSpecGroupId", "scene_spec_grp_19"), sseProps); Runnable sseRun = new Runnable() { @Override public void run() { String speechTestFilterString = OSGiUtils.createFilter(SpeechService.PROP_ID, "testService"); bindingConfig.initExplicitly(ChannelType.SPEECH_BLOCK_OUT, "fakeURI", speechTestFilterString);
public DynamixelTracker(final OpenServoControlLoop osLoop){ BundleContext context = OSGiUtils.getBundleContext(ServoController.class); myTracker = new SingleServiceListener<ServoController>( ServoController.class, context, OSGiUtils.createFilter(ServoController.PROP_VERSION, DynamixelController.VERSION.toString())); myTracker.addPropertyChangeListener(SingleServiceListener.PROP_SERVICE_TRACKED, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { DynamixelController controller = (DynamixelController)evt.getNewValue(); if(controller == null){ throw new IllegalArgumentException(); } DynamixelControlLoop loop = controller.getControlLoop(); if(loop == null){ throw new IllegalArgumentException(); } loop.setOpenServoLoop(osLoop); } }); myTracker.start(); }
regs[2] = registerJointSnapshotAdder(context, robotId); if(!OSGiUtils.serviceExists(context, RemoteAnimationPlayerClient.class, OSGiUtils.createFilter( AnimationPlayer.PROP_PLAYER_ID, robot.getRobotId().getRobtIdString()))){
confRefs = context.getAllServiceReferences( Configuration.class.getName(), OSGiUtils.createFilter( RKMessagingConfigUtils.JMS_CONNECTION_CONFIG, connectionConfigId));