Package org.jppf.jmxremote.message
Class JMXMessageHandler
java.lang.Object
org.jppf.jmxremote.message.JMXMessageHandler
Handles requests/responses and notifications with a message-based semantics.
- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longMessage ID for receiving a connection ID from the server. -
Constructor Summary
ConstructorsConstructorDescriptionJMXMessageHandler(ChannelsPair channels, Map<String, ?> env) Initialize with the specified pair of reading and writing channels. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this message handler.voidmessageSent(JMXMessage message) Called when a request that doesn't require a response is sent.voidresponseReceived(JMXResponse response) Called when a response is received.voidsendMessage(JMXMessage message) Sends the specified message.voidsendRequestNoResponse(byte type, Object... params) Sends the specified message.sendRequestWithResponse(byte type, Object... params) Send a request and return a response when it arrives.
-
Field Details
-
CONNECTION_MESSAGE_ID
public static final long CONNECTION_MESSAGE_IDMessage ID for receiving a connection ID from the server.- See Also:
-
-
Constructor Details
-
JMXMessageHandler
Initialize with the specified pair of reading and writing channels.- Parameters:
channels- the associated pair of reading/writing channels.env- environment parameters to use for connector properties.
-
-
Method Details
-
getChannels
- Returns:
- the NIO channels that perform the communication with the server.
-
sendRequestWithResponse
Send a request and return a response when it arrives.- Parameters:
type- the type of request to send.params- the request's parameters.- Returns:
- the result of the request.
- Throws:
Exception- if any error occurs.
-
responseReceived
Called when a response is received.- Parameters:
response- the repsonse to process.
-
sendRequestNoResponse
Sends the specified message.- Parameters:
type- the type of request to send.params- the request's parameters.- Throws:
Exception- if any error occurs.
-
messageSent
Called when a request that doesn't require a response is sent.- Parameters:
message- the request.
-
sendMessage
Sends the specified message.- Parameters:
message- the message to send.- Throws:
Exception- if any error occurs.
-
close
public void close()Close this message handler.
-