Cumulus4j API
(1.1.1)

org.cumulus4j.store.resource
Class ResourceHelper

java.lang.Object
  extended by org.cumulus4j.store.resource.ResourceHelper

public class ResourceHelper
extends Object

Helper class to load resources.

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Field Summary
protected static String CUMULUS4J_BACKEND_PROPERTIES
          File name of the backend-properties.
protected static String CUMULUS4J_PERSISTENCE_PROPERTIES
           
 
Constructor Summary
ResourceHelper()
           
 
Method Summary
static Map<String,Object> getCumulus4jBackendProperties()
           Get the backend-properties (from file "cumulus4j-backend.properties").
static Map<String,Object> getCumulus4jPersistenceProperties()
           
protected static Map<String,Object> getPropertiesAsMap(Properties properties)
           
protected static InputStream openCumulus4jBackendProperties()
           Open an InputStream reading the file "cumulus4j-backend.properties".
protected static InputStream tryOpenCumulus4jPersistenceProperties()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUMULUS4J_BACKEND_PROPERTIES

protected static final String CUMULUS4J_BACKEND_PROPERTIES
File name of the backend-properties.

See Also:
getCumulus4jBackendProperties(), Constant Field Values

CUMULUS4J_PERSISTENCE_PROPERTIES

protected static final String CUMULUS4J_PERSISTENCE_PROPERTIES
See Also:
Constant Field Values
Constructor Detail

ResourceHelper

public ResourceHelper()
Method Detail

openCumulus4jBackendProperties

protected static InputStream openCumulus4jBackendProperties()

Open an InputStream reading the file "cumulus4j-backend.properties".

Important: You must close this InputStream!!!

Returns:
an InputStream (never null).
See Also:
getCumulus4jBackendProperties()

tryOpenCumulus4jPersistenceProperties

protected static InputStream tryOpenCumulus4jPersistenceProperties()

getCumulus4jBackendProperties

public static Map<String,Object> getCumulus4jBackendProperties()

Get the backend-properties (from file "cumulus4j-backend.properties").

The backend-properties are loaded from the file "cumulus4j-backend.properties" and used for the configuration of the backend-PersistenceManagerFactory. This file only contains connection-independent settings (i.e. things that should never change). The connection-dependent settings are copied from the frontend-PMF's configuration.

Additionally, all properties in the frontend-PMF's configuration starting with "cumulus4j.datanucleus." or "cumulus4j.javax." are forwarded to the backend-PMF (without the "cumulus4j."-prefix, of course) overriding the default settings.

Returns:
a Map containing all settings from the backend-properties; never null.

getCumulus4jPersistenceProperties

public static Map<String,Object> getCumulus4jPersistenceProperties()

getPropertiesAsMap

protected static Map<String,Object> getPropertiesAsMap(Properties properties)

Cumulus4j API
(1.1.1)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.