JBoss Remoting 3.1.0.Beta1

org.jboss.remoting3.stream
Interface StreamHandler<T,C extends Channel>

Type Parameters:
T - the streamable object type
C - the channel type that this handler uses
All Superinterfaces:
Serializable

public interface StreamHandler<T,C extends Channel>
extends Serializable

A stream handler for an individual object instance. Instances of this class are used on both the local and remote side. Stream handlers are non-reentrant; in other words, it is an error for a stream handler to have a stream type as one of its serializable fields or for a stream handler's writeObject method (if any) to write a stream type.


Method Summary
 org.jboss.xnio.ChannelListener<? super C> getLocalHandler()
          Get the local XNIO open handler for this stream.
 org.jboss.xnio.ChannelListener<? super C> getRemoteHandler()
          Get the remote XNIO open handler for this stream.
 T getRemoteProxy(org.jboss.xnio.IoFuture<? extends C> futureChannel)
          Get the remote proxy instance for this stream.
 

Method Detail

getLocalHandler

org.jboss.xnio.ChannelListener<? super C> getLocalHandler()
Get the local XNIO open handler for this stream. If this handler is cached on the object, it should be done in a transient fashion to prevent the local handler from being sent to the remote side.

Returns:
the local XNIO handler

getRemoteHandler

org.jboss.xnio.ChannelListener<? super C> getRemoteHandler()
Get the remote XNIO open handler for this stream. The remote handler should not be instantiated until the StreamHandler instance is on the remote side to avoid copying the handler across the wire.

Returns:
the remote XNIO handler

getRemoteProxy

T getRemoteProxy(org.jboss.xnio.IoFuture<? extends C> futureChannel)
Get the remote proxy instance for this stream. The remote proxy should not be instantiated until the StreamHandler instance is on the remote side to avoid copying the proxy instance across the wire. This method will be called after getRemoteHandler().

Parameters:
futureChannel - the future channel
Returns:
the remote proxy instance

JBoss Remoting 3.1.0.Beta1

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