public ProtonHandlerImpl(Executor dispatchExecutor) { this.dispatchExecutor = dispatchExecutor; this.creationTime = System.currentTimeMillis(); transport.bind(connection); connection.collect(collector); }
@Override public Connection connection(Handler handler) { Connection connection = Proton.connection(); BaseHandler.setHandler(connection, handler); connection.collect(collector); children.add(connection); ((ConnectionImpl)connection).setReactor(this); return connection; }
public ProtonHandler(Executor flushExecutor, boolean isServer) { this.flushExecutor = flushExecutor; this.readyListener = () -> this.flushExecutor.execute(() -> { flush(); }); this.creationTime = System.currentTimeMillis(); this.isServer = isServer; try { ((TransportInternal) transport).setUseReadOnlyOutputBuffer(false); } catch (NoSuchMethodError nsme) { // using a version at runtime where the optimization isn't available, ignore log.trace("Proton output buffer optimisation unavailable"); } transport.bind(connection); connection.collect(collector); }
public ProtonHandler(EventLoop workerExecutor, ArtemisExecutor poolExecutor, boolean isServer) { this.workerExecutor = workerExecutor; this.poolExecutor = poolExecutor; this.readyListener = () -> runLater(this::flush); this.creationTime = System.currentTimeMillis(); this.isServer = isServer; try { ((TransportInternal) transport).setUseReadOnlyOutputBuffer(false); } catch (NoSuchMethodError nsme) { // using a version at runtime where the optimization isn't available, ignore log.trace("Proton output buffer optimisation unavailable"); } transport.bind(connection); connection.collect(collector); }
@Override public Connection connection(Handler handler) { Connection connection = Proton.connection(); BaseHandler.setHandler(connection, handler); connection.collect(collector); children.add(connection); ((ConnectionImpl)connection).setReactor(this); return connection; }
public AmqpConnection(NettyTransport transport, String username, String password) { setEndpoint(Connection.Factory.create()); getEndpoint().collect(protonCollector); this.transport = transport; this.username = username; this.password = password; this.connectionId = CONNECTION_ID_GENERATOR.generateId(); this.remoteURI = transport.getRemoteLocation(); this.serializer = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { @Override public Thread newThread(Runnable runner) { Thread serial = new Thread(runner); serial.setDaemon(true); serial.setName(toString()); return serial; } }); // Ensure timely shutdown this.serializer.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); this.serializer.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); this.transport.setTransportListener(this); this.transport.setMaxFrameSize(getMaxFrameSize()); }
protonTransport.setIdleTimeout(idleTimeout); protonTransport.bind(protonConnection); protonConnection.collect(protonCollector);
protonTransport.setIdleTimeout(idleTimeout); protonTransport.bind(protonConnection); protonConnection.collect(protonCollector);
public AmqpConnection(AmqpTransport transport, BrokerService brokerService) { this.amqpTransport = transport; AmqpInactivityMonitor monitor = transport.getInactivityMonitor(); if (monitor != null) { monitor.setAmqpTransport(amqpTransport); } this.amqpWireFormat = transport.getWireFormat(); this.brokerService = brokerService; // the configured maxFrameSize on the URI. int maxFrameSize = amqpWireFormat.getMaxAmqpFrameSize(); if (maxFrameSize > AmqpWireFormat.NO_AMQP_MAX_FRAME_SIZE) { this.protonTransport.setMaxFrameSize(maxFrameSize); try { this.protonTransport.setOutboundFrameSizeLimit(maxFrameSize); } catch (Throwable e) { // Ignore if older proton-j was injected. } } this.protonTransport.bind(this.protonConnection); this.protonTransport.setChannelMax(CHANNEL_MAX); this.protonTransport.setEmitFlowEventOnSend(false); this.protonConnection.collect(eventCollector); updateTracer(); }
public AmqpConnection(AmqpTransport transport, BrokerService brokerService) { this.amqpTransport = transport; AmqpInactivityMonitor monitor = transport.getInactivityMonitor(); if (monitor != null) { monitor.setAmqpTransport(amqpTransport); } this.amqpWireFormat = transport.getWireFormat(); this.brokerService = brokerService; // the configured maxFrameSize on the URI. int maxFrameSize = amqpWireFormat.getMaxAmqpFrameSize(); if (maxFrameSize > AmqpWireFormat.NO_AMQP_MAX_FRAME_SIZE) { this.protonTransport.setMaxFrameSize(maxFrameSize); try { this.protonTransport.setOutboundFrameSizeLimit(maxFrameSize); } catch (Throwable e) { // Ignore if older proton-j was injected. } } this.protonTransport.bind(this.protonConnection); this.protonTransport.setChannelMax(CHANNEL_MAX); this.protonTransport.setEmitFlowEventOnSend(false); this.protonConnection.collect(eventCollector); updateTracer(); }
ProtonTransport(Connection connection, Vertx vertx, NetClient netClient, NetSocket socket, ProtonSaslAuthenticator authenticator, ProtonTransportOptions options) { this.connection = connection; this.vertx = vertx; this.netClient = netClient; this.socket = socket; int maxFrameSize = options.getMaxFrameSize() == 0 ? DEFAULT_MAX_FRAME_SIZE : options.getMaxFrameSize(); transport.setMaxFrameSize(maxFrameSize); transport.setOutboundFrameSizeLimit(maxFrameSize); transport.setEmitFlowEventOnSend(false); // TODO: make configurable transport.setIdleTimeout(2 * options.getHeartbeat()); ((TransportInternal) transport).setUseReadOnlyOutputBuffer(false); if (authenticator != null) { authenticator.init(this.socket, (ProtonConnection) this.connection.getContext(), transport); } this.authenticator = authenticator; transport.bind(connection); connection.collect(collector); socket.endHandler(this::handleSocketEnd); socket.handler(this::handleSocketBuffer); }
protonConnection.collect(collector);