本文整理汇总了Java中org.red5.server.api.service.IPendingServiceCallback类的典型用法代码示例。如果您正苦于以下问题:Java IPendingServiceCallback类的具体用法?Java IPendingServiceCallback怎么用?Java IPendingServiceCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPendingServiceCallback类属于org.red5.server.api.service包,在下文中一共展示了IPendingServiceCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handlePendingCallResult
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/**
* Handler for pending call result. Dispatches results to all pending call handlers.
*
* @param conn
* Connection
* @param invoke
* Pending call result event context
*/
protected void handlePendingCallResult(RTMPConnection conn, Invoke invoke) {
final IServiceCall call = invoke.getCall();
final IPendingServiceCall pendingCall = conn.retrievePendingCall(invoke.getTransactionId());
if (pendingCall != null) {
// The client sent a response to a previously made call.
Object[] args = call.getArguments();
if (args != null && args.length > 0) {
// TODO: can a client return multiple results?
pendingCall.setResult(args[0]);
}
Set<IPendingServiceCallback> callbacks = pendingCall.getCallbacks();
if (!callbacks.isEmpty()) {
HashSet<IPendingServiceCallback> tmp = new HashSet<>();
tmp.addAll(callbacks);
for (IPendingServiceCallback callback : tmp) {
try {
callback.resultReceived(pendingCall);
} catch (Exception e) {
log.error("Error while executing callback {}", callback, e);
}
}
}
}
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:33,代码来源:BaseRTMPHandler.java
示例2: handlePendingCallResult
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/**
* Handler for pending call result. Dispatches results to all pending call
* handlers.
*
* @param conn
* Connection
* @param invoke
* Pending call result event context
*/
protected void handlePendingCallResult(RTMPConnection conn, Notify invoke) {
final IServiceCall call = invoke.getCall();
final IPendingServiceCall pendingCall = conn.retrievePendingCall(invoke.getInvokeId());
if (pendingCall != null) {
// The client sent a response to a previously made call.
Object[] args = call.getArguments();
if (args != null && args.length > 0) {
// TODO: can a client return multiple results?
pendingCall.setResult(args[0]);
}
Set<IPendingServiceCallback> callbacks = pendingCall.getCallbacks();
if (!callbacks.isEmpty()) {
HashSet<IPendingServiceCallback> tmp = new HashSet<IPendingServiceCallback>();
tmp.addAll(callbacks);
for (IPendingServiceCallback callback : tmp) {
try {
callback.resultReceived(pendingCall);
} catch (Exception e) {
log.error("Error while executing callback {}", callback, e);
}
}
}
}
}
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:34,代码来源:BaseRTMPHandler.java
示例3: MessageSender
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
public MessageSender(IConnection current, IScope _scope, String method, Object msg, IPendingServiceCallback callback) {
this.current = current;
scope = _scope == null && current != null ? current.getScope() : _scope;
this.method = method;
this.msg = msg;
this.callback = callback;
}
开发者ID:apache,项目名称:openmeetings,代码行数:8,代码来源:ScopeApplicationAdapter.java
示例4: sendPendingServiceCallsCloseError
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/**
* When the connection has been closed, notify any remaining pending service calls that they have failed because the connection is
* broken. Implementors of IPendingServiceCallback may only deduce from this notification that it was not possible to read a result for
* this service call. It is possible that (1) the service call was never written to the service, or (2) the service call was written to
* the service and although the remote method was invoked, the connection failed before the result could be read, or (3) although the
* remote method was invoked on the service, the service implementor detected the failure of the connection and performed only partial
* processing. The caller only knows that it cannot be confirmed that the callee has invoked the service call and returned a result.
*/
public void sendPendingServiceCallsCloseError() {
if (pendingCalls != null && !pendingCalls.isEmpty()) {
if (log.isDebugEnabled()) {
log.debug("Connection calls pending: {}", pendingCalls.size());
}
for (IPendingServiceCall call : pendingCalls.values()) {
call.setStatus(Call.STATUS_NOT_CONNECTED);
for (IPendingServiceCallback callback : call.getCallbacks()) {
callback.resultReceived(call);
}
}
}
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:22,代码来源:RTMPConnection.java
示例5: invoke
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/** {@inheritDoc} */
public void invoke(String method, Object[] params, IPendingServiceCallback callback) {
IPendingServiceCall call = new PendingCall(method, params);
if (callback != null) {
call.registerCallback(callback);
}
invoke(call);
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:9,代码来源:RTMPConnection.java
示例6: invoke
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/**
* Invoke a method on the server.
*
* @param method
* Method name
* @param callback
* Callback handler
*/
@Override
public void invoke(String method, IPendingServiceCallback callback) {
log.debug("invoke method: {} params {} callback {}", new Object[] { method, callback });
// get it from the conn manager
if (conn != null) {
conn.invoke(method, callback);
} else {
log.info("Connection was null");
PendingCall result = new PendingCall(method);
result.setStatus(Call.STATUS_NOT_CONNECTED);
callback.resultReceived(result);
}
}
开发者ID:Red5,项目名称:red5-client,代码行数:22,代码来源:BaseRTMPClientHandler.java
示例7: sendToRelay
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
public void sendToRelay(String functionName, Object[] params) {
Object[] functionplusparams = new Object[params.length+1];
functionplusparams[0]=functionName;
for (int i=1; i<functionplusparams.length; i++) functionplusparams[i]=params[i-1];
invoke("fromRelayClient", functionplusparams, new IPendingServiceCallback() {
@Override
public void resultReceived(IPendingServiceCall iPendingServiceCall) {
}
});
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:13,代码来源:Red5Client.java
示例8: sendPendingServiceCallsCloseError
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/**
* When the connection has been closed, notify any remaining pending service calls that they have failed because
* the connection is broken. Implementors of IPendingServiceCallback may only deduce from this notification that
* it was not possible to read a result for this service call. It is possible that (1) the service call was never
* written to the service, or (2) the service call was written to the service and although the remote method was
* invoked, the connection failed before the result could be read, or (3) although the remote method was invoked
* on the service, the service implementor detected the failure of the connection and performed only partial
* processing. The caller only knows that it cannot be confirmed that the callee has invoked the service call
* and returned a result.
*/
public void sendPendingServiceCallsCloseError() {
if (pendingCalls != null && !pendingCalls.isEmpty()) {
for (IPendingServiceCall call : pendingCalls.values()) {
call.setStatus(Call.STATUS_NOT_CONNECTED);
for (IPendingServiceCallback callback : call.getCallbacks()) {
callback.resultReceived(call);
}
}
}
}
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:21,代码来源:RTMPConnection.java
示例9: invoke
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/** {@inheritDoc} */
public void invoke(String method, Object[] params, IPendingServiceCallback callback) {
IPendingServiceCall call = new PendingCall(method, params);
if (callback != null) {
call.registerCallback(callback);
}
invoke(call);
}
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:9,代码来源:RTMPConnection.java
示例10: invoke
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
@Override
public void invoke(String name, Object[] params, IPendingServiceCallback callback) {
if ("echo".equals(name)) {
echo(params);
}
IPendingServiceCall call = new PendingCall(null, name, params);
call.setResult(Boolean.TRUE);
callback.resultReceived(call);
}
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:10,代码来源:TestConnection.java
示例11: registerCallback
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/** {@inheritDoc} */
public void registerCallback(IPendingServiceCallback callback) {
callbacks.add(callback);
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:5,代码来源:PendingCall.java
示例12: unregisterCallback
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/** {@inheritDoc} */
public void unregisterCallback(IPendingServiceCallback callback) {
callbacks.remove(callback);
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:5,代码来源:PendingCall.java
示例13: getCallbacks
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/** {@inheritDoc} */
public Set<IPendingServiceCallback> getCallbacks() {
return callbacks;
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:5,代码来源:PendingCall.java
示例14: ClientInvokeEvent
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
public ClientInvokeEvent(String method, Object[] params, IPendingServiceCallback callback) {
super(Type.CLIENT_INVOKE);
this.method = method;
this.params = params;
this.callback = callback;
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:7,代码来源:ClientInvokeEvent.java
示例15: build
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
public final static ClientInvokeEvent build(String method, Object[] params, IPendingServiceCallback callback) {
ClientInvokeEvent event = new ClientInvokeEvent(method, params, callback);
return event;
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:5,代码来源:ClientInvokeEvent.java
示例16: getCallback
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
/**
* @return the callback
*/
public IPendingServiceCallback getCallback() {
return callback;
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:7,代码来源:ClientInvokeEvent.java
示例17: createStream
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
@Override
public void createStream(IPendingServiceCallback callback) {
log.debug("createStream - callback: {}", callback);
IPendingServiceCallback wrapper = new CreateStreamCallBack(callback);
invoke("createStream", null, wrapper);
}
开发者ID:Red5,项目名称:red5-client,代码行数:7,代码来源:BaseRTMPClientHandler.java
示例18: releaseStream
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
public void releaseStream(IPendingServiceCallback callback, Object[] params) {
log.debug("releaseStream - callback: {}", callback);
IPendingServiceCallback wrapper = new ReleaseStreamCallBack(callback);
invoke("releaseStream", params, wrapper);
}
开发者ID:Red5,项目名称:red5-client,代码行数:6,代码来源:BaseRTMPClientHandler.java
示例19: deleteStream
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
public void deleteStream(IPendingServiceCallback callback) {
log.debug("deleteStream - callback: {}", callback);
IPendingServiceCallback wrapper = new DeleteStreamCallBack(callback);
invoke("deleteStream", null, wrapper);
}
开发者ID:Red5,项目名称:red5-client,代码行数:6,代码来源:BaseRTMPClientHandler.java
示例20: subscribe
import org.red5.server.api.service.IPendingServiceCallback; //导入依赖的package包/类
public void subscribe(IPendingServiceCallback callback, Object[] params) {
log.debug("subscribe - callback: {}", callback);
IPendingServiceCallback wrapper = new SubscribeStreamCallBack(callback);
invoke("FCSubscribe", params, wrapper);
}
开发者ID:Red5,项目名称:red5-client,代码行数:6,代码来源:BaseRTMPClientHandler.java
注:本文中的org.red5.server.api.service.IPendingServiceCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论