public class HighLevelObject
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static CentralLogger |
LOG
Logger
|
protected Session |
session
Session which represents connection.
|
private int |
timeout
The timeout for synchronous calls.
|
| Constructor and Description |
|---|
HighLevelObject(Session session)
Constructs an instance using the given transport.
|
HighLevelObject(Session session,
int timeout)
Constructs an instance using the given transport and timeout.
|
| Modifier and Type | Method and Description |
|---|---|
void |
forward(RoutingKey key,
java.lang.Object[] parms)
Convenience wrapper for
Queue.forward(com.goldencode.p2j.net.Message). |
RoutingKey |
getKey(java.lang.String group,
java.lang.String method)
Get the routing key instance that represents the given group and method
at the remote side of the session.
|
int |
getTimeout()
Get the transaction timeout in milliseconds.
|
void |
setTimeout(int timeout)
Set the transaction timeout in milliseconds.
|
java.lang.Object |
transact(RoutingKey key,
java.lang.Object[] parms)
Convenience wrapper for
Queue.transact(com.goldencode.p2j.net.Message, int). |
private static CentralLogger LOG
protected Session session
private int timeout
public HighLevelObject(Session session)
session - Session with properly initialized transport.public HighLevelObject(Session session, int timeout)
session - Session with properly initialized transport.timeout - The transaction timeout in milliseconds.public int getTimeout()
public void setTimeout(int timeout)
timeout - The timeout in milliseconds.public RoutingKey getKey(java.lang.String group, java.lang.String method) throws java.lang.Exception
group - Group name.method - Method name.java.lang.Exception - If any problem happens during processing of the request.public void forward(RoutingKey key, java.lang.Object[] parms)
Queue.forward(com.goldencode.p2j.net.Message).key - An instance of RoutingKey which points to method to call at
remote side.parms - Method parameters.public java.lang.Object transact(RoutingKey key, java.lang.Object[] parms) throws java.lang.Exception
Queue.transact(com.goldencode.p2j.net.Message, int).key - The routing key which represents the method to call at the
remote side.parms - Method parameters.java.lang.Exception - If any problem occurs during Queue.transact(com.goldencode.p2j.net.Message, int).