@Override public void run() { Properties props = null; if(key != null){ props = new Properties(); props.put(key, val); } new OSGiComponent(context, new SimpleLifecycle(obj, clazz, props)).start(); } };
@Override public void run() { Properties props = null; if(key != null){ props = new Properties(); props.put(key, val); } new OSGiComponent(context, new SimpleLifecycle(obj, clazz, props)).start(); } };
private static ServiceLifecycleProvider getBindingConfigLifecycle( String paramId, File file){ Properties props = new Properties(); props.put(Constants.CONFIG_PARAM_ID, paramId); props.put(Constants.CONFIG_FORMAT_VERSION, VisemeBindingManagerAvroConfigLoader.VERSION.toString()); props.put("FilePath", file.getAbsolutePath()); ServiceLifecycleProvider lifecycle = new SimpleLifecycle(file, File.class, props); return lifecycle; }
private static ServiceLifecycleProvider getBindingConfigStreamLifecycle( String paramId, InputStream stream){ Properties props = new Properties(); props.put(Constants.CONFIG_PARAM_ID, paramId); props.put(Constants.CONFIG_FORMAT_VERSION, VisemeBindingManagerConfigAvroStreamLoader.VERSION.toString()); ServiceLifecycleProvider lifecycle = new SimpleLifecycle(stream, InputStream.class, props); return lifecycle; } }
private static ServiceLifecycleProvider<FrameCombiner> buildFrameCombinerLauncher(Robot.Id robotId){ Properties props = new Properties(); props.put(Robot.PROP_ID, robotId.getRobtIdString()); props.put(Blender.PROP_POSITION_MAP_TYPE, RobotPositionMap.class.getName()); return new SimpleLifecycle<FrameCombiner>( getFrameCombiner(), FrameCombiner.class, props); }
public static ManagedService startComponent(BundleContext context, String[] classNames, Object service, Properties serviceProperties){ if(context == null || service == null){ throw new NullPointerException(); } SimpleLifecycle lifecycle = new SimpleLifecycle(service, classNames, null); OSGiComponent comp = new OSGiComponent(context, lifecycle, serviceProperties); comp.start(); return comp; }
protected static OSGiComponent launchJointGroupConfig(BundleContext context, File jointGroupConfigXML, String configFileId){ Properties props = new Properties(); props.put(Constants.CONFIG_PARAM_ID, configFileId); props.put(Constants.CONFIG_FORMAT_VERSION, RobotJointGroupConfigXMLReader.VERSION.toString()); ServiceLifecycleProvider lifecycle = new SimpleLifecycle( jointGroupConfigXML, File.class, props); OSGiComponent paramComp = new OSGiComponent(context, lifecycle); paramComp.start(); return paramComp; }
public static ManagedService startUniqueComponent(BundleContext context, String[] classNames, Object service, Properties uniqueProps, Properties serviceProperties){ if(context == null || service == null){ throw new NullPointerException(); } SimpleLifecycle lifecycle = new SimpleLifecycle(service, classNames, null); OSGiComponent comp = new OSGiComponent( context, lifecycle, serviceProperties, uniqueProps, true); comp.start(); return comp; }
private static OSGiComponent launchJointGroupConfig( BundleContext context, File file, String paramId){ Properties props = new Properties(); props.put(Constants.CONFIG_PARAM_ID, paramId); props.put(Constants.CONFIG_FORMAT_VERSION, RobotJointGroupConfigXMLReader.VERSION.toString()); ServiceLifecycleProvider lifecycle = new SimpleLifecycle(file, File.class, props); OSGiComponent paramComp = new OSGiComponent(context, lifecycle); paramComp.start(); return paramComp; }
private static OSGiComponent launchRobotConfig( BundleContext context, File file, String paramId){ Properties props = new Properties(); props.put(Constants.CONFIG_PARAM_ID, paramId); props.put(Constants.CONFIG_FORMAT_VERSION, RobotConfigXMLReader.VERSION.toString()); ServiceLifecycleProvider lifecycle = new SimpleLifecycle(file, File.class, props); OSGiComponent paramComp = new OSGiComponent(context, lifecycle); paramComp.start(); return paramComp; } }
private static ServiceLifecycleProvider<FrameSourceTracker> buildFrameSourceTrackerLauncher( BundleContext context, Robot.Id robotId){ Properties props = new Properties(); props.put(Robot.PROP_ID, robotId.getRobtIdString()); OSGiFrameSourceTracker tracker = new OSGiFrameSourceTracker(); tracker.init(context, OSGiUtils.createServiceFilter(props)); props.put(Blender.PROP_POSITION_MAP_TYPE, RobotPositionMap.class.getName()); return new SimpleLifecycle<FrameSourceTracker>( tracker, FrameSourceTracker.class, props); }
public static SimpleLifecycle buildSimpleLifecycle( Configuration<String> conf){ String[] availableClassNames = conf.getPropertyValue(String[].class, CONF_SERVICE_CLASSES); Properties props = conf.getPropertyValue(Properties.class, CONF_SERVICE_PROPERTIES); Object service = conf.getPropertyValue(CONF_SIMPLE_LIFECYCLE_SERVICE); if(availableClassNames == null || service == null){ throw new NullPointerException(); } return new SimpleLifecycle(service, availableClassNames, props); }
private static <Param> OSGiComponent launchJointGroupConfig( BundleContext context, Param jointGroupConfigParam, Class<Param> paramClass, String configParamId, Configuration<String> jgSvcConf){ Properties props = new Properties(); props.put(Constants.CONFIG_PARAM_ID, configParamId); props.put(Constants.CONFIG_FORMAT_VERSION, get(VersionProperty.class, jgSvcConf, CONF_CONFIG_READER_VERSION).toString()); ServiceLifecycleProvider lifecycle = new SimpleLifecycle( jointGroupConfigParam, paramClass, props); OSGiComponent paramComp = new OSGiComponent(context, lifecycle); paramComp.start(); startedJointGroupConfigs.add(paramComp); return paramComp; }
private static <Param> OSGiComponent launchJointGroupConfig( BundleContext context, Param jointGroupConfigParam, Class<Param> paramClass, String configParamId, Configuration<String> jgSvcConf){ Properties props = new Properties(); props.put(Constants.CONFIG_PARAM_ID, configParamId); props.put(Constants.CONFIG_FORMAT_VERSION, get(VersionProperty.class, jgSvcConf, CONF_CONFIG_READER_VERSION).toString()); ServiceLifecycleProvider lifecycle = new SimpleLifecycle( jointGroupConfigParam, paramClass, props); OSGiComponent paramComp = new OSGiComponent(context, lifecycle); paramComp.start(); startedJointGroupConfigs.add(paramComp); return paramComp; }
private void registerSignalFactory(BundleContext context){ if(OSGiUtils.serviceExists( context, AnimationSignal.AnimationSignalFactory.class, null)){ return; } new OSGiComponent(context, new SimpleLifecycle( new PortableAnimationSignal.Factory(), AnimationSignal.AnimationSignalFactory.class) ).start(); } }
private static void registerEventFactory(BundleContext context){ if(OSGiUtils.serviceExists(context, AnimationEvent.AnimationEventFactory.class, null)){ return; } new OSGiComponent(context, new SimpleLifecycle( new PortableAnimationEvent.Factory(), AnimationEventFactory.class) ).start(); }
@Override public void start(BundleContext context) throws Exception { theLogger.info("Launching JMS SpeechService Provider."); launchVisemeNotifier(context, SPEECH_SERVICE_ID); launchRemoteClient(context, SPEECH_SERVICE_ID, SPEECH_SERVICE_ID, CONNECTION_ID, COMMAND_DEST_ID, COMMAND_SENDER_ID, CONFIG_DEST_ID, CONFIG_SENDER_ID, ERROR_DEST_ID, ERROR_RECEIVER_ID, REQUEST_DEST_ID, REQUEST_SENDER_ID, EVENT_DEST_ID, EVENT_RECEIVER_ID); new OSGiComponent(context, new SimpleLifecycle(new PortableSpeechRequest.Factory(), SpeechRequestFactory.class)).start(); }
@Override public void start(BundleContext context) throws Exception { //connectMotion(context); connectSpeech(context); connectAnimation(context); connectVision(context); new OSGiComponent(context, new SimpleLifecycle(new PortableServiceCommand.Factory(), ServiceCommandFactory.class)).start(); }
public static void startCogCharAmbassadors(BundleContext context) { // Connect a CogCharNetworkConfigAmbassador as a (no lifecycle) managed service, so lifter can use it ServiceLifecycleProvider ambassadorCycle = new SimpleLifecycle(new CogCharNetworkConfigAmbassador(), WebappNetworkConfigHandle.class); OSGiComponent cncaComp = new OSGiComponent(context, ambassadorCycle); cncaComp.start(); } }
@Override protected void handleFrameworkStartedEvent(BundleContext context) { com.hp.hpl.jena.rdf.model.Model jenaServiceModel = RDFDataMgr.loadModel(SERVICE_MODEL_PATH); Model model2go = new org.ontoware.rdf2go.impl.jena.ModelImplJena(jenaServiceModel); model2go.open(); MessageWiring2Go msg = new MessageWiring2Go(getInfModel(MSG_MODEL_PATH, SVC_MSG_ONTOLOGY_MODEL_PATH)); msg.loadMsgServices(context); Test2Go test = new Test2Go(); Properties props = new Properties(); props.put("bundleContext", "http://www.w3.org/2002/07/owl#bundleContextSpec"); ManagedService ms = new OSGiComponent(context, new SimpleLifecycle(context, BundleContext.class), props); ms.start(); test.registerServiceManagerEntites(model2go); test.startSpecExtender(context, null, model2go); }