Tabnine Logo
ConnectionEntry
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.activemq/artemis-mqtt-protocol

@Override
public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection connection) {
 try {
   MQTTConnection mqttConnection = new MQTTConnection(connection);
   ConnectionEntry entry = new ConnectionEntry(mqttConnection, null, System.currentTimeMillis(), MQTTUtil.DEFAULT_KEEP_ALIVE_FREQUENCY);
   NettyServerConnection nettyConnection = ((NettyServerConnection) connection);
   MQTTProtocolHandler protocolHandler = nettyConnection.getChannel().pipeline().get(MQTTProtocolHandler.class);
   protocolHandler.setConnection(mqttConnection, entry);
   return entry;
 } catch (Exception e) {
   log.error(e);
   return null;
 }
}
origin: apache/activemq-artemis

@Override
public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection connection) {
 try {
   MQTTConnection mqttConnection = new MQTTConnection(connection);
   ConnectionEntry entry = new ConnectionEntry(mqttConnection, null, System.currentTimeMillis(), MQTTUtil.DEFAULT_KEEP_ALIVE_FREQUENCY);
   NettyServerConnection nettyConnection = ((NettyServerConnection) connection);
   MQTTProtocolHandler protocolHandler = nettyConnection.getChannel().pipeline().get(MQTTProtocolHandler.class);
   protocolHandler.setConnection(mqttConnection, entry);
   return entry;
 } catch (Exception e) {
   log.error(e);
   return null;
 }
}
origin: apache/activemq-artemis

@Override
public ConnectionEntry createConnectionEntry(final Acceptor acceptorUsed, final Connection connection) {
 StompConnection conn = new StompConnection(acceptorUsed, connection, this, server.getScheduledPool(), server.getExecutorFactory());
 // Note that STOMP 1.0 has no heartbeat, so if connection ttl is non zero, data must continue to be sent or connection
 // will be timed out and closed!
 String ttlStr = (String) acceptorUsed.getConfiguration().get(TransportConstants.CONNECTION_TTL);
 Long ttl = ttlStr == null ? null : Long.valueOf(ttlStr);
 if (ttl != null) {
   if (ttl > 0) {
    return new ConnectionEntry(conn, null, System.currentTimeMillis(), ttl);
   }
   throw BUNDLE.negativeConnectionTTL(ttl);
 }
 ttl = server.getConfiguration().getConnectionTTLOverride();
 if (ttl != -1) {
   return new ConnectionEntry(conn, null, System.currentTimeMillis(), ttl);
 } else {
   // Default to 1 minute - which is same as core protocol
   return new ConnectionEntry(conn, null, System.currentTimeMillis(), 1 * 60 * 1000);
 }
}
origin: org.apache.activemq/artemis-stomp-protocol

@Override
public ConnectionEntry createConnectionEntry(final Acceptor acceptorUsed, final Connection connection) {
 StompConnection conn = new StompConnection(acceptorUsed, connection, this, server.getScheduledPool(), server.getExecutorFactory());
 // Note that STOMP 1.0 has no heartbeat, so if connection ttl is non zero, data must continue to be sent or connection
 // will be timed out and closed!
 String ttlStr = (String) acceptorUsed.getConfiguration().get(TransportConstants.CONNECTION_TTL);
 Long ttl = ttlStr == null ? null : Long.valueOf(ttlStr);
 if (ttl != null) {
   if (ttl > 0) {
    return new ConnectionEntry(conn, null, System.currentTimeMillis(), ttl);
   }
   throw BUNDLE.negativeConnectionTTL(ttl);
 }
 ttl = server.getConfiguration().getConnectionTTLOverride();
 if (ttl != -1) {
   return new ConnectionEntry(conn, null, System.currentTimeMillis(), ttl);
 } else {
   // Default to 1 minute - which is same as core protocol
   return new ConnectionEntry(conn, null, System.currentTimeMillis(), 1 * 60 * 1000);
 }
}
origin: apache/activemq-artemis

@Override
public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection connection) {
 OpenWireFormat wf = (OpenWireFormat) wireFactory.createWireFormat();
 OpenWireConnection owConn = new OpenWireConnection(connection, server, server.getExecutorFactory().getExecutor(), this, wf);
 owConn.sendHandshake();
 //first we setup ttl to -1
 //then when negotiation, we handle real ttl and delay
 ConnectionEntry entry = new ConnectionEntry(owConn, null, System.currentTimeMillis(), -1);
 owConn.setConnectionEntry(entry);
 return entry;
}
origin: apache/activemq-artemis

@Override
public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection remotingConnection) {
 AMQPConnectionCallback connectionCallback = new AMQPConnectionCallback(this, remotingConnection, server.getExecutorFactory().getExecutor(), server);
 long ttl = ActiveMQClient.DEFAULT_CONNECTION_TTL;
 if (server.getConfiguration().getConnectionTTLOverride() != -1) {
   ttl = server.getConfiguration().getConnectionTTLOverride();
 }
 if (getAmqpIdleTimeout() != null) {
   ttl = getAmqpIdleTimeout().longValue();
 }
 if (ttl < 0) {
   ttl = 0;
 }
 String id = server.getConfiguration().getName();
 boolean useCoreSubscriptionNaming = server.getConfiguration().isAmqpUseCoreSubscriptionNaming();
 AMQPConnectionContext amqpConnection = new AMQPConnectionContext(this, connectionCallback, id, (int) ttl, getMaxFrameSize(), AMQPConstants.Connection.DEFAULT_CHANNEL_MAX, useCoreSubscriptionNaming, server.getScheduledPool(), true, null, null);
 Executor executor = server.getExecutorFactory().getExecutor();
 ActiveMQProtonRemotingConnection delegate = new ActiveMQProtonRemotingConnection(this, amqpConnection, remotingConnection, executor);
 delegate.addFailureListener(connectionCallback);
 delegate.addCloseListener(connectionCallback);
 connectionCallback.setProtonConnectionDelegate(delegate);
 // connection entry only understands -1 otherwise we would see disconnects for no reason
 ConnectionEntry entry = new ConnectionEntry(delegate, executor, System.currentTimeMillis(), ttl <= 0 ? -1 : ttl);
 return entry;
}
origin: apache/activemq-artemis

@Override
public ConnectionEntry createConnectionEntry(final Acceptor acceptorUsed, final Connection connection) {
 final Configuration config = server.getConfiguration();
 Executor connectionExecutor = server.getExecutorFactory().getExecutor();
 final CoreRemotingConnection rc = new RemotingConnectionImpl(new ServerPacketDecoder(), connection, incomingInterceptors, outgoingInterceptors, config.isAsyncConnectionExecutionEnabled() ? connectionExecutor : null, server.getNodeID());
 Channel channel1 = rc.getChannel(CHANNEL_ID.SESSION.id, -1);
 ChannelHandler handler = new ActiveMQPacketHandler(this, server, channel1, rc);
 channel1.setHandler(handler);
 long ttl = ActiveMQClient.DEFAULT_CONNECTION_TTL;
 if (config.getConnectionTTLOverride() != -1) {
   ttl = config.getConnectionTTLOverride();
 }
 final ConnectionEntry entry = new ConnectionEntry(rc, connectionExecutor, System.currentTimeMillis(), ttl);
 final Channel channel0 = rc.getChannel(ChannelImpl.CHANNEL_ID.PING.id, -1);
 channel0.setHandler(new LocalChannelHandler(config, entry, channel0, acceptorUsed, rc));
 server.getClusterManager().addClusterChannelHandler(rc.getChannel(CHANNEL_ID.CLUSTER.id, -1), acceptorUsed, rc, server.getActivation());
 return entry;
}
origin: org.apache.activemq/artemis-amqp-protocol

@Override
public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection remotingConnection) {
 AMQPConnectionCallback connectionCallback = new AMQPConnectionCallback(this, remotingConnection, server.getExecutorFactory().getExecutor(), server);
 long ttl = ActiveMQClient.DEFAULT_CONNECTION_TTL;
 if (server.getConfiguration().getConnectionTTLOverride() != -1) {
   ttl = server.getConfiguration().getConnectionTTLOverride();
 }
 if (getAmqpIdleTimeout() != null) {
   ttl = getAmqpIdleTimeout().longValue();
 }
 if (ttl < 0) {
   ttl = 0;
 }
 String id = server.getConfiguration().getName();
 boolean useCoreSubscriptionNaming = server.getConfiguration().isAmqpUseCoreSubscriptionNaming();
 AMQPConnectionContext amqpConnection = new AMQPConnectionContext(this, connectionCallback, id, (int) ttl, getMaxFrameSize(), AMQPConstants.Connection.DEFAULT_CHANNEL_MAX, useCoreSubscriptionNaming, server.getScheduledPool(), true, null, null);
 Executor executor = server.getExecutorFactory().getExecutor();
 ActiveMQProtonRemotingConnection delegate = new ActiveMQProtonRemotingConnection(this, amqpConnection, remotingConnection, executor);
 delegate.addFailureListener(connectionCallback);
 delegate.addCloseListener(connectionCallback);
 connectionCallback.setProtonConnectionDelegate(delegate);
 // connection entry only understands -1 otherwise we would see disconnects for no reason
 ConnectionEntry entry = new ConnectionEntry(delegate, executor, System.currentTimeMillis(), ttl <= 0 ? -1 : ttl);
 return entry;
}
org.apache.activemq.artemis.spi.core.protocolConnectionEntry

Most used methods

  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JButton (javax.swing)
  • Top PhpStorm plugins
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