Package com.kheops.jmap.net
Class JMapConnection
java.lang.Object
com.kheops.jmap.net.JMapConnection
- Direct Known Subclasses:
JMapBaseNetworkConnection,JMapInProcessConnection,JMapPooledNetworkConnection,JMSConnectionService
This abstract class represents a connection between a client application and
JMapServer. Subclasses must implement the communication services.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Closes the current connection.abstract byte[]executeRequest(byte[] requestBytes) Blocking method that sends a pre-serialized request (byte array) to JMapServer and returns the serialized response object (byte array) obtained from JMapServer.abstract JMapResponseexecuteRequest(JMapRequest request) Blocking method that sends a request to JMapServer and returns the response object obtained from JMapServer.abstract booleanbooleanabstract voidpushRequest(JMapRequest request) Non-blocking method that pushes a request in the queue.
-
Constructor Details
-
JMapConnection
public JMapConnection()
-
-
Method Details
-
executeRequest
Blocking method that sends a request to JMapServer and returns the response object obtained from JMapServer.- Parameters:
request- the request to send to JMapServer- Returns:
- the response from JMapServer
- Throws:
IOException
-
executeRequest
Blocking method that sends a pre-serialized request (byte array) to JMapServer and returns the serialized response object (byte array) obtained from JMapServer.- Parameters:
requestBytes- the request bytes to send to JMapServer- Returns:
- the response from JMapServer
- Throws:
IOException
-
pushRequest
Non-blocking method that pushes a request in the queue. Requests placed in the queue are sent to JMapServer one after the other. When the response is obtained from JMapServer, the client specified in the request object is notified through itscallbackmethod.- Parameters:
request- the request to send to JMapServer- See Also:
-
isConnected
public abstract boolean isConnected() -
pingServer
public boolean pingServer() -
close
public abstract void close()Closes the current connection.
-