net.tomp2p.futures
Class FutureChannel
java.lang.Object
net.tomp2p.futures.BaseFutureImpl
net.tomp2p.futures.FutureChannel
- All Implemented Interfaces:
- BaseFuture, Cancellable
public class FutureChannel
- extends BaseFutureImpl
Keeps track of the creation of a UDP or TCP channel. Since this may take a
while, we return a future, and the user gets notified when its finished.
- Author:
- Thomas Bocek
Method Summary |
org.jboss.netty.channel.Channel |
getChannel()
|
boolean |
isAcquired()
|
void |
setAcquired(boolean semaphoreAcquired)
Set a flag if a semaphore has been acquired for this channel. |
void |
setChannel(org.jboss.netty.channel.Channel channel)
Finishes this future. |
Methods inherited from class net.tomp2p.futures.BaseFutureImpl |
addCancellation, addListener, await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, getFailedReason, getType, isCompleted, isFailed, isSuccess, notifyListerenrs, removeCancellation, removeListener, setCompletedAndNotify, setFailed, setFailed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FutureChannel
public FutureChannel()
setChannel
public void setChannel(org.jboss.netty.channel.Channel channel)
- Finishes this future.
- Parameters:
channel
- The created UDP or TCP Netty channel
getChannel
public org.jboss.netty.channel.Channel getChannel()
- Returns:
- The created UDP or TCP Netty channel
setAcquired
public void setAcquired(boolean semaphoreAcquired)
- Set a flag if a semaphore has been acquired for this channel. If it is
not set, and we cannot create new channel, the creation of this channel
will be put in a queue and executed later.
- Parameters:
semaphoreAcquired
- True if we already could acquire a semaphore
isAcquired
public boolean isAcquired()
- Returns:
- The state if the channel has acquired a semaphore
Copyright © 2012. All Rights Reserved.