public class WsonrpcEndpoint extends Object implements WsonrpcRemote
| 限定符和类型 | 字段和说明 |
|---|---|
protected WsonrpcEngine |
wsonrpcEngine |
| 限定符 | 构造器和说明 |
|---|---|
protected |
WsonrpcEndpoint(WsonrpcConfig config) |
protected |
WsonrpcEndpoint(WsonrpcEngine wsonrpcEngine) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
closeSession() |
void |
disconnect() |
protected WebSocketSession |
getSession() |
String |
getSessionId() |
boolean |
isConnected() |
void |
notify(String serviceName,
String methodName,
Object[] args)
同步调用远程的方法。
|
protected void |
openSession(WebSocketSession session) |
void |
ping() |
<T> Future<T> |
request(String serviceName,
String methodName,
Object[] args,
Class<T> returnType)
调用远程的方法,返回Future。
|
<T> T |
request(String serviceName,
String methodName,
Object[] args,
Class<T> returnType,
int timeout)
同步调用远端方法,并返回指定类型的调用结果。
|
void |
request(String serviceName,
String methodName,
Object[] args,
WsonrpcCallback callback)
调用远端方法。
|
protected void |
verifyOnline() |
protected final WsonrpcEngine wsonrpcEngine
protected WsonrpcEndpoint(WsonrpcConfig config)
protected WsonrpcEndpoint(WsonrpcEngine wsonrpcEngine)
protected final void openSession(WebSocketSession session)
protected WebSocketSession getSession()
protected void verifyOnline()
throws WsonrpcException
WsonrpcExceptionpublic boolean isConnected()
isConnected 在接口中 WsonrpcRemotepublic String getSessionId()
getSessionId 在接口中 WsonrpcRemotepublic void disconnect()
disconnect 在接口中 WsonrpcRemotepublic void ping()
throws Exception
ping 在接口中 WsonrpcRemoteExceptionpublic void notify(String serviceName, String methodName, Object[] args) throws IOException, WsonrpcException
Remotenotify 在接口中 RemoteIOExceptionWsonrpcExceptionpublic <T> T request(String serviceName, String methodName, Object[] args, Class<T> returnType, int timeout) throws IOException, WsonrpcException, RemoteException
Remoterequest 在接口中 Remotetimeout - 超时时间,0表示永不超时。单位为TimeUnit.MILLISECONDSIOExceptionWsonrpcExceptionRemoteExceptionpublic <T> Future<T> request(String serviceName, String methodName, Object[] args, Class<T> returnType) throws IOException, WsonrpcException
WsonrpcRemoterequest 在接口中 WsonrpcRemoteIOExceptionWsonrpcExceptionpublic void request(String serviceName, String methodName, Object[] args, WsonrpcCallback callback) throws IOException, WsonrpcException
WsonrpcRemoterequest 在接口中 WsonrpcRemoteIOExceptionWsonrpcExceptionCopyright © 2018. All rights reserved.