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 intDEFAULT_PREFETCH
-
Constructor Summary
Constructors Constructor Description AmqpProtocolDiscriminator(AmqpTransport transport, BrokerService brokerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longkeepAlive()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.voidonActiveMQCommand(Command command)Incoming Command object from ActiveMQ.voidonAMQPData(Object command)A new incoming data packet from the remote peer is handed off to the protocol converter for processing.voidonAMQPException(IOException error)Called when the transport detects an exception that the converter needs to respond to.voidupdateTracer()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:AmqpProtocolConverterA 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:
onAMQPDatain 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:AmqpProtocolConverterCalled when the transport detects an exception that the converter needs to respond to.- Specified by:
onAMQPExceptionin interfaceAmqpProtocolConverter- Parameters:
error- the error that triggered this call.
-
onActiveMQCommand
public void onActiveMQCommand(Command command) throws Exception
Description copied from interface:AmqpProtocolConverterIncoming Command object from ActiveMQ.- Specified by:
onActiveMQCommandin 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:AmqpProtocolConverterOn changes to the transport tracing options the Protocol Converter should update its internal state so that the proper AMQP data is logged.- Specified by:
updateTracerin interfaceAmqpProtocolConverter
-
keepAlive
public long keepAlive()
Description copied from interface:AmqpProtocolConverterPerform 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:
keepAlivein interfaceAmqpProtocolConverter
-
-