Package freenet.clients.fcp

Examples of freenet.clients.fcp.PersistentRequestClient


    public boolean migrate(PersistentRequestRoot newRoot, ObjectContainer container, NodeClientCore core,
            ClientContext context) {
        int migrated = 0;
        int failed = 0;
        try {
            PersistentRequestClient newClient;
            if(isGlobalQueue) {
                newClient = newRoot.getGlobalForeverClient();
                Logger.error(this, "Migrating global queue");
            } else {
                newClient = newRoot.registerForeverClient(name, null);
                Logger.error(this, "Migrating client \""+name+"\"");
            }
            container.activate(runningPersistentRequests, 2);
            for(ClientRequest req : runningPersistentRequests) {
                if(req == null) continue;
                try {
                    freenet.clients.fcp.ClientRequest request = req.migrate(newClient, container, core);
                    // FIXME it doesn't count as failure if it's already been migrated
                    if(request == null) {
                        failed++;
                        continue;
                    }
                    newClient.register(request);
                    request.start(context);
                    // FIXME catch standard exceptions.
                    migrated++;
                } catch (Throwable t) {
                    Logger.error(this, "Unable to migrate request: "+t, t);
                    failed++;
                }
            }
            container.activate(completedUnackedRequests, 2);
            for(ClientRequest req : completedUnackedRequests) {
                if(req == null) continue;
                try {
                    freenet.clients.fcp.ClientRequest request = req.migrate(newClient, container, core);
                    // FIXME it doesn't count as failure if it's already been migrated
                    if(request == null) {
                        failed++;
                        continue;
                    }
                    newClient.register(request);
                    request.start(context);
                    // FIXME catch standard exceptions.
                    migrated++;
                } catch (Throwable t) {
                    Logger.error(this, "Unable to migrate request: "+t, t);
View Full Code Here

TOP

Related Classes of freenet.clients.fcp.PersistentRequestClient

Copyright © 2018 www.massapicom. 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.