com.opensymphony.module.propertyset
Class EJBPropertySet

java.lang.Object
  |
  +--com.opensymphony.module.propertyset.AbstractPropertySet
        |
        +--com.opensymphony.module.propertyset.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.

Example

PropertySet ps1 = new EJBPropertySet( myBean.getPropertyStore() );

PropertySet ps2 = new EJBPropertySet( "os.PropertyStore", id );

Version:
$Revision: 1.16 $
Author:
See Also:
PropertySet, PropertyStore, PropertyStoreHome, Serialized Form

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(PropertyStoreHome home, java.lang.String entityName, long entityId)
          Create EJBPropertySet proxy by creating new PropertyStore EJB instance with given sequenceName/sequenceId from StoreMap.
EJBPropertySet(PropertyStore store, java.lang.String entityName, long entityId)
          Create EJBPropertySet proxy around supplied PropertyStore.
EJBPropertySet(java.lang.String propertyStoreHome, java.lang.String entityName, long entityId)
          Create EJBPropertySet proxy by creating new PropertyStore EJB instance with given sequenceName/sequenceId from StoreMap.
 
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 remove(java.lang.String key)
          Proxy to PropertyStore.remove(java.lang.String,long,java.lang.String)
protected  void setImpl(int type, java.lang.String key, java.lang.Object value)
          Proxy to com.opensymphony.module.propertyset.ejb.PropertyStore#set(java.lang.String,long,int,java.lang.String,java.lang.Object)
 
Methods inherited from class com.opensymphony.module.propertyset.AbstractPropertySet
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(PropertyStore store,
                      java.lang.String entityName,
                      long entityId)
Create EJBPropertySet proxy around supplied PropertyStore.

EJBPropertySet

public EJBPropertySet(PropertyStoreHome home,
                      java.lang.String entityName,
                      long entityId)
               throws java.rmi.RemoteException,
                      javax.ejb.CreateException
Create EJBPropertySet proxy by creating new PropertyStore EJB instance with given sequenceName/sequenceId from StoreMap.

EJBPropertySet

public EJBPropertySet(java.lang.String propertyStoreHome,
                      java.lang.String entityName,
                      long entityId)
               throws javax.naming.NamingException,
                      java.rmi.RemoteException,
                      javax.ejb.CreateException
Create EJBPropertySet proxy by creating new PropertyStore EJB instance with given sequenceName/sequenceId from StoreMap.
Method Detail

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)
Overrides:
get in class AbstractPropertySet

setImpl

protected void setImpl(int type,
                       java.lang.String key,
                       java.lang.Object value)
                throws PropertyException
Proxy to com.opensymphony.module.propertyset.ejb.PropertyStore#set(java.lang.String,long,int,java.lang.String,java.lang.Object)
Overrides:
setImpl in class AbstractPropertySet

exists

public boolean exists(java.lang.String key)
               throws PropertyException
Proxy to PropertyStore.exists(java.lang.String,long,java.lang.String)
Overrides:
exists in class AbstractPropertySet

remove

public void remove(java.lang.String key)
            throws PropertyException
Proxy to PropertyStore.remove(java.lang.String,long,java.lang.String)
Overrides:
remove in class AbstractPropertySet

getType

public int getType(java.lang.String key)
            throws PropertyException
Proxy to PropertyStore.getType(java.lang.String,long,java.lang.String)
Overrides:
getType in class AbstractPropertySet
Following copied from interface: com.opensymphony.module.propertyset.PropertySet
Returns:
Type of value. See static class variables.

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)
Overrides:
getKeys in class AbstractPropertySet
Following copied from interface: com.opensymphony.module.propertyset.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.

See www.opensymphony.com for more information.