Examples of LocalCancellationException


Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

        IncomingTransferObject result = incomingExtProv.getPayload(receive(
            monitor, collector, 500, true));

        if (monitor.isCanceled()) {
            result.reject();
            throw new LocalCancellationException();
        }

        byte[] data = result.accept(monitor);
        String fileListAsString;
        try {
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

        }

        monitor.subTask("Waiting for archive...");
        while (!collector.hasReceived()) {
            if (monitor.isCanceled()) {
                throw new LocalCancellationException();
            }
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                throw new LocalCancellationException();
            }
        }

        monitor.subTask("Receiving archive...");
        try {
            IncomingTransferObject result = incomingExtProv.getPayload(receive(
                monitor.newChild(packetListenerIBB == null ? 10 : 1),
                collector, 10000, forceWait));

            if (monitor.isCanceled()) {
                result.reject();
                throw new LocalCancellationException();
            }
            byte[] data = result.accept(monitor
                .newChild(packetListenerIBB == null ? 90 : 9));

            return new ByteArrayInputStream(data);
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

        try {
            Packet result;
            do {
                if (monitor.isCanceled())
                    throw new LocalCancellationException();
                monitor.worked(1);
                // Wait up to [timeout] seconds for a result.
                result = collector.nextResult(timeout);
            } while (forceWait && result == null);
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

        try {
            Packet result;
            JID jid;
            while (fromUserJIDs.size() > 0) {
                if (monitor.isCanceled())
                    throw new LocalCancellationException();

                // Wait up to [timeout] milliseconds for a result.
                result = collector.nextResult(100);
                if (result == null)
                    continue;
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

            LinkedList<BinaryPacket> resultList = new LinkedList<BinaryPacket>();

            while (true) {
                if (!this.binaryChannel.isConnected())
                    throw new LocalCancellationException(
                        "Data connection lost.", CancelOption.NOTIFY_PEER);
                if (progress.isCanceled()) {
                    // reject();
                    /*
                     * @TODO: For sending, the BinaryChannel actually also
                     * expects a Reject packet to detect the cancel; see
                     * BinaryChannel.sendDirect() and the confirmation packet
                     * where else an IOException is thrown.
                     */

                    throw new LocalCancellationException(
                        "Data reception was manually cancelled.",
                        CancelOption.NOTIFY_PEER);
                }

                BinaryPacket packet;
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.