/** * Creates a message bus visitor destination session. * * @param params the parameters for the visitor destination session * @param bus the message bus to use */ public MessageBusVisitorDestinationSession(VisitorDestinationParameters params, MessageBus bus) { this.params = params; session = bus.createDestinationSession(params.getSessionName(), true, this); params.getDataHandler().setSession(this); }
/** * Called from the constructor to ensure control and data handlers * are set and initialized. */ private void initializeHandlers() { if (this.params.getLocalDataHandler() != null) { this.params.getLocalDataHandler().reset(); this.params.getLocalDataHandler().setSession(this); } else if (this.params.getRemoteDataHandler() == null) { this.params.setLocalDataHandler(new VisitorDataQueue()); this.params.getLocalDataHandler().setSession(this); } if (params.getControlHandler() != null) { params.getControlHandler().reset(); } else { params.setControlHandler(new VisitorControlHandler()); } params.getControlHandler().setSession(this); }