Package org.apache.cayenne.pref

Examples of org.apache.cayenne.pref.HSQLEmbeddedPreferenceService


        }

        String preferencesDB = new File(dbDir, "db").getAbsolutePath();

        // create custom preferences service...
        HSQLEmbeddedPreferenceService service = new HSQLEmbeddedPreferenceService(
                preferencesDB,
                Application.PREFERENCES_MAP_PACKAGE,
                name) {

            protected void startTimer() {
                // noop: disable commit timer
            }

            protected void initPreferences() {
                // noop: disable commit timer
            }

            protected void initSchema() {
                // throw - no schema means no DataSource data
                throw new CayenneRuntimeException("No preferences matching location: "
                        + location);
            }
        };

        try {
            service.startService();
            return toDataSource(service.getDataContext(), location);
        }
        finally {
            // make sure we cleanup after ourselves...
            try {
                service.stopService();
            }
            catch (Throwable th) {
                // ignore..
            }
        }
View Full Code Here


            });
        }
    }

    protected void initPreferences() {
        HSQLEmbeddedPreferenceService service = new HSQLEmbeddedPreferenceService(
                preferencesDB,
                PREFERENCES_MAP_PACKAGE,
                getName());
        service.stopOnShutdown();
        this.preferenceService = service;
        this.preferenceService.startService();

        // test service
        getPreferenceDomain();
View Full Code Here

            });
        }
    }

    protected void initPreferences() {
        HSQLEmbeddedPreferenceService service = new HSQLEmbeddedPreferenceService(
                preferencesDB,
                PREFERENCES_MAP_PACKAGE,
                getName());
        service.stopOnShutdown();
        this.preferenceService = service;
        this.preferenceService.startService();

        // test service
        getPreferenceDomain();
View Full Code Here

        }

        String preferencesDB = new File(dbDir, "db").getAbsolutePath();

        // create custom preferences service...
        HSQLEmbeddedPreferenceService service = new HSQLEmbeddedPreferenceService(
                preferencesDB,
                Application.PREFERENCES_MAP_PACKAGE,
                name) {

            protected void startTimer() {
                // noop: disable commit timer
            }

            protected void initPreferences() {
                // noop: disable commit timer
            }

            protected void initSchema() {
                // throw - no schema means no DataSource data
                throw new CayenneRuntimeException("No preferences matching location: "
                        + location);
            }
        };

        try {
            service.startService();
            return toDataSource(service.getDataContext(), location);
        }
        finally {
            // make sure we cleanup after ourselves...
            try {
                service.stopService();
            }
            catch (Throwable th) {
                // ignore..
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.pref.HSQLEmbeddedPreferenceService

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.