Examples of ClosedAsynchronousChannelException


Examples of com.sun.sgs.nio.channels.ClosedAsynchronousChannelException

    {
        FutureTask<Void> task = new FutureTask<Void>(
            new Callable<Void>() {
                public Void call() throws IOException {
                    if (!channel.isOpen()) {
                        throw new ClosedAsynchronousChannelException();
                    }

                    channel.disconnect();
                    return null;
                } })
            {
                @Override protected void done() {
                    key.runCompletion(handler, attachment, this);
                }
            };

        if (!channel.isOpen()) {
            throw new ClosedAsynchronousChannelException();
        }

        key.execute(task);
        return AttachedFuture.wrap(task, attachment);
    }
View Full Code Here

Examples of com.sun.sgs.nio.channels.ClosedAsynchronousChannelException

                Future<Void> result = Util.finishedFuture(null);
                key.runCompletion(handler, attachment, result);
                return AttachedFuture.wrap(result, attachment);
            }
        } catch (ClosedChannelException e) {
            throw Util.initCause(new ClosedAsynchronousChannelException(), e);
        } catch (IOException e) {
            Future<Void> result = Util.failedFuture(e);
            key.runCompletion(handler, attachment, result);
            return AttachedFuture.wrap(result, attachment);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.