org.jboss.remoting.spi
Class SpiUtils

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

public final class SpiUtils
extends Object

Utility methods for Remoting service providers.


Method Summary
static RemoteRequestContext getBlankRemoteRequestContext()
           
static void safeHandleCancellation(ReplyHandler 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(ReplyHandler replyHandler, IOException exception)
          Safely notify a reply handler of an exception.
static
<O> void
safeHandleReply(ReplyHandler 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(ReplyHandler replyHandler,
                                       IOException exception)
Safely notify a reply handler of an exception.

Parameters:
replyHandler - the reply handler
exception -

safeHandleReply

public static <O> void safeHandleReply(ReplyHandler 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(ReplyHandler 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.

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

getBlankRemoteRequestContext

public static RemoteRequestContext getBlankRemoteRequestContext()


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