com.avaje.ebean.config
Class GlobalProperties

java.lang.Object
  extended by com.avaje.ebean.config.GlobalProperties

public final class GlobalProperties
extends Object

    

Provides access to properties loaded from the ebean.properties file.


Constructor Summary
GlobalProperties()
           
 
Method Summary
static String evaluateExpressions(String val)
          Parse the string replacing any expressions like ${catalina.base}.
static String get(String key, String defaultValue)
          Return a String property with a default value.
static boolean getBoolean(String key, boolean defaultValue)
          Return a boolean property with a default value.
static int getInt(String key, int defaultValue)
          Return a int property with a default value.
static javax.servlet.ServletContext getServletContext()
          Return the ServletContext (if setup in a servlet container environment).
static boolean isSkipPrimaryServer()
          Return true to skip automatically creating the primary server.
static String put(String key, String defaultValue)
          Set a property return the previous value.
static void putAll(Map<String,String> keyValueMap)
          Set a Map of key value properties.
static void setServletContext(javax.servlet.ServletContext servletContext)
          In a servlet container environment this will additionally look in WEB-INF for the ebean.properties file.
static void setSkipPrimaryServer(boolean skip)
          Set whether to skip automatically creating the primary server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalProperties

public GlobalProperties()
Method Detail

setSkipPrimaryServer

public static void setSkipPrimaryServer(boolean skip)
Set whether to skip automatically creating the primary server.


isSkipPrimaryServer

public static boolean isSkipPrimaryServer()
Return true to skip automatically creating the primary server.


evaluateExpressions

public static String evaluateExpressions(String val)
Parse the string replacing any expressions like ${catalina.base}.

This will evaluate expressions using first environment variables, than java system variables and lastly properties in ebean.properties - in that order.

Expressions start with "${" and end with "}".


setServletContext

public static void setServletContext(javax.servlet.ServletContext servletContext)
In a servlet container environment this will additionally look in WEB-INF for the ebean.properties file.


getServletContext

public static javax.servlet.ServletContext getServletContext()
Return the ServletContext (if setup in a servlet container environment).


get

public static String get(String key,
                         String defaultValue)
Return a String property with a default value.


getInt

public static int getInt(String key,
                         int defaultValue)
Return a int property with a default value.


getBoolean

public static boolean getBoolean(String key,
                                 boolean defaultValue)
Return a boolean property with a default value.


put

public static String put(String key,
                         String defaultValue)
Set a property return the previous value.


putAll

public static void putAll(Map<String,String> keyValueMap)
Set a Map of key value properties.



Copyright © 2010. All Rights Reserved.