public Object getID() { return connection.getID(); }
@Override public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) { RemotingConnection theConn = connection; if (theConn != null && connectionID.equals(theConn.getID())) { try { theConn.bufferReceived(connectionID, buffer); } catch (final RuntimeException e) { ActiveMQClientLogger.LOGGER.disconnectOnErrorDecoding(e); threadPool.execute(new Runnable() { @Override public void run() { theConn.fail(new ActiveMQException(e.getMessage())); } }); } } else { logger.debug("TheConn == null on ClientSessionFactoryImpl::DelegatingBufferHandler, ignoring packet"); } } }
protected RemotingConnection establishNewConnection() { Connection transportConnection = createTransportConnection(); if (transportConnection == null) { if (ClientSessionFactoryImpl.logger.isTraceEnabled()) { logger.trace("Neither backup or live were active, will just give up now"); } return null; } RemotingConnection newConnection = clientProtocolManager.connect(transportConnection, callTimeout, callFailoverTimeout, incomingInterceptors, outgoingInterceptors, new SessionFactoryTopologyHandler()); newConnection.addFailureListener(new DelegatingFailureListener(newConnection.getID())); schedulePing(); if (logger.isTraceEnabled()) { logger.trace("returning " + newConnection); } return newConnection; }
Lock localFailoverLock = lockFailover(); try { if (connection == null || !connection.getID().equals(connectionID) || !clientProtocolManager.isAlive()) {
public Object getID() { return connection.getID(); }
@Override public Object getConnectionID() { return remotingConnection.getID(); }
public Object getID() { return connection.getID(); }
public Object getID() { return connection.getID(); }
public Object getID() { return connection.getID(); }
public Object getID() { return connection.getID(); }
public Object getID() { return connection.getID(); }
@Override public void handleBuffer(RemotingConnection connection, ActiveMQBuffer buffer) { connection.bufferReceived(connection.getID(), buffer); }
@Override public void handleBuffer(RemotingConnection connection, ActiveMQBuffer buffer) { connection.bufferReceived(connection.getID(), buffer); }
@Override public String listConnectionsAsJSON() throws Exception { checkStarted(); clearIO(); try { JsonArrayBuilder array = JsonLoader.createArrayBuilder(); Set<RemotingConnection> connections = server.getRemotingService().getConnections(); for (RemotingConnection connection : connections) { JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("connectionID", connection.getID().toString()).add("clientAddress", connection.getRemoteAddress()).add("creationTime", connection.getCreationTime()).add("implementation", connection.getClass().getSimpleName()).add("sessionCount", server.getSessions(connection.getID().toString()).size()); array.add(obj); } return array.build().toString(); } finally { blockOnIO(); } }
@Override public String[] listConnectionIDs() { checkStarted(); clearIO(); try { Set<RemotingConnection> connections = remotingService.getConnections(); String[] connectionIDs = new String[connections.size()]; int i = 0; for (RemotingConnection connection : connections) { connectionIDs[i++] = connection.getID().toString(); } return connectionIDs; } finally { blockOnIO(); } }
protected RemotingConnection establishNewConnection() { Connection transportConnection = createTransportConnection(); if (transportConnection == null) { if (ClientSessionFactoryImpl.logger.isTraceEnabled()) { logger.trace("Neither backup or live were active, will just give up now"); } return null; } RemotingConnection newConnection = clientProtocolManager.connect(transportConnection, callTimeout, callFailoverTimeout, incomingInterceptors, outgoingInterceptors, new SessionFactoryTopologyHandler()); newConnection.addFailureListener(new DelegatingFailureListener(newConnection.getID())); schedulePing(); if (logger.isTraceEnabled()) { logger.trace("returning " + newConnection); } return newConnection; }
private void sendConnectionNotification(final RemotingConnection connection, final CoreNotificationType type) { final ManagementService managementService = getManagementService(); if (managementService != null && sendConnectionNotifications) { try { final TypedProperties props = new TypedProperties(); props.putSimpleStringProperty(ManagementHelper.HDR_CONNECTION_NAME, SimpleString.toSimpleString(connection.getID().toString())); props.putSimpleStringProperty(ManagementHelper.HDR_REMOTE_ADDRESS, SimpleString.toSimpleString(connection.getRemoteAddress())); managementService.sendNotification(new Notification(null, type, props)); } catch (Exception e) { logger.warn("Error sending notification: " + type, e.getMessage(), e); } } }
protected RemotingConnection establishNewConnection() { Connection transportConnection = createTransportConnection(); if (transportConnection == null) { if (ClientSessionFactoryImpl.logger.isTraceEnabled()) { logger.trace("Neither backup or live were active, will just give up now"); } return null; } RemotingConnection newConnection = clientProtocolManager.connect(transportConnection, callTimeout, callFailoverTimeout, incomingInterceptors, outgoingInterceptors, new SessionFactoryTopologyHandler()); newConnection.addFailureListener(new DelegatingFailureListener(newConnection.getID())); schedulePing(); if (logger.isTraceEnabled()) { logger.trace("returning " + newConnection); } return newConnection; }
protected RemotingConnection establishNewConnection() { Connection transportConnection = createTransportConnection(); if (transportConnection == null) { if (ClientSessionFactoryImpl.logger.isTraceEnabled()) { logger.trace("Neither backup or live were active, will just give up now"); } return null; } RemotingConnection newConnection = clientProtocolManager.connect(transportConnection, callTimeout, callFailoverTimeout, incomingInterceptors, outgoingInterceptors, new SessionFactoryTopologyHandler()); newConnection.addFailureListener(new DelegatingFailureListener(newConnection.getID())); schedulePing(); if (logger.isTraceEnabled()) { logger.trace("returning " + newConnection); } return newConnection; }
protected RemotingConnection establishNewConnection() { Connection transportConnection = createTransportConnection(); if (transportConnection == null) { if (ClientSessionFactoryImpl.logger.isTraceEnabled()) { logger.trace("Neither backup or live were active, will just give up now"); } return null; } RemotingConnection newConnection = clientProtocolManager.connect(transportConnection, callTimeout, callFailoverTimeout, incomingInterceptors, outgoingInterceptors, new SessionFactoryTopologyHandler()); newConnection.addFailureListener(new DelegatingFailureListener(newConnection.getID())); schedulePing(); if (logger.isTraceEnabled()) { logger.trace("returning " + newConnection); } return newConnection; }