com.sentilla.system
Class PropertyDriver

java.lang.Object
  extended by com.sentilla.system.DriverAdapter
      extended by com.sentilla.system.PropertyDriver
All Implemented Interfaces:
Driver

public abstract class PropertyDriver
extends DriverAdapter

A PropertyDriver provides open, create, and remove for properties. The property system uses strings for names and returns RandomAccessFile interfaces for data access. When creating new properties, the maximum file size must be specified at creation time. "prop" is used as the default driver name.


Field Summary
 
Fields inherited from class com.sentilla.system.DriverAdapter
m_nextDriver
 
Constructor Summary
PropertyDriver()
           
 
Method Summary
static RandomAccessFile create(String key, int maxlength)
          Create a new property or thrown an IORuntimeException if the property cannot be created.
abstract  RandomAccessFile createProperty(String key, int maxlength)
          Create a new property or thrown an IORuntimeException if the property cannot be created.
static RandomAccessFile open(String key)
          Open an existing property or thrown an IORuntimeException if the property does not exist.
abstract  RandomAccessFile openProperty(String key)
          Open an existing property or thrown an IORuntimeException if the property does not exist.
static void remove(String key)
          Remove a property or throw an IORuntimeException if the property cannot be removed.
abstract  void removeProperty(String key)
          Remove a property or thrown an IORuntimeException if the property cannot be removed.
static void reset()
          Delete all user properties and set system properties back to their defaults.
abstract  void resetProperties()
          Delete all user properties and set system properties back to their defaults.
 
Methods inherited from class com.sentilla.system.DriverAdapter
getDriverName, getNextDriver, setNextDriver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyDriver

public PropertyDriver()
Method Detail

openProperty

public abstract RandomAccessFile openProperty(String key)
Open an existing property or thrown an IORuntimeException if the property does not exist.

Parameters:
key - the property name to open
Returns:
a new RandomAccessFile

createProperty

public abstract RandomAccessFile createProperty(String key,
                                                int maxlength)
Create a new property or thrown an IORuntimeException if the property cannot be created.

Parameters:
key - the property name to create
maxlength - the maximum data length
Returns:
a new RandomAccessFile

removeProperty

public abstract void removeProperty(String key)
Remove a property or thrown an IORuntimeException if the property cannot be removed.

Parameters:
key - the property name to remove

resetProperties

public abstract void resetProperties()
Delete all user properties and set system properties back to their defaults.


open

public static RandomAccessFile open(String key)
Open an existing property or thrown an IORuntimeException if the property does not exist.

Parameters:
key - the property name to open
Returns:
a new RandomAccessFile

create

public static RandomAccessFile create(String key,
                                      int maxlength)
Create a new property or thrown an IORuntimeException if the property cannot be created.

Parameters:
key - the property name to create
maxlength - the maximum data length
Returns:
a new RandomAccessFile

remove

public static void remove(String key)
Remove a property or throw an IORuntimeException if the property cannot be removed.

Warning: you may remove system properties with this method; they will not be restored until the reset() method is called. Removing system properties may cause undesired behavior.

Parameters:
key - the property name to remove

reset

public static void reset()
Delete all user properties and set system properties back to their defaults.



Copyright © 2007 Sentilla Corporation. All Rights Reserved.