/** * Creates a new lifecycle provider for a VisemeEventNotifier which uses * the given SpeechService. * @param speechServiceId SpeechService for the VisemeEventNotifier to use */ public VisemeBindingManagerLifecycle(Properties registrationProps){ super(new DescriptorListBuilder() .dependency(theVisemeConfig, VisemeBindingManagerConfig.class) .with(registrationProps) .getDescriptors()); myRegistrationProperties = new Properties(); myRegistrationProperties.putAll(registrationProps); }
private DescriptorListBuilder finish(){ myListBuilder.getDescriptors().add(getDescriptor()); return myListBuilder; } }
/** * Begins building a DependencyDescriptor with the give name and class. * By default the DependencyType is REQUIRED. Call optional() * @param name * @param clazz */ public DescriptorBuilder(String name, Class clazz){ this(new DescriptorListBuilder(), name, clazz, DependencyType.REQUIRED); }
@Override public DescriptorBuilder dependency(String name, Class clazz){ return finish().dependency(name, clazz); }
/** * Creates a new lifecycle provider for a VisemeEventNotifier which uses * the given SpeechService. * @param speechServiceId SpeechService for the VisemeEventNotifier to use */ public VisemeEventNotifierLifecycle(String speechServiceId){ super(new DescriptorListBuilder() .dependency(theSpeechService, SpeechService.class) .with(SpeechService.PROP_ID, speechServiceId) .getDescriptors()); myRegistrationProperties = new Properties(); myRegistrationProperties.put( SpeechService.PROP_ID, speechServiceId); }
@Override public List<DependencyDescriptor> getDescriptors(){ return finish().getDescriptors(); }
public RobotOutputLifecycle(Robot.Id robotId){ super(new DescriptorListBuilder() .dependency(theRobot, Robot.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .getDescriptors()); if(myRegistrationProperties == null){ myRegistrationProperties = new Properties(); } myRegistrationProperties.put(Robot.PROP_ID, robotId.getRobtIdString()); myRegistrationProperties.put(Blender.PROP_POSITION_MAP_TYPE, RobotPositionMap.class.getName()); }
public RemoteRobotLifecycle(Robot.Id robotId){ super(new DescriptorListBuilder() .dependency(theRobotClient, RemoteRobotClient.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .getDescriptors()); if(robotId == null){ throw new NullPointerException(); } if(myRegistrationProperties == null){ myRegistrationProperties = new Properties(); } myRegistrationProperties.put(Robot.PROP_ID, robotId.getRobtIdString()); myServiceClassNames = new String[]{ Robot.class.getName(), RemoteRobot.class.getName() }; }
public RobotMoveHandlerLifecycle(String moveHandlerId, Robot.Id robotId){ super(new DescriptorListBuilder() .dependency(theRobot, Robot.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .getDescriptors()); if(moveHandlerId == null){ throw new NullPointerException(); } myRegistrationProperties = new Properties(); myRegistrationProperties.put(Robot.PROP_ID, robotId.getRobtIdString()); myRegistrationProperties.put(ListenerConstants.PROP_LISTENER_ID, moveHandlerId); myRegistrationProperties.put(ListenerConstants.PROP_LISTENER_TYPE, MotionFrameEvent.class.getName()); myRegistrationProperties.put(Blender.PROP_POSITION_MAP_TYPE, Robot.RobotPositionMap.class.getName()); myServiceClassNames = new String[]{ Listener.class.getName(), FrameSource.class.getName() }; }
public VisemeFrameSourceLifecycle( Robot.Id robotId, String speechServiceId){ super(new DescriptorListBuilder() .dependency(theVisemeNotifier, VisemeEventNotifier.class) .with(SpeechService.PROP_ID, speechServiceId) .dependency(theVisemeManager, VisemeBindingManager.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .getDescriptors()); if(robotId == null || speechServiceId == null){ throw new NullPointerException(); } myRobotId = robotId; myRegistrationProperties = new Properties(); myRegistrationProperties.put( Robot.PROP_ID, myRobotId); }
public RobotBlenderLifecycle(Robot.Id robotId){ super(new DescriptorListBuilder() .dependency(theBlenderOutputId, BlenderOutput.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .with(Blender.PROP_POSITION_MAP_TYPE, Robot.RobotPositionMap.class.getName()) .dependency(theFrameCombinerId, FrameCombiner.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .with(Blender.PROP_POSITION_MAP_TYPE, Robot.RobotPositionMap.class.getName()) .getDescriptors()); if(myRegistrationProperties == null){ myRegistrationProperties = new Properties(); } myRegistrationProperties.put(Robot.PROP_ID, robotId.getRobtIdString()); myRegistrationProperties.put(Blender.PROP_POSITION_MAP_TYPE, RobotPositionMap.class.getName()); }
public RobotChannelsLifecycle(Robot.Id robotId){ super(new DescriptorListBuilder() .dependency(theRobot, Robot.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .dependency(theJointGroup, JointGroup.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .optional() .getDescriptors()); if(myRegistrationProperties == null){ myRegistrationProperties = new Properties(); } myRegistrationProperties.put(Robot.PROP_ID, robotId.getRobtIdString()); }
private List<DependencyDescriptor> makeDepDescList(ChannelBindingConfig cbc) { /* was in lifecycleconstructor first line: * super(new DescriptorListBuilder() //The name "service" is used only within the lifecycle .dependency("service", conf.getChannelType().getServiceClass()).with(conf.getOSGiFilterString()) .getDescriptors()); */ DescriptorListBuilder firstListBuilder = new DescriptorListBuilder(); //The name "service" is used only within the lifecycle ChannelBindingConfig.ChannelType chanType = cbc.getChannelType(); Class depClazz = chanType.getServiceClass(); String osgiFilter = cbc.getOSGiFilterString(); // This serviceName is used only within the lifecycle String serviceName = ChannelBindingLifecycle.SERVICE_DEP_KEY; // "service"; DescriptorBuilder firstDBuilder = firstListBuilder.dependency(serviceName, depClazz); DescriptorBuilder secondDBuilder = firstDBuilder.with(osgiFilter); List<DependencyDescriptor> finishedList = secondDBuilder.getDescriptors(); return finishedList; }
private List<DependencyDescriptor> makeDepDescList(ChannelBindingConfig cbc) { /* was in lifecycleconstructor first line: * super(new DescriptorListBuilder() //The name "service" is used only within the lifecycle .dependency("service", conf.getChannelType().getServiceClass()).with(conf.getOSGiFilterString()) .getDescriptors()); */ DescriptorListBuilder firstListBuilder = new DescriptorListBuilder(); //The name "service" is used only within the lifecycle ChannelBindingConfig.ChannelType chanType = cbc.getChannelType(); Class depClazz = chanType.getServiceClass(); String osgiFilter = cbc.getOSGiFilterString(); // This serviceName is used only within the lifecycle String serviceName = ChannelBindingLifecycle.SERVICE_DEP_KEY; // "service"; DescriptorBuilder firstDBuilder = firstListBuilder.dependency(serviceName, depClazz); DescriptorBuilder secondDBuilder = firstDBuilder.with(osgiFilter); List<DependencyDescriptor> finishedList = secondDBuilder.getDescriptors(); return finishedList; }
public RemoteSpeechServiceHostLifecycle( String speechServiceHostId, String remoteId, String speechServiceId, String speechRequestNotifierId, String speechEventListenerId){ super(new DescriptorListBuilder() .dependency(theSpeechService, SpeechService.class) .with(SpeechService.PROP_ID, speechServiceId) .dependency(theSpeechRequestNotifier, Notifier.class) .with(Constants.PROP_MESSAGE_RECEIVER_ID, speechRequestNotifierId) .with(Constants.PROP_MESSAGE_TYPE, SpeechRequest.class.getName()) .dependency(theSpeechEventListener, Listener.class) .with(Constants.PROP_MESSAGE_SENDER_ID, speechEventListenerId) .with(Constants.PROP_MESSAGE_TYPE, SpeechEventList.class.getName()) .getDescriptors()); if(speechServiceHostId == null || remoteId == null){ throw new NullPointerException(); } myLocalServiceId = speechServiceHostId; myRemoteServiceId = remoteId; myRegistrationProperties = new Properties(); myRegistrationProperties.put( RemoteSpeechServiceHost.PROP_ID, myLocalServiceId); }
public TimedBlenderDriverLifecycle( Robot.Id robotId, long blenderIntervalMillisec){ super(new DescriptorListBuilder() .dependency(theBlender, Blender.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .with(Blender.PROP_POSITION_MAP_TYPE, Robot.RobotPositionMap.class.getName()) .dependency(theFrameTracker, FrameSourceTracker.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .with(Blender.PROP_POSITION_MAP_TYPE, Robot.RobotPositionMap.class.getName()) .getDescriptors()); myBlenderInterval = blenderIntervalMillisec; if(myRegistrationProperties == null){ myRegistrationProperties = new Properties(); } myRegistrationProperties.put(Robot.PROP_ID, robotId.getRobtIdString()); }
String errorReceiverId, String requestSenderId, String eventsReceiverId){ super(new DescriptorListBuilder() .dependency(theCommandSender, MessageSender.class) .with(Constants.PROP_MESSAGE_SENDER_ID, commandSenderId) .with(Constants.PROP_MESSAGE_RECEIVER_ID, eventsReceiverId) .with(Constants.PROP_MESSAGE_TYPE, SpeechRecEventList.class.getName()) .dependency(theCommandFactory, ServiceCommandFactory.class) .getDescriptors()); if(speechRecServiceId == null || remoteId == null){
public RemoteRobotClientLifecycle(String sourceId, String destId, Robot.Id robotId, String reqSenderId, String respReceiverId, String frameSenderId){ super(new DescriptorListBuilder() .dependency(theRequestSender, MessageSender.class) .with(Constants.PROP_MESSAGE_SENDER_ID, reqSenderId) .with(Constants.PROP_MESSAGE_TYPE, RobotRequest.class.getName()) .dependency(theResponseReceiver, MessageBlockingReceiver.class) .with(Constants.PROP_MESSAGE_RECEIVER_ID, respReceiverId) .with(Constants.PROP_MESSAGE_TYPE, RobotResponse.class.getName()) .dependency(theFrameSender, MessageSender.class) .with(Constants.PROP_MESSAGE_SENDER_ID, frameSenderId) .with(Constants.PROP_MESSAGE_TYPE, MotionFrameEvent.class.getName()) .dependency(theRequestFactory, RobotRequestFactory.class) .dependency(theFrameEventFactory, MotionFrameEventFactory.class) .getDescriptors()); if(sourceId == null || destId == null || robotId == null){ throw new NullPointerException(); } mySourceId = sourceId; myDestId = destId; myRobotId = robotId; if(myRegistrationProperties == null){ myRegistrationProperties = new Properties(); } myRegistrationProperties.put(Robot.PROP_ID, robotId.getRobtIdString()); }
String errorReceiverId, String requestSenderId, String eventsReceiverId){ super(new DescriptorListBuilder() .dependency(theCommandSender, MessageSender.class) .with(Constants.PROP_MESSAGE_SENDER_ID, commandSenderId) .with(Constants.PROP_MESSAGE_RECEIVER_ID, eventsReceiverId) .with(Constants.PROP_MESSAGE_TYPE, SpeechEventList.class.getName()) .dependency(theRequestFactory, SpeechRequestFactory.class) .getDescriptors()); if(speechServiceId == null || remoteId == null){
public RemoteRobotHostLifecycle(String sourceId, String destId, Robot.Id robotId, String reqReceiverId, String respSenderId, String frameReceiverId, String moveHandlerId){ super(new DescriptorListBuilder() .dependency(theRobot, Robot.class) .with(Robot.PROP_ID, robotId.getRobtIdString()) .dependency(theRequestReceiver, MessageAsyncReceiver.class) .with(Constants.PROP_MESSAGE_RECEIVER_ID, reqReceiverId) .with(Constants.PROP_MESSAGE_TYPE, RobotRequest.class.getName()) .dependency(theResponseSender, MessageSender.class) .with(Constants.PROP_MESSAGE_SENDER_ID, respSenderId) .with(Constants.PROP_MESSAGE_TYPE, RobotResponse.class.getName()) .dependency(theFrameReceiver, MessageAsyncReceiver.class) .with(Constants.PROP_MESSAGE_RECEIVER_ID, frameReceiverId) .with(Constants.PROP_MESSAGE_TYPE, MotionFrameEvent.class.getName()) .dependency(theMoveHandler, Listener.class) .with(ListenerConstants.PROP_LISTENER_ID, moveHandlerId) .with(ListenerConstants.PROP_LISTENER_TYPE, MotionFrameEvent.class.getName()) .dependency(theResponseFactory, RobotResponseFactory.class) .getDescriptors()); if(sourceId == null || destId == null){ throw new NullPointerException(); } mySourceId = sourceId; myDestId = destId; }