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.


Nested Class Summary
static interface GlobalProperties.PropertySource
           
 
Constructor Summary
GlobalProperties()
           
 
Method Summary
static void evaluateExpressions()
          Parse and evaluate any expressions that have not already been evaluated.
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 GlobalProperties.PropertySource getPropertySource(String name)
           
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 value)
          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 "}".


evaluateExpressions

public static void evaluateExpressions()
Parse and evaluate any expressions that have not already been evaluated.


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 value)
Set a property return the previous value. This will evaluate any expressions in the value.


putAll

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


getPropertySource

public static GlobalProperties.PropertySource getPropertySource(String name)


Copyright © 2012. All Rights Reserved.