Tabnine Logo
org.apache.activemq.artemis.spi.core.protocol
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.activemq.artemis.spi.core.protocol

Best Java code snippets using org.apache.activemq.artemis.spi.core.protocol (Showing top 20 results out of 315)

origin: wildfly/wildfly

 @Override
 public void run() {
   connectionInUse.fail(me);
 }
});
origin: wildfly/wildfly

@Override
public void scheduledFlush() {
 flush();
}
origin: wildfly/wildfly

@Override
public boolean isWritable(ReadyListener callback) {
 return remotingConnection.isWritable(callback);
}
origin: wildfly/wildfly

 @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");
   }
 }
}
origin: wildfly/wildfly

@Override
public synchronized void run() {
  if (cancelled || stopPingingAfterOne && !first) {
   return;
  }
  first = false;
  long now = System.currentTimeMillis();
  final RemotingConnection connectionInUse = connection;
  if (connectionInUse != null && clientFailureCheckPeriod != -1 && connectionTTL != -1 && now >= lastCheck + connectionTTL) {
   if (!connectionInUse.checkDataReceived()) {
     // We use a different thread to send the fail
     // but the exception has to be created here to preserve the stack trace
     final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection());
     cancelled = true;
     threadPool.execute(new Runnable() {
      // Must be executed on different thread
      @Override
      public void run() {
        connectionInUse.fail(me);
      }
     });
     return;
   } else {
     lastCheck = now;
   }
  }
  send();
}
origin: wildfly/wildfly

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;
}
origin: wildfly/wildfly

  default boolean isSameTarget(TransportConfiguration... configs) {
   return getTransportConnection().isSameTarget(configs);
  }
}
origin: wildfly/wildfly

private void checkCloseConnection() {
 RemotingConnection connectionInUse = connection;
 Connector connectorInUse = connector;
 if (connectionInUse != null && sessions.size() == 0) {
   cancelScheduledTasks();
   try {
    connectionInUse.destroy();
   } catch (Throwable ignore) {
   }
   connection = null;
   try {
    if (connectorInUse != null) {
      connectorInUse.close();
    }
   } catch (Throwable ignore) {
   }
   connector = null;
 }
}
origin: wildfly/wildfly

public Object getID() {
 return connection.getID();
}
origin: wildfly/wildfly

List<FailureListener> oldListeners = oldConnection.getFailureListeners();
List<FailureListener> newListeners = new ArrayList<>(connection.getFailureListeners());
connection.setFailureListeners(newListeners);
origin: wildfly/wildfly

@Override
public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) {
 try {
   final Packet packet = packetDecoder.decode(buffer, this);
   if (logger.isTraceEnabled()) {
    logger.trace("RemotingConnectionID=" + getID() + " handling packet " + packet);
   }
   dataReceived = true;
   doBufferReceived(packet);
   super.bufferReceived(connectionID, buffer);
 } catch (Throwable e) {
   ActiveMQClientLogger.LOGGER.errorDecodingPacket(e);
   throw new IllegalStateException(e);
 }
}
origin: wildfly/wildfly

csf.getConnection().addFailureListener(new FailureListener() {
origin: wildfly/wildfly

@Override
public void fail(final ActiveMQException me) {
 fail(me, null);
}
origin: wildfly/wildfly

@Override
public List<FailureListener> removeFailureListeners() {
 List<FailureListener> ret = getFailureListeners();
 failureListeners.clear();
 return ret;
}
origin: wildfly/wildfly

/**
* We only need to check if the connection point to the same node,
* don't need to compare the whole params map.
* @param connection The connection to the target node
* @return true if the connection point to the same node
* as this member represents.
*/
@Override
public boolean isMember(RemotingConnection connection) {
 return connection.isSameTarget(getConnector().getA(), getConnector().getB());
}
origin: wildfly/wildfly

 @Override
 public void run() {
   theConn.fail(new ActiveMQException(e.getMessage()));
 }
});
origin: wildfly/wildfly

public static X509Certificate[] getCertsFromConnection(RemotingConnection remotingConnection) {
 X509Certificate[] certificates = null;
 if (remotingConnection != null) {
   Connection transportConnection = remotingConnection.getTransportConnection();
   if (transportConnection instanceof NettyConnection) {
    certificates = org.apache.activemq.artemis.utils.CertificateUtil.getCertsFromChannel(((NettyConnection) transportConnection).getChannel());
   }
 }
 return certificates;
}
origin: wildfly/wildfly

try {
 if (!clientProtocolManager.checkForFailover(liveNodeID)) {
   connection.destroy();
   this.connection = null;
   return null;
 connection.destroy();
 this.connection = null;
 return null;
origin: wildfly/wildfly

@Override
public void run() {
  try {
   CLOSE_RUNNABLES.add(this);
   if (scaleDownTargetNodeID == null) {
     conn.fail(ActiveMQClientMessageBundle.BUNDLE.disconnected());
   } else {
     conn.fail(ActiveMQClientMessageBundle.BUNDLE.disconnected(), scaleDownTargetNodeID);
   }
  } finally {
   CLOSE_RUNNABLES.remove(this);
  }
}
origin: wildfly/wildfly

  public static Principal getPeerPrincipalFromConnection(RemotingConnection remotingConnection) {
   Principal result = null;
   if (remotingConnection != null) {
     Connection transportConnection = remotingConnection.getTransportConnection();
     if (transportConnection instanceof NettyConnection) {
      NettyConnection nettyConnection = (NettyConnection) transportConnection;
      ChannelHandler channelHandler = nettyConnection.getChannel().pipeline().get("ssl");
      if (channelHandler != null && channelHandler instanceof SslHandler) {
        SslHandler sslHandler = (SslHandler) channelHandler;
        try {
         result = sslHandler.engine().getSession().getPeerPrincipal();
        } catch (SSLPeerUnverifiedException ignored) {
        }
      }
     }
   }

   return result;
  }
}
org.apache.activemq.artemis.spi.core.protocol

Most used classes

  • RemotingConnection
    A RemotingConnection is a connection between a client and a server. Perhaps a better name for this c
  • AbstractRemotingConnection
  • ProtocolManagerFactory
  • ConnectionEntry
  • MessagePersister
  • EmbedMessageUtil,
  • SessionCallback,
  • ProtocolManager
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now