2008-08-08 02:37:18 +02:00
|
|
|
/*
|
2012-06-04 22:31:44 +02:00
|
|
|
* Copyright 2012 The Netty Project
|
2008-08-08 02:37:18 +02:00
|
|
|
*
|
2011-12-09 06:18:34 +01:00
|
|
|
* The Netty Project licenses this file to you under the Apache License,
|
|
|
|
* version 2.0 (the "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at:
|
2008-08-08 02:37:18 +02:00
|
|
|
*
|
2012-06-04 22:31:44 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2008-08-08 03:27:24 +02:00
|
|
|
*
|
2009-08-28 09:15:49 +02:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
2011-12-09 06:18:34 +01:00
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
2009-08-28 09:15:49 +02:00
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2008-08-08 02:37:18 +02:00
|
|
|
*/
|
2011-12-09 04:38:59 +01:00
|
|
|
package io.netty.channel;
|
2008-08-08 02:37:18 +02:00
|
|
|
|
2012-08-18 15:53:58 +02:00
|
|
|
import java.util.concurrent.ExecutionException;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeoutException;
|
2012-05-14 16:57:23 +02:00
|
|
|
|
2008-08-11 09:33:19 +02:00
|
|
|
/**
|
|
|
|
* The {@link CompleteChannelFuture} which is succeeded already. It is
|
2012-12-18 07:23:42 +01:00
|
|
|
* recommended to use {@link Channel#newSucceededFuture()} instead of
|
2008-08-11 09:33:19 +02:00
|
|
|
* calling the constructor of this future.
|
|
|
|
*/
|
2012-12-21 17:06:24 +01:00
|
|
|
class SucceededChannelFuture extends CompleteChannelFuture {
|
2008-08-08 02:37:18 +02:00
|
|
|
|
2008-08-11 09:33:19 +02:00
|
|
|
/**
|
|
|
|
* Creates a new instance.
|
|
|
|
*
|
|
|
|
* @param channel the {@link Channel} associated with this future
|
|
|
|
*/
|
2008-08-08 02:37:18 +02:00
|
|
|
public SucceededChannelFuture(Channel channel) {
|
|
|
|
super(channel);
|
|
|
|
}
|
|
|
|
|
2010-11-12 01:45:39 +01:00
|
|
|
@Override
|
2012-05-01 10:19:41 +02:00
|
|
|
public Throwable cause() {
|
2008-08-08 02:37:18 +02:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2010-11-12 01:45:39 +01:00
|
|
|
@Override
|
2008-08-08 02:37:18 +02:00
|
|
|
public boolean isSuccess() {
|
|
|
|
return true;
|
|
|
|
}
|
2012-01-19 05:33:37 +01:00
|
|
|
|
|
|
|
@Override
|
2012-05-14 16:57:23 +02:00
|
|
|
public ChannelFuture sync() throws InterruptedException {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ChannelFuture syncUninterruptibly() {
|
2012-01-19 05:33:37 +01:00
|
|
|
return this;
|
|
|
|
}
|
2012-08-18 15:53:58 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public Void get() throws InterruptedException, ExecutionException {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException,
|
|
|
|
TimeoutException {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2008-08-08 02:37:18 +02:00
|
|
|
}
|