net.sf.jbaobab.io
Class ExpirableSocketCore<P>

java.lang.Object
  extended by net.sf.jbaobab.io.ExpirableSocketCore<P>
All Implemented Interfaces:
ChannelCore<P>, SocketCore<P>

public class ExpirableSocketCore<P>
extends Object
implements SocketCore<P>

A SocketCore that decorates enclosing SocketCore with expiration.

Author:
Oakyoon Cha
See Also:
ReclaimableExpirer

Constructor Summary
ExpirableSocketCore(SocketCore<P> core, long timeout)
           
 
Method Summary
 SocketChannel channel()
           
 void prepare(SocketChannel channel, ChannelManager<SocketChannel> receiver, ChannelManager<SocketChannel> sender)
           
 Protocol<P> protocol()
           
 int receive(PacketHandler<P> handler)
           
 void schedulePacket(P packet)
           
 void scheduleShutdown()
           
 int send()
           
 void shutdown()
           
 String track()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpirableSocketCore

public ExpirableSocketCore(SocketCore<P> core,
                           long timeout)
Method Detail

prepare

public void prepare(SocketChannel channel,
                    ChannelManager<SocketChannel> receiver,
                    ChannelManager<SocketChannel> sender)
Specified by:
prepare in interface SocketCore<P>

channel

public SocketChannel channel()
Specified by:
channel in interface SocketCore<P>

protocol

public Protocol<P> protocol()
Specified by:
protocol in interface ChannelCore<P>

receive

public int receive(PacketHandler<P> handler)
            throws IOException
Specified by:
receive in interface ChannelCore<P>
Throws:
IOException

send

public int send()
         throws IOException
Specified by:
send in interface ChannelCore<P>
Throws:
IOException

shutdown

public void shutdown()
Specified by:
shutdown in interface ChannelCore<P>

schedulePacket

public void schedulePacket(P packet)
Specified by:
schedulePacket in interface ChannelCore<P>

scheduleShutdown

public void scheduleShutdown()
Specified by:
scheduleShutdown in interface ChannelCore<P>

track

public String track()
Specified by:
track in interface ChannelCore<P>