/** * Event handler for the reactor init event * @param event The proton event object */ @Override public void onReactorInit(Event event) { // You can use the connection method to create AMQP connections. // This connection's handler is the AmqpSendHandler object. All the events // for this connection will go to the AmqpSendHandler object instead of // going to the reactor. If you were to omit the AmqpSendHandler object, // all the events would go to the reactor. // Codes_SRS_SERVICE_SDK_JAVA_AMQPRECEIVE_12_002: [The event handler shall set the member AmqpsReceiveHandler object to handle the given connection events] event.getReactor().connection(amqpReceiveHandler); }
/** * Event handler for the reactor init event * @param event The proton event object */ @Override public void onReactorInit(Event event) { // You can use the connection method to create AMQP connections. // This connection's handler is the AmqpSendHandler object. All the events // for this connection will go to the AmqpSendHandler object instead of // going to the reactor. If you were to omit the AmqpSendHandler object, // all the events would go to the reactor. // Codes_SRS_SERVICE_SDK_JAVA_AMQPSEND_12_003: [The event handler shall set the member AmqpsSendHandler object to handle the given connection events] event.getReactor().connection(amqpSendHandler); }
/** * Event handler for the reactor init event * @param event The proton event object */ @Override public void onReactorInit(Event event) { // You can use the connection method to create AMQP connections. // This connection's handler is the AmqpSendHandler object. All the events // for this connection will go to the AmqpSendHandler object instead of // going to the reactor. If you were to omit the AmqpSendHandler object, // all the events would go to the reactor. // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVE_25_002: [The event handler shall set the member AmqpsReceiveHandler object to handle the given connection events] event.getReactor().connection(amqpReceiveHandler); }
@Override public void run(Selectable selectable) { Reactor reactor = selectable.getReactor(); try { SocketChannel socketChannel = ((ServerSocketChannel)selectable.getChannel()).accept(); if (socketChannel == null) { throw new ReactorInternalException("Selectable readable, but no socket to accept"); } Handler handler = BaseHandler.getHandler(AcceptorImpl.this); if (handler == null) { handler = reactor.getHandler(); } Connection conn = reactor.connection(handler); Transport trans = Proton.transport(); Sasl sasl = trans.sasl(); sasl.server(); sasl.setMechanisms("ANONYMOUS"); sasl.done(SaslOutcome.PN_SASL_OK); trans.bind(conn); IOHandler.selectableTransport(reactor, socketChannel.socket(), trans); } catch(IOException ioException) { sel.error(); } } }
handler = reactor.getHandler(); Connection conn = reactor.connection(handler); Record conn_recs = conn.attachments(); conn_recs.set(CONNECTION_ACCEPTOR_KEY, Acceptor.class, AcceptorImpl.this);