com.opensymphony.module.propertyset.ejb
Class EJBPropertySet

java.lang.Object
  extended bycom.opensymphony.module.propertyset.AbstractPropertySet
      extended bycom.opensymphony.module.propertyset.ejb.EJBPropertySet
All Implemented Interfaces:
PropertySet, java.io.Serializable

public class EJBPropertySet
extends AbstractPropertySet
implements java.io.Serializable

The EJBPropertySet is an implementation of PropertySet that uses Enterprise JavaBeans to store and retrieve Properties.

This class is a proxy to the PropertyStore Session Bean that handles the PropertySet and behind the scenes delegates to various Entity Beans to persist the data in an efficient way.

Each method in the proxy will catch any thrown RemoteException and rethrow it wrapped in a PropertyImplementationException .

Usage

In order to use an EJBPropertySet, a PropertyStore Session Bean must first be retrieved that represents the PropertySet data. This is typically either returned by another EJB, or looked up using an JNDI location for PropertyStoreHome and an int ID for the actual PropertySet used.

Required Args
  • entityId - Long that holds the ID of this entity
  • entityName - String that holds the name of this entity type

Optional Configuration

  • storeLocation - the JNDI name for the PropertyStore EJB lookup (defaults to os.PropertyStore)

Version:
$Revision: 1.3 $
Author:
, Pat Lightbody
See Also:
PropertySet, PropertyStore, PropertyStoreHome, Serialized Form

Field Summary
 
Fields inherited from class com.opensymphony.module.propertyset.AbstractPropertySet
schema
 
Fields inherited from interface com.opensymphony.module.propertyset.PropertySet
BOOLEAN, DATA, DATE, DOUBLE, INT, LONG, OBJECT, PROPERTIES, STRING, TEXT, XML
 
Constructor Summary
EJBPropertySet()
           
 
Method Summary
 boolean exists(java.lang.String key)
          Proxy to PropertyStore.exists(java.lang.String,long,java.lang.String)
protected  java.lang.Object get(int type, java.lang.String key)
          Proxy to PropertyStore.get(java.lang.String,long,int,java.lang.String)
 java.util.Collection getKeys(java.lang.String prefix, int type)
          Proxy to PropertyStore.getKeys(java.lang.String,long,java.lang.String,int)
 int getType(java.lang.String key)
          Proxy to PropertyStore.getType(java.lang.String,long,java.lang.String)
 void init(java.util.Map config, java.util.Map args)
           
 void remove()
          Proxy to PropertyStore.removeEntry(String, long, String)
 void remove(java.lang.String key)
          Proxy to PropertyStore.removeEntry(String, long, String)
protected  void setImpl(int type, java.lang.String key, java.lang.Object value)
          Proxy to PropertyStore.set(java.lang.String,long,int,java.lang.String,java.io.Serializable)
 
Methods inherited from class com.opensymphony.module.propertyset.AbstractPropertySet
getAsActualType, getBoolean, getData, getDate, getDouble, getInt, getKeys, getKeys, getKeys, getLong, getObject, getProperties, getSchema, getString, getText, getXML, isSettable, setAsActualType, setBoolean, setData, setDate, setDouble, setInt, setLong, setObject, setProperties, setSchema, setString, setText, setXML, supportsType, supportsTypes, toString, type, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EJBPropertySet

public EJBPropertySet()
Method Detail

getKeys

public java.util.Collection getKeys(java.lang.String prefix,
                                    int type)
                             throws PropertyException
Proxy to PropertyStore.getKeys(java.lang.String,long,java.lang.String,int)

Specified by:
getKeys in interface PropertySet
Parameters:
prefix - String that keys must start with. If null, than all keys shall be returned.
type - Type to list. See static class variables. If null, then all types shall be returned.
Returns:
Unmodifiable Collection of Strings.
Throws:
PropertyException

getType

public int getType(java.lang.String key)
            throws PropertyException
Proxy to PropertyStore.getType(java.lang.String,long,java.lang.String)

Specified by:
getType in interface PropertySet
Returns:
Type of value. See static class variables.
Throws:
PropertyException

exists

public boolean exists(java.lang.String key)
               throws PropertyException
Proxy to PropertyStore.exists(java.lang.String,long,java.lang.String)

Specified by:
exists in interface PropertySet
Throws:
PropertyException

init

public void init(java.util.Map config,
                 java.util.Map args)
Specified by:
init in interface PropertySet
Overrides:
init in class AbstractPropertySet

remove

public void remove()
            throws PropertyException
Proxy to PropertyStore.removeEntry(String, long, String)

Specified by:
remove in interface PropertySet
Throws:
PropertyException - if there is an error removing the propertyset.

remove

public void remove(java.lang.String key)
            throws PropertyException
Proxy to PropertyStore.removeEntry(String, long, String)

Specified by:
remove in interface PropertySet
Throws:
PropertyException

setImpl

protected void setImpl(int type,
                       java.lang.String key,
                       java.lang.Object value)
                throws PropertyException
Proxy to PropertyStore.set(java.lang.String,long,int,java.lang.String,java.io.Serializable)

Specified by:
setImpl in class AbstractPropertySet
Throws:
PropertyException

get

protected java.lang.Object get(int type,
                               java.lang.String key)
                        throws PropertyException
Proxy to PropertyStore.get(java.lang.String,long,int,java.lang.String)

Specified by:
get in class AbstractPropertySet
Throws:
PropertyException

See www.opensymphony.com for more information.

Copyright 2000-2005 - OpenSymphony