public abstract class AbstractRpcProtocol extends java.lang.Object implements IRpcProtocol
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
applicationSegment |
protected BrokerException |
brokerException |
protected java.lang.String |
currentReceivedData |
protected java.lang.String |
currentRemoteProcedure |
protected java.lang.String |
currentSentData |
protected java.lang.String |
dataSegment |
protected java.lang.String |
errorMessage |
protected IRpcBrokerEventHandler |
eventHandler |
protected int |
protocolVersion |
protected java.lang.String |
rpcVersion |
protected java.lang.String |
securitySegment |
protected SocketConnection |
socket |
RPC_VERSION, XWB_BAD_SIGN_ON, XWB_BASE_ERR, XWB_BLD_CONNECT_LIST, XWB_CONNECT_REFUSED, XWB_DISCONNECTED_WITH_BYE, XWB_M_REJECT, XWB_NO_CONNECTION_TO_SERVER, XWB_NO_DATA_RECEIVED, XWB_NO_HEAP, XWB_NULL_RPC_VER, XWB_RPC_NOT_REG, XWB_UNABLE_TO_CREATE_CONTEXT
Constructor and Description |
---|
AbstractRpcProtocol(int protocolVersion) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
call(java.lang.String remoteProcedure,
Params params) |
abstract boolean |
connect(java.lang.String server,
int port) |
BrokerException |
createBrokerException(java.lang.Exception e,
java.lang.String action,
int code) |
boolean |
disconnect() |
java.lang.String |
getApplicationSegment() |
BrokerException |
getBrokerException() |
java.lang.String |
getDataSegment() |
java.lang.String |
getErrorMessage() |
IRpcBrokerEventHandler |
getEventHandler() |
int |
getProtocolVersion() |
java.lang.String |
getRpcVersion() |
java.lang.String |
getSecuritySegment() |
protected java.lang.String |
getServerPacket() |
boolean |
isConnected() |
void |
onSocketConnect() |
void |
onSocketDisconnect() |
void |
onSocketException(java.lang.Exception e) |
void |
setEventHandler(IRpcBrokerEventHandler eventHandler) |
void |
setRpcVersion(java.lang.String rpcVersion) |
protected int protocolVersion
protected java.lang.String rpcVersion
protected SocketConnection socket
protected IRpcBrokerEventHandler eventHandler
protected java.lang.String securitySegment
protected java.lang.String applicationSegment
protected java.lang.String dataSegment
protected java.lang.String errorMessage
protected BrokerException brokerException
protected java.lang.String currentRemoteProcedure
protected java.lang.String currentSentData
protected java.lang.String currentReceivedData
public int getProtocolVersion()
getProtocolVersion
in interface IRpcProtocol
public java.lang.String getRpcVersion()
getRpcVersion
in interface IRpcProtocol
public void setRpcVersion(java.lang.String rpcVersion)
setRpcVersion
in interface IRpcProtocol
public java.lang.String getSecuritySegment()
getSecuritySegment
in interface IRpcProtocol
public java.lang.String getApplicationSegment()
getApplicationSegment
in interface IRpcProtocol
public java.lang.String getDataSegment()
getDataSegment
in interface IRpcProtocol
public java.lang.String getErrorMessage()
getErrorMessage
in interface IRpcProtocol
public BrokerException getBrokerException()
getBrokerException
in interface IRpcProtocol
public boolean isConnected()
isConnected
in interface IRpcProtocol
public IRpcBrokerEventHandler getEventHandler()
getEventHandler
in interface IRpcProtocol
public void setEventHandler(IRpcBrokerEventHandler eventHandler)
setEventHandler
in interface IRpcProtocol
public BrokerException createBrokerException(java.lang.Exception e, java.lang.String action, int code)
createBrokerException
in interface IRpcProtocol
protected java.lang.String getServerPacket() throws BrokerException
BrokerException
public abstract boolean connect(java.lang.String server, int port) throws BrokerException
connect
in interface IRpcProtocol
BrokerException
public java.lang.String call(java.lang.String remoteProcedure, Params params) throws BrokerException
call
in interface IRpcProtocol
BrokerException
public boolean disconnect() throws BrokerException
disconnect
in interface IRpcProtocol
BrokerException
public void onSocketConnect()
public void onSocketDisconnect()
public void onSocketException(java.lang.Exception e)