Package com.google.gwt.gears.localserver.client

Examples of com.google.gwt.gears.localserver.client.ManagedResourceStore


    }

    private void doLocalServer() throws GearsException {
        LocalServer localServer = new LocalServer();

        final ManagedResourceStore managedResourceStore = localServer
                .createManagedResourceStore("ToCollege.net");
        try {
            managedResourceStore.setManifestURL(Interactive
                    .getRelativeURL(MANIFEST_URL));
        } catch (Exception e) {
            // expected in hosted mode. catches JS exception from setting
            // 8080 when running on 8888
            throw new GearsException(e.getMessage());
        }

        new Timer() {
            public void run() {
                switch (managedResourceStore.getUpdateStatus()) {
                case ManagedResourceStore.UPDATE_OK:
                    Log.info("UPDATE_OK "
                            + managedResourceStore.getCurrentVersion());
                    cancel();
                    break;
                case ManagedResourceStore.UPDATE_CHECKING:
                    Log.debug("Checking "
                            + managedResourceStore.getCurrentVersion());
                    break;
                case ManagedResourceStore.UPDATE_DOWNLOADING:
                    Log.debug("Downloading "
                            + managedResourceStore.getCurrentVersion());
                    break;
                case ManagedResourceStore.UPDATE_FAILED:
                    Log.warn("Fail "
                            + managedResourceStore.getCurrentVersion());
                    Log.warn(managedResourceStore.getLastErrorMessage());
                    cancel();
                    break;
                }

            }
        }.scheduleRepeating(2000);
        managedResourceStore.checkForUpdate();
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.gears.localserver.client.ManagedResourceStore

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.