JBoss Remoting 3.1.0.Beta2

org.jboss.remoting3.spi
Class SpiUtils

java.lang.Object
  extended by org.jboss.remoting3.spi.SpiUtils

public final class SpiUtils
extends Object

Utility methods for Remoting service providers.


Method Summary
static CloseHandler<Object> closingCloseHandler(Closeable c)
          A close handler which closes another resource.
static void safeHandleCancellation(LocalReplyHandler replyHandler)
          Safely notify a reply handler of a cancellation.
static void safeHandleCancellation(RemoteReplyHandler replyHandler)
          Safely notify a reply handler of a cancellation.
static
<T> void
safeHandleClose(CloseHandler<? super T> handler, T closed)
          Safely handle a close notification.
static void safeHandleException(LocalReplyHandler replyHandler, IOException exception)
          Safely notify a reply handler of an exception.
static void safeHandleException(RemoteReplyHandler replyHandler, IOException exception)
          Safely notify a reply handler of an exception.
static
<O> void
safeHandleReply(LocalReplyHandler replyHandler, O reply)
          Safely notify a reply handler of a reply.
static
<O> void
safeHandleReply(RemoteReplyHandler replyHandler, O reply)
          Safely notify a reply handler of a reply.
static
<O> void
safeNotifyCancellation(RequestCancelHandler<O> handler, RequestContext<O> requestContext)
          Safely notify a request listener's cancel handler of cancellation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

safeHandleException

public static void safeHandleException(RemoteReplyHandler replyHandler,
                                       IOException exception)
Safely notify a reply handler of an exception.

Parameters:
replyHandler - the reply handler
exception - the exception

safeHandleException

public static void safeHandleException(LocalReplyHandler replyHandler,
                                       IOException exception)
Safely notify a reply handler of an exception.

Parameters:
replyHandler - the reply handler
exception - the exception

safeHandleReply

public static <O> void safeHandleReply(RemoteReplyHandler replyHandler,
                                       O reply)
Safely notify a reply handler of a reply.

Type Parameters:
O - the reply type
Parameters:
replyHandler - the reply handler
reply - the reply

safeHandleReply

public static <O> void safeHandleReply(LocalReplyHandler replyHandler,
                                       O reply)
Safely notify a reply handler of a reply.

Type Parameters:
O - the reply type
Parameters:
replyHandler - the reply handler
reply - the reply

safeHandleCancellation

public static void safeHandleCancellation(RemoteReplyHandler replyHandler)
Safely notify a reply handler of a cancellation.

Parameters:
replyHandler - the reply handler

safeHandleCancellation

public static void safeHandleCancellation(LocalReplyHandler replyHandler)
Safely notify a reply handler of a cancellation.

Parameters:
replyHandler - the reply handler

safeNotifyCancellation

public static <O> void safeNotifyCancellation(RequestCancelHandler<O> handler,
                                              RequestContext<O> requestContext)
Safely notify a request listener's cancel handler of cancellation.

Type Parameters:
O - the reply type
Parameters:
handler - the request cancel handler
requestContext - the request context

safeHandleClose

public static <T> void safeHandleClose(CloseHandler<? super T> handler,
                                       T closed)
Safely handle a close notification.

Type Parameters:
T - the type of the closable resource
Parameters:
handler - the close handler
closed - the object that was closed

closingCloseHandler

public static CloseHandler<Object> closingCloseHandler(Closeable c)
A close handler which closes another resource.

Parameters:
c - the resource to close
Returns:
the close handler

JBoss Remoting 3.1.0.Beta2

Copyright © 2010 JBoss, a division of Red Hat, Inc.