@Override public void onRemoteOpen(org.apache.qpid.proton.engine.Connection connection) throws Exception { connection.session().open(); }
@Override public ProtonSessionImpl open() { session.open(); getConnectionImpl().flush(); return this; }
@Override public void onRemoteOpen(Session session) throws Exception { handler.requireHandler(); getSessionExtension(session).initialise(); session.open(); }
@Override public void onSessionRemoteOpen(Event e) { if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info(String.format(Locale.US, "onSessionRemoteOpen entityName[%s], sessionIncCapacity[%s], sessionOutgoingWindow[%s]", this.entityName, e.getSession().getIncomingCapacity(), e.getSession().getOutgoingWindow())); } final Session session = e.getSession(); if (session != null && session.getLocalState() == EndpointState.UNINITIALIZED) { session.open(); } sessionCreated = true; if (this.onRemoteSessionOpen != null) this.onRemoteSessionOpen.accept(session); }
@Override public void onRemoteOpen(Session session) throws Exception { getSessionExtension(session).initialise(); synchronized (getLock()) { session.open(); } }
@Override public void onRemoteOpen(Session session) throws Exception { getSessionExtension(session).initialise(); lock(); try { session.open(); } finally { unlock(); } }
@Override public void onSessionRemoteOpen(Event e) { TRACE_LOGGER.debug("onSessionRemoteOpen - entityName: {}, sessionIncCapacity: {}, sessionOutgoingWindow: {}", this.name, e.getSession().getIncomingCapacity(), e.getSession().getOutgoingWindow()); Session session = e.getSession(); if (session != null && session.getLocalState() == EndpointState.UNINITIALIZED) { session.open(); } }
@Override public void open() { LOG.debug("Session {} opened", getSessionId()); getEndpoint().setContext(this); getEndpoint().setIncomingCapacity(Integer.MAX_VALUE); getEndpoint().open(); connection.sendToActiveMQ(new SessionInfo(getSessionId())); }
@Override public void open() { LOG.debug("Session {} opened", getSessionId()); getEndpoint().setContext(this); getEndpoint().setIncomingCapacity(Integer.MAX_VALUE); getEndpoint().open(); connection.sendToActiveMQ(new SessionInfo(getSessionId())); }
@Override public void onConnectionInit(Event event) { // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_011: [The event handler shall set the host name on the connection] Connection conn = event.getConnection(); conn.setHostname(hostName); // Every session or link could have their own handler(s) if we // wanted simply by adding the handler to the given session // or link // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_012: [The event handler shall create a Session (Proton) object from the connection] Session ssn = conn.session(); // If a link doesn't have an event handler, the events go to // its parent session. If the session doesn't have a handler // the events go to its parent connection. If the connection // doesn't have a handler, the events go to the reactor. // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_013: [The event handler shall create a Receiver (Proton) object and set the protocol tag on it to a predefined constant] // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_017: [The Receiver object shall have the properties set to service client version identifier.] Map<Symbol, Object> properties = new HashMap<>(); properties.put(Symbol.getSymbol(TransportUtils.versionIdentifierKey), TransportUtils.USER_AGENT_STRING); Receiver notificationReceiver = ssn.receiver(FILE_NOTIFICATION_RECEIVE_TAG); notificationReceiver.setProperties(properties); // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_014: [The event handler shall open the Connection, the Session and the Receiver object] conn.open(); ssn.open(); notificationReceiver.open(); }
@Override public void onConnectionInit(Event event) { // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_011: [The event handler shall set the host name on the connection] Connection conn = event.getConnection(); conn.setHostname(hostName); // Every session or link could have their own handler(s) if we // wanted simply by adding the handler to the given session // or link // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_012: [The event handler shall create a Session (Proton) object from the connection] Session ssn = conn.session(); // If a link doesn't have an event handler, the events go to // its parent session. If the session doesn't have a handler // the events go to its parent connection. If the connection // doesn't have a handler, the events go to the reactor. // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_013: [The event handler shall create a Receiver (Proton) object and set the protocol tag on it to a predefined constant] // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_15_017: [The Receiver object shall have the properties set to service client version identifier.] Map<Symbol, Object> properties = new HashMap<>(); properties.put(Symbol.getSymbol(TransportUtils.versionIdentifierKey), TransportUtils.USER_AGENT_STRING); Receiver receiver = ssn.receiver(RECEIVE_TAG); receiver.setProperties(properties); // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_014: [The event handler shall open the Connection, the Session and the Receiver object] conn.open(); ssn.open(); receiver.open(); }
ssn.open(); snd.open(); isConnected = true;
@Override public AMQPClientSessionContext createClientSession() throws ActiveMQAMQPException { FutureRunnable futureRunnable = new FutureRunnable(1); ProtonClientSessionContext sessionImpl; synchronized (handler.getLock()) { Session session = handler.getConnection().session(); sessionImpl = (ProtonClientSessionContext) getSessionExtension(session); sessionImpl.afterInit(futureRunnable); session.open(); } flush(); waitWithTimeout(futureRunnable); return sessionImpl; }
/** * Event handler for the connection init event * @param event The Proton Event object. */ @Override public void onConnectionInit(Event event) { // Codes_SRS_AMQPSIOTHUBCONNECTION_15_025: [The event handler shall get the Connection (Proton) object from the event handler and set the host name on the connection.] this.connection = event.getConnection(); this.connection.setHostname(this.hostName); // Codes_SRS_AMQPSIOTHUBCONNECTION_15_026: [The event handler shall create a Session (Proton) object from the connection.] this.session = this.connection.session(); // Codes_SRS_AMQPSIOTHUBCONNECTION_15_027: [The event handler shall create a Receiver and Sender (Proton) links and set the protocol tag on them to a predefined constant.] this.receiver = this.session.receiver(receiveTag); this.sender = this.session.sender(sendTag); // Codes_SRS_AMQPSIOTHUBCONNECTION_15_028: [The Receiver and Sender links shall have the properties set to client version identifier.] Map<Symbol, Object> properties = new HashMap<>(); properties.put(Symbol.getSymbol(versionIdentifierKey), TransportUtils.javaDeviceClientIdentifier + TransportUtils.clientVersion); this.receiver.setProperties(properties); this.sender.setProperties(properties); // Codes_SRS_AMQPSIOTHUBCONNECTION_15_029: [The event handler shall open the connection, session, sender and receiver objects.] this.connection.open(); this.session.open(); receiver.open(); sender.open(); }
@Override public Session getSession(final String path, final Consumer<Session> onRemoteSessionOpen, final BiConsumer<ErrorCondition, Exception> onRemoteSessionOpenError) { if (this.getIsClosingOrClosed()) { onRemoteSessionOpenError.accept(null, new OperationCancelledException("underlying messagingFactory instance is closed")); return null; } if (this.connection == null || this.connection.getLocalState() == EndpointState.CLOSED || this.connection.getRemoteState() == EndpointState.CLOSED) { this.connection = this.getReactor().connectionToHost( this.connectionHandler.getRemoteHostName(), this.connectionHandler.getRemotePort(), this.connectionHandler); } final Session session = this.connection.session(); BaseHandler.setHandler(session, new SessionHandler(path, onRemoteSessionOpen, onRemoteSessionOpenError, this.operationTimeout)); session.open(); return session; }
/** * Event handler for the connection init event * @param event The Proton Event object. */ @Override public void onConnectionInit(Event event) { logger.LogDebug("Entered in method %s", logger.getMethodName()); this.connection = event.getConnection(); this.connection.setHostname(this.fullHostAddress); this.session = this.connection.session(); this.connection.open(); this.session.open(); try { this.amqpDeviceOperations.openLinks(this.session); } catch (Exception e) { logger.LogDebug("openLinks has thrown exception: %s", e.getMessage()); } logger.LogDebug("Exited from method %s", logger.getMethodName()); }
private void createSendLink(SenderLinkSettings linkSettings) { TRACE_LOGGER.info("Creating send link to '{}'", this.sendPath); final Connection connection = this.underlyingFactory.getConnection(); final Session session = connection.session(); session.setOutgoingWindow(Integer.MAX_VALUE); session.open(); BaseHandler.setHandler(session, new SessionHandler(sendPath)); final Sender sender = session.sender(linkSettings.linkName); sender.setTarget(linkSettings.target); sender.setSource(linkSettings.source); sender.setProperties(linkSettings.linkProperties); TRACE_LOGGER.debug("Send link settle mode '{}'", linkSettings.settleMode); sender.setSenderSettleMode(linkSettings.settleMode); SendLinkHandler handler = new SendLinkHandler(CoreMessageSender.this); BaseHandler.setHandler(sender, handler); sender.open(); this.sendLink = sender; this.underlyingFactory.registerForConnectionError(this.sendLink); }
session.open(); C link = finder.create(session); link.open();
session.open(); C link = finder.create(session); linkAdded(link);
session.open(); C link = finder.create(session); linkAdded(link);