Class AmqpProtocolDiscriminator
- java.lang.Object
-
- org.apache.activemq.transport.amqp.AmqpProtocolDiscriminator
-
- All Implemented Interfaces:
AmqpProtocolConverter
public class AmqpProtocolDiscriminator extends Object implements AmqpProtocolConverter
Used to assign the best implementation of a AmqpProtocolConverter to the AmqpTransport based on the AmqpHeader that the client sends us.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PREFETCH
-
Constructor Summary
Constructors Constructor Description AmqpProtocolDiscriminator(AmqpTransport transport, BrokerService brokerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
keepAlive()
Perform any keep alive processing for the connection such as sending empty frames or closing connections due to remote end being inactive for to long.void
onActiveMQCommand(Command command)
Incoming Command object from ActiveMQ.void
onAMQPData(Object command)
A new incoming data packet from the remote peer is handed off to the protocol converter for processing.void
onAMQPException(IOException error)
Called when the transport detects an exception that the converter needs to respond to.void
updateTracer()
On changes to the transport tracing options the Protocol Converter should update its internal state so that the proper AMQP data is logged.
-
-
-
Field Detail
-
DEFAULT_PREFETCH
public static final int DEFAULT_PREFETCH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AmqpProtocolDiscriminator
public AmqpProtocolDiscriminator(AmqpTransport transport, BrokerService brokerService)
-
-
Method Detail
-
onAMQPData
public void onAMQPData(Object command) throws Exception
Description copied from interface:AmqpProtocolConverter
A new incoming data packet from the remote peer is handed off to the protocol converter for processing. The type can vary and be either an AmqpHeader at the handshake phase or a byte buffer containing the next incoming frame data from the remote.- Specified by:
onAMQPData
in interfaceAmqpProtocolConverter
- Parameters:
command
- the next incoming data object from the remote peer.- Throws:
Exception
- if an error occurs processing the incoming data packet.
-
onAMQPException
public void onAMQPException(IOException error)
Description copied from interface:AmqpProtocolConverter
Called when the transport detects an exception that the converter needs to respond to.- Specified by:
onAMQPException
in interfaceAmqpProtocolConverter
- Parameters:
error
- the error that triggered this call.
-
onActiveMQCommand
public void onActiveMQCommand(Command command) throws Exception
Description copied from interface:AmqpProtocolConverter
Incoming Command object from ActiveMQ.- Specified by:
onActiveMQCommand
in interfaceAmqpProtocolConverter
- Parameters:
command
- the next incoming command from the broker.- Throws:
Exception
- if an error occurs processing the command.
-
updateTracer
public void updateTracer()
Description copied from interface:AmqpProtocolConverter
On changes to the transport tracing options the Protocol Converter should update its internal state so that the proper AMQP data is logged.- Specified by:
updateTracer
in interfaceAmqpProtocolConverter
-
keepAlive
public long keepAlive()
Description copied from interface:AmqpProtocolConverter
Perform any keep alive processing for the connection such as sending empty frames or closing connections due to remote end being inactive for to long.- Specified by:
keepAlive
in interfaceAmqpProtocolConverter
-
-