public ProtonConnectionImpl getConnectionImpl() { return (ProtonConnectionImpl) this.session.getConnection().getContext(); }
private Connection lookup(String host, String service) { for (Connector c : _driver.connectors()) { Connection connection = c.getConnection(); if (host.equals(connection.getRemoteContainer()) || service.equals(connection.getContext())) { return connection; } } return null; }
private Connection lookup(String host, String service) { for (Connector<?> c : _driver.connectors()) { Connection connection = c.getConnection(); ConnectionContext ctx = (ConnectionContext) connection.getContext(); if (host.equals(connection.getRemoteContainer()) || service.equals(ctx.getService())) { return connection; } } return null; }
private Connection lookup(Address address) { for (Connector<?> c : _driver.connectors()) { Connection connection = c.getConnection(); ConnectionContext ctx = (ConnectionContext) connection.getContext(); if (ctx.matches(address)) { return connection; } } return null; }
private void handleSocketEnd(Void arg) { transport.unbind(); transport.close(); if (this.netClient != null) { this.netClient.close(); } else { this.socket.close(); } ((ProtonConnectionImpl) this.connection.getContext()).fireDisconnect(); }
ConnectionContext ctx = (ConnectionContext) link.getSession().getConnection().getContext(); try _draining++; ConnectionContext ctx = (ConnectionContext) link.getSession().getConnection().getContext(); try
ConnectionContext ctx = (ConnectionContext) link.getSession().getConnection().getContext(); try _draining++; ConnectionContext ctx = (ConnectionContext) link.getSession().getConnection().getContext(); try
logger.entry(this, methodName, event); EngineConnection engineConnection = (EngineConnection)event.getConnection().getContext(); Delivery delivery = event.getDelivery(); if (event.getLink() instanceof Sender) {
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); }
switch (protonEvent.getType()) { case CONNECTION_REMOTE_CLOSE: amqpEventSink = (AmqpEventSink) protonEvent.getConnection().getContext(); amqpEventSink.processRemoteClose(this); break; case CONNECTION_REMOTE_OPEN: amqpEventSink = (AmqpEventSink) protonEvent.getConnection().getContext(); amqpEventSink.processRemoteOpen(this); break;
private void processEventSessionRemoteState(Event event) { final String methodName = "processEventSessionRemoteState"; logger.entry(this, methodName, event); if (event.getSession().getRemoteState() == EndpointState.ACTIVE) { if (event.getSession().getLocalState() == EndpointState.ACTIVE) { final EngineConnection engineConnection = (EngineConnection) event.getConnection().getContext(); if (!engineConnection.closed) { // First session has opened on the connection OpenRequest req = engineConnection.openRequest; engineConnection.openRequest = null; engineConnection.requestor.tell(new OpenResponse(req, engineConnection), this); } } else { // The remote end is trying to establish a new session with us, which is not allowed. I don't think this is a usual case, // but could occur with a badly written remote end (i.e. sends an initial AMQP open immediately followed by a begin) final Connection protonConnection = event.getConnection(); protonConnection.setCondition(new ErrorCondition(Symbol.getSymbol("mqlight:session-remote-open-rejected"), "MQ Light client is unable to accept an open session request")); protonConnection.close(); } } logger.exit(this, methodName); }
switch (protonEvent.getType()) { case CONNECTION_REMOTE_CLOSE: amqpEventSink = (AmqpEventSink) protonEvent.getConnection().getContext(); if (amqpEventSink != null) { amqpEventSink.processRemoteClose(this); amqpEventSink = (AmqpEventSink) protonEvent.getConnection().getContext(); if (amqpEventSink != null) { amqpEventSink.processRemoteOpen(this);
switch (protonEvent.getType()) { case CONNECTION_REMOTE_CLOSE: amqpEventSink = (AmqpEventSink) protonEvent.getConnection().getContext(); if (amqpEventSink != null) { amqpEventSink.processRemoteClose(this); amqpEventSink = (AmqpEventSink) protonEvent.getConnection().getContext(); if (amqpEventSink != null) { amqpEventSink.processRemoteOpen(this);
final EngineConnection engineConnection = (EngineConnection)event.getConnection().getContext(); if (engineConnection.timerPromise != null) { TimerPromiseImpl tmp = engineConnection.timerPromise; EngineConnection engineConnection = (EngineConnection)event.getConnection().getContext(); long now = System.currentTimeMillis(); long timeout = engineConnection.transport.tick(now);
CloseRequest cr = (CloseRequest)message; Connection protonConnection = cr.connection.connection; EngineConnection engineConnection = (EngineConnection)protonConnection.getContext(); if (engineConnection.timerPromise != null) { TimerPromiseImpl tmp = engineConnection.timerPromise; delivery.settle(); EngineConnection engineConnection = (EngineConnection)dr.request.protonConnection.getContext(); EngineConnection.SubscriptionData subData = engineConnection.subscriptionData.get(dr.request.topicPattern); if (subData == null) {
final EngineConnection engineConnection = (EngineConnection)event.getConnection().getContext(); final EngineConnection.SubscriptionData sd = engineConnection.subscriptionData.get(link.getName()); if (link.getRemoteState() == EndpointState.ACTIVE) { EngineConnection engineConnection = (EngineConnection)event.getConnection().getContext(); EngineConnection.SubscriptionData sd = engineConnection.subscriptionData.remove(link.getName()); EngineConnection engineConnection = (EngineConnection) event.getConnection().getContext(); for (Delivery delivery = link.head(); delivery != null; delivery = delivery.next()) { SendRequest sr = engineConnection.inProgressOutboundDeliveries.remove(delivery);
ProtonConnectionImpl conn = (ProtonConnectionImpl) protonEvent.getConnection().getContext();