com.opensymphony.module.propertyset.ejb.types
Class DataEntityEJB

java.lang.Object
  |
  +--com.opensymphony.module.propertyset.ejb.types.DataEntityEJB
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, java.io.Serializable
Direct Known Subclasses:
PropertyDataCMP

public abstract class DataEntityEJB
extends java.lang.Object
implements javax.ejb.EntityBean

AbstractValueEntityEJB concrete implementation optimized for storing binary data. This can be used to store TEXT, OBJECT, DATA, XML, PROPERTIES or anything else that cannot be stored elsewhere.

Version:
$Revision: 1.10 $
Author:
Joe Walnes
See Also:
Serialized Form

Constructor Summary
DataEntityEJB()
           
 
Method Summary
protected  int[] allowedTypes()
          Returns { PropertySet.TEXT, PropertySet.OBJECT, PropertySet.XML, PropertySet.DATA, PropertySet.PROPERTIES }
 void ejbActivate()
           
 java.lang.Long ejbCreate(int type, long id)
           
 void ejbLoad()
           
 void ejbPassivate()
           
 void ejbPostCreate(int type, long id)
           
 void ejbRemove()
           
 void ejbStore()
           
abstract  byte[] getBytes()
           
abstract  java.lang.Long getId()
           
 java.io.Serializable getValue(int type)
          Create appropriate wrapper object around value (String, Object, Document, Data, Properties).
abstract  void setBytes(byte[] data)
           
 void setEntityContext(javax.ejb.EntityContext context)
           
abstract  void setId(java.lang.Long id)
           
 void setValue(int type, java.io.Serializable value)
          Set the value.
 void unsetEntityContext()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataEntityEJB

public DataEntityEJB()
Method Detail

getId

public abstract java.lang.Long getId()

setId

public abstract void setId(java.lang.Long id)

getBytes

public abstract byte[] getBytes()

setBytes

public abstract void setBytes(byte[] data)

getValue

public java.io.Serializable getValue(int type)
Create appropriate wrapper object around value (String, Object, Document, Data, Properties).

setValue

public void setValue(int type,
                     java.io.Serializable value)
Set the value. Depending on the type, different casting serializing will occur.

For TEXT, value must be java.lang.String.
For OBJECT, value must be Serializable object.
For XML, value must be org.w3c.dom.Document.
For DATA, value must be com.opensymphony.util.Data
For PROPERTIES, value must be java.util.Properties


allowedTypes

protected int[] allowedTypes()
Returns { PropertySet.TEXT, PropertySet.OBJECT, PropertySet.XML, PropertySet.DATA, PropertySet.PROPERTIES }
See Also:
com.opensymphony.module.propertyset.ejb.AbstractValueEntityEJB#allowedTypes()

ejbCreate

public java.lang.Long ejbCreate(int type,
                                long id)
                         throws javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate(int type,
                          long id)
                   throws javax.ejb.CreateException

setEntityContext

public void setEntityContext(javax.ejb.EntityContext context)
Specified by:
setEntityContext in interface javax.ejb.EntityBean

unsetEntityContext

public void unsetEntityContext()
Specified by:
unsetEntityContext in interface javax.ejb.EntityBean

ejbRemove

public void ejbRemove()
               throws javax.ejb.RemoveException
Specified by:
ejbRemove in interface javax.ejb.EntityBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.EntityBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.EntityBean

ejbLoad

public void ejbLoad()
Specified by:
ejbLoad in interface javax.ejb.EntityBean

ejbStore

public void ejbStore()
Specified by:
ejbStore in interface javax.ejb.EntityBean

See www.opensymphony.com for more information.