net.rim.pushsdk.commons
Class DefaultPropertyStore

java.lang.Object
  extended by net.rim.pushsdk.commons.PropertyStore
      extended by net.rim.pushsdk.commons.DefaultPropertyStore

public class DefaultPropertyStore
extends PropertyStore

Default implementation of PropertyStore.
Uses the standard Java ResourceBundle class that supports caching of properties and automatically reload the cache periodically. When set programmatically, property values are kept in memory and supersede those in the ResourceBundle.

Dependencies that must be injected to properly initialize this object for use:
- timeToLive (the time to live defaults to 60000 milliseconds, it can be overriden by calling setTimeToLive(int))

Author:
mhogan

Field Summary
static String PUSH_SDK_RESOURCES_FILENAME
          The name of the resource bundle.
 
Constructor Summary
DefaultPropertyStore()
           
 
Method Summary
 String getProperty(String property)
          Gets the value associated with the given property.
 void setProperty(String property, String value)
          Sets the property-value pair.
 void setTimeToLive(int timeToLive)
          Sets the default time to live in milliseconds.
 
Methods inherited from class net.rim.pushsdk.commons.PropertyStore
getBooleanProperty, getDoubleProperty, getIntegerProperty, getLongProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUSH_SDK_RESOURCES_FILENAME

public static final String PUSH_SDK_RESOURCES_FILENAME
The name of the resource bundle.

See Also:
Constant Field Values
Constructor Detail

DefaultPropertyStore

public DefaultPropertyStore()
Method Detail

setTimeToLive

public void setTimeToLive(int timeToLive)
Sets the default time to live in milliseconds. If this method is not called, the default is 60000 (i.e. 60 seconds).

Parameters:
timeToLive - the default time to live in milliseconds

getProperty

public String getProperty(String property)
Description copied from class: PropertyStore
Gets the value associated with the given property.

Specified by:
getProperty in class PropertyStore
Parameters:
property - the property name
Returns:
the property value

setProperty

public void setProperty(String property,
                        String value)
Description copied from class: PropertyStore
Sets the property-value pair.

Specified by:
setProperty in class PropertyStore
Parameters:
property - the property name
value - the property value


Copyright © 2011 Research In Motion. All Rights Reserved.