Modifier and Type | Class and Description |
---|---|
(package private) class |
AMQPConnectionListener.NetServerOut |
Modifier and Type | Field and Description |
---|---|
static int |
AMQP_FRAME_EXTRA_SIZE
The number of bytes that is not used for payload in an AMQP frame: all
frames consist of a header (7 octets), a payload of arbitrary size, and a
'frame-end' octet
|
private int |
channelMax |
private int |
cHeartbeat |
(package private) boolean |
closing |
static Locale |
JORAM_AMQP_LOCALE
The message locale that the server supports.
|
static int |
JORAM_AMQP_MAX_CHANNELS
Specifies highest channel number that the server permits.
|
static int |
JORAM_AMQP_MAX_FRAME_SIZE
The largest frame size that the server proposes for the connection,
including frame header and endbyte.
|
static String |
JORAM_AMQP_SECURITY
The security mechanism that the server supports.
|
static String |
JORAM_AMQP_VERSION
The implementation version of the broker.
|
static org.objectweb.util.monolog.api.Logger |
logger |
private int |
maxBodySize |
static Map<String,Object> |
MOM_PROPERTIES
This table provides a set of peer properties, used for identification,
debugging, and general information.
|
private AMQPConnectionListener.NetServerOut |
netServerOut |
private static int |
NO_CHANNEL |
private Map<Integer,PublishRequest> |
openChannel
Contains the opened channels.
|
private Queue |
queueIn |
private BlockingQueue |
queueOut |
private ServerSocket |
serverSocket
The server socket listening to connections from the AMQP peer.
|
private int |
sHeartbeat
Heartbeats requested by client and server, in seconds.
|
private Socket |
sock
The socket used to listen.
|
Constructor and Description |
---|
AMQPConnectionListener(ServerSocket serverSocket,
int heartbeat)
Creates a new connection listener.
|
Modifier and Type | Method and Description |
---|---|
private void |
acceptConnection() |
protected void |
close()
Releases any resources attached to this daemon.
|
private void |
closeChannel(int channel) |
private void |
closeProxy() |
private void |
closeSocket() |
private void |
connectionException(int errorNumber,
String message,
int classId,
int methodId)
Release channel resources and close it by sending a notification to the
client.
|
private PublishRequest |
createPublishRequest(int channel) |
private void |
doProcessBody(byte[] body,
PublishRequest publishRequest,
int channelNumber)
Process the content body.
|
private void |
doProcessHeader(MarshallingHeader header,
PublishRequest publishRequest,
int channelNumber)
Process the content header.
|
private void |
doProcessMethod(AbstractMarshallingMethod method,
int channelNumber) |
private static AMQP.Connection.Start |
getConnectionStartMethod()
Creates a
AMQP.Connection.Start method object. |
private boolean |
isChannelOpen(int channel) |
private void |
openChannel(int channel) |
private void |
process(Frame frame)
Proceed this frame.
|
private static void |
readProtocolHeader(InputStream in) |
private void |
removePublishRequest(int channel) |
void |
run() |
private void |
sendMethodToPeer(AbstractMarshallingMethod method,
int channelNumber) |
private void |
sendToProxy(AbstractMarshallingMethod method) |
private void |
sendToProxy(PublishRequest publishRequest) |
protected void |
shutdown()
Interrupts a thread that waits for long periods.
|
private void |
tuneConnectionParameters(AMQP.Connection.TuneOk tuneOk) |
finish, getName, interrupt, isCurrentThread, isRunning, setDaemon, setName, setPriority, setThreadGroup, start, stop, toString
public static org.objectweb.util.monolog.api.Logger logger
public static final int AMQP_FRAME_EXTRA_SIZE
public static final String JORAM_AMQP_VERSION
public static final Locale JORAM_AMQP_LOCALE
public static final String JORAM_AMQP_SECURITY
public static int JORAM_AMQP_MAX_CHANNELS
public static int JORAM_AMQP_MAX_FRAME_SIZE
public static final Map<String,Object> MOM_PROPERTIES
private static final int NO_CHANNEL
private Map<Integer,PublishRequest> openChannel
private volatile ServerSocket serverSocket
private Socket sock
private int sHeartbeat
private int cHeartbeat
private Queue queueIn
private BlockingQueue queueOut
private AMQPConnectionListener.NetServerOut netServerOut
private int maxBodySize
private int channelMax
volatile boolean closing
public AMQPConnectionListener(ServerSocket serverSocket, int heartbeat) throws IOException
serverSocket
- the server socket to listen toheartbeat
- the socket timeout delay.IOException
Exception
public void run()
private void process(Frame frame) throws IOException, ConnectionException
frame
- IOException
ConnectionException
private void connectionException(int errorNumber, String message, int classId, int methodId)
private void closeProxy()
private void sendMethodToPeer(AbstractMarshallingMethod method, int channelNumber)
private void doProcessMethod(AbstractMarshallingMethod method, int channelNumber) throws ConnectionException
ConnectionException
private void tuneConnectionParameters(AMQP.Connection.TuneOk tuneOk) throws SyntaxErrorException
SyntaxErrorException
private void doProcessHeader(MarshallingHeader header, PublishRequest publishRequest, int channelNumber)
header
- channelNumber
- private void doProcessBody(byte[] body, PublishRequest publishRequest, int channelNumber) throws FrameErrorException
body
- channelNumber
- FrameErrorException
private void sendToProxy(PublishRequest publishRequest)
private void sendToProxy(AbstractMarshallingMethod method)
private void acceptConnection() throws AMQPException, IOException
AMQPException
IOException
private static void readProtocolHeader(InputStream in) throws IOException, FrameErrorException
IOException
FrameErrorException
private static AMQP.Connection.Start getConnectionStartMethod() throws IOException
AMQP.Connection.Start
method object.IOException
private boolean isChannelOpen(int channel)
private void openChannel(int channel)
private void closeChannel(int channel)
private PublishRequest createPublishRequest(int channel)
private void removePublishRequest(int channel)
private void closeSocket()
protected void shutdown()
Daemon
Copyright © 2016 ScalAgent D.T.. All Rights Reserved.