public class SystemResourceUsageRequester extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected com.rabbitmq.client.Channel |
cmdChannel
Channel that is used for the command queue but not owned by this class (i.e.,
it won't be closed).
|
protected com.google.gson.Gson |
gson |
protected com.rabbitmq.client.Channel |
incomingChannel |
private static org.slf4j.Logger |
LOGGER |
private com.rabbitmq.client.QueueingConsumer |
responseConsumer
Consumer of the queue that is used to receive responses for messages that are
sent via the command queue and for which an answer is expected.
|
private String |
responseQueueName
Name of the queue that is used to receive responses for messages that are
sent via the command queue and for which an answer is expected.
|
protected byte[] |
sessionIdBytes |
| Modifier | Constructor and Description |
|---|---|
protected |
SystemResourceUsageRequester(com.rabbitmq.client.Channel cmdChannel,
com.rabbitmq.client.Channel incomingChannel,
String responseQueueName,
com.rabbitmq.client.QueueingConsumer responseConsumer,
String sessionId) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static SystemResourceUsageRequester |
create(PlatformConnector connector,
String sessionId) |
ResourceUsageInformation |
getSystemResourceUsage() |
protected void |
sendToCmdQueue(byte command,
byte[] data,
com.rabbitmq.client.AMQP.BasicProperties props)
Sends the given command to the command queue with the given data appended and
using the given properties.
|
private static final org.slf4j.Logger LOGGER
private String responseQueueName
private com.rabbitmq.client.QueueingConsumer responseConsumer
protected com.rabbitmq.client.Channel cmdChannel
protected com.rabbitmq.client.Channel incomingChannel
protected byte[] sessionIdBytes
protected com.google.gson.Gson gson
public static SystemResourceUsageRequester create(PlatformConnector connector, String sessionId)
public ResourceUsageInformation getSystemResourceUsage()
protected void sendToCmdQueue(byte command,
byte[] data,
com.rabbitmq.client.AMQP.BasicProperties props)
throws IOException
command - the command that should be sentdata - data that should be appended to the commandprops - properties that should be used for the messageIOException - if a communication problem occurspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2017–2018. All rights reserved.