com.mf.kennewick.broker
Class EJBBroker

java.lang.Object
  extended bycom.mf.kennewick.broker.EJBBroker
All Implemented Interfaces:
IBroker

public abstract class EJBBroker
extends java.lang.Object
implements IBroker

Base class for EJB based brokers.


Constructor Summary
EJBBroker()
           
 
Method Summary
protected  boolean asBoolean(char rawValue)
           
 boolean asBoolean(java.lang.String rawValue)
           
protected  java.util.Date asDate(long aLong)
           
protected  ObjectIdentifier asIdentifier(java.lang.String id)
           
protected  java.lang.String asIdString(KennewickObject anObject)
           
protected  java.lang.String asIdString(ObjectIdentifier id)
           
protected  long asLong(java.util.Date date)
           
 java.lang.String asQueryString(boolean aValue)
           
 java.lang.String asQueryString(java.util.Date aDate)
           
 java.lang.String asQueryString(double aNumber)
           
 java.lang.String asQueryString(float aNumber)
           
 java.lang.String asQueryString(int aNumber)
           
 java.lang.String asQueryString(KennewickObject anObject)
           
 java.lang.String asQueryString(long aNumber)
           
 java.lang.String asQueryString(ObjectIdentifier anId)
           
 java.lang.String asQueryString(java.lang.String aString)
           
protected  char charEncode(boolean aValue)
           
 void delete(KennewickObject anObject, ITransaction aTransaction)
           
protected  void deleteImpl(KennewickObject anObject)
           
protected  boolean domainInclude(java.util.Collection domainObjects, KennewickObject anObject)
           
protected  java.util.Collection ejbsToDomainObjects(java.util.Collection ejbs)
           
protected  KennewickObject ejbToDomainObject(java.lang.Object ejb)
           
protected  java.lang.Object getBeanInstance(java.lang.String id)
           
protected  java.lang.Object getHomeInstance()
           
abstract  javax.ejb.EJBLocalHome getLocalHomeInterface()
           
protected  java.lang.Class getPersistentSuperClass(java.lang.Class clazz)
           
abstract  javax.ejb.EJBHome getRemoteHomeInterface()
           
protected  EJBTransaction getTransaction()
           
protected  java.lang.Object getValueObjectInstance(java.lang.String id)
           
protected  KennewickObject instantiateDomainObject(java.lang.Object entityBean)
           
protected  boolean isPersistentBaseClass()
           
 boolean isUsingRemoteInterface()
           
 KennewickObject lazyLoadChildObject(KennewickObject anObject, java.lang.String fieldName)
           
 java.util.Collection lazyLoadCollection(KennewickObject anObject, java.lang.String fieldName)
           
 java.util.Map lazyLoadMap(KennewickObject anObject, java.lang.String fieldName)
           
abstract  java.lang.Object localBeanToValueObject(javax.ejb.EJBLocalObject localObject)
           
abstract  KennewickObject newDomainObject()
           
abstract  java.lang.Object newValueObject()
           
abstract  void populateDomainObject(java.lang.Object valueObject, KennewickObject domainObject)
           
protected  void populateDomainObjectImpl(java.lang.Object valueObject, KennewickObject domainObject, boolean firstInvocation)
           
abstract  void populateValueObject(java.lang.Object valueObject, KennewickObject domainObject)
           
protected  void populateValueObjectImpl(java.lang.Object valueObject, KennewickObject domainObject)
           
abstract  java.lang.Object remoteBeanToValueObject(javax.ejb.EJBObject remoteObject)
           
 java.util.Collection retrieveAll(java.lang.Class objectClass, ITransaction aTransaction)
           
 KennewickObject retrieveSingleObjectByID(java.lang.Class objectClass, ObjectIdentifier anId, ITransaction aTransaction)
           
protected  java.lang.Object retrieveValueObject(java.lang.String id)
           
 void save(KennewickObject anObject, ITransaction aTransaction)
          Saves the object passed in to the database using the given transaction.
protected  void saveImpl(KennewickObject anObject)
           
 void setUsingRemoteInterface(boolean b)
           
protected  java.lang.String stringEncode(boolean aValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.mf.kennewick.broker.IBroker
searchObjects
 

Constructor Detail

EJBBroker

public EJBBroker()
Method Detail

asBoolean

protected boolean asBoolean(char rawValue)

asDate

protected java.util.Date asDate(long aLong)

isPersistentBaseClass

protected boolean isPersistentBaseClass()

getTransaction

protected EJBTransaction getTransaction()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

asIdentifier

protected ObjectIdentifier asIdentifier(java.lang.String id)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

asIdString

protected java.lang.String asIdString(KennewickObject anObject)

asIdString

protected java.lang.String asIdString(ObjectIdentifier id)

asLong

protected long asLong(java.util.Date date)

asQueryString

public java.lang.String asQueryString(java.util.Date aDate)

charEncode

protected char charEncode(boolean aValue)

stringEncode

protected java.lang.String stringEncode(boolean aValue)

save

public void save(KennewickObject anObject,
                 ITransaction aTransaction)
          throws java.lang.Exception
Description copied from interface: IBroker
Saves the object passed in to the database using the given transaction. If aTransaction is null, then the object is automatically committed.

Specified by:
save in interface IBroker
Parameters:
anObject -
aTransaction -
Throws:
java.lang.Exception

saveImpl

protected void saveImpl(KennewickObject anObject)
                 throws java.lang.Exception
Throws:
java.lang.Exception

delete

public void delete(KennewickObject anObject,
                   ITransaction aTransaction)
            throws java.lang.Exception
Specified by:
delete in interface IBroker
Throws:
java.lang.Exception

getPersistentSuperClass

protected java.lang.Class getPersistentSuperClass(java.lang.Class clazz)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

deleteImpl

protected void deleteImpl(KennewickObject anObject)
                   throws java.lang.Exception
Throws:
java.lang.Exception

getHomeInstance

protected java.lang.Object getHomeInstance()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

lazyLoadCollection

public java.util.Collection lazyLoadCollection(KennewickObject anObject,
                                               java.lang.String fieldName)
                                        throws java.lang.Exception
Specified by:
lazyLoadCollection in interface IBroker
Throws:
java.lang.Exception

lazyLoadChildObject

public KennewickObject lazyLoadChildObject(KennewickObject anObject,
                                           java.lang.String fieldName)
                                    throws java.lang.Exception
Specified by:
lazyLoadChildObject in interface IBroker
Throws:
java.lang.Exception

instantiateDomainObject

protected KennewickObject instantiateDomainObject(java.lang.Object entityBean)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

retrieveSingleObjectByID

public KennewickObject retrieveSingleObjectByID(java.lang.Class objectClass,
                                                ObjectIdentifier anId,
                                                ITransaction aTransaction)
                                         throws java.lang.Exception
Specified by:
retrieveSingleObjectByID in interface IBroker
Throws:
java.lang.Exception

retrieveValueObject

protected java.lang.Object retrieveValueObject(java.lang.String id)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

populateValueObject

public abstract void populateValueObject(java.lang.Object valueObject,
                                         KennewickObject domainObject)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

populateDomainObject

public abstract void populateDomainObject(java.lang.Object valueObject,
                                          KennewickObject domainObject)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getRemoteHomeInterface

public abstract javax.ejb.EJBHome getRemoteHomeInterface()
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

getLocalHomeInterface

public abstract javax.ejb.EJBLocalHome getLocalHomeInterface()
                                                      throws java.lang.Exception
Throws:
java.lang.Exception

localBeanToValueObject

public abstract java.lang.Object localBeanToValueObject(javax.ejb.EJBLocalObject localObject)

remoteBeanToValueObject

public abstract java.lang.Object remoteBeanToValueObject(javax.ejb.EJBObject remoteObject)

newValueObject

public abstract java.lang.Object newValueObject()

newDomainObject

public abstract KennewickObject newDomainObject()

isUsingRemoteInterface

public boolean isUsingRemoteInterface()
Returns:

setUsingRemoteInterface

public void setUsingRemoteInterface(boolean b)
Parameters:
b -

asQueryString

public java.lang.String asQueryString(ObjectIdentifier anId)

asQueryString

public java.lang.String asQueryString(KennewickObject anObject)

asQueryString

public java.lang.String asQueryString(java.lang.String aString)

asQueryString

public java.lang.String asQueryString(int aNumber)

asQueryString

public java.lang.String asQueryString(long aNumber)

asQueryString

public java.lang.String asQueryString(float aNumber)

asQueryString

public java.lang.String asQueryString(double aNumber)

asQueryString

public java.lang.String asQueryString(boolean aValue)

asBoolean

public boolean asBoolean(java.lang.String rawValue)

retrieveAll

public java.util.Collection retrieveAll(java.lang.Class objectClass,
                                        ITransaction aTransaction)
                                 throws java.lang.Exception
Specified by:
retrieveAll in interface IBroker
Throws:
java.lang.Exception

ejbToDomainObject

protected KennewickObject ejbToDomainObject(java.lang.Object ejb)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

ejbsToDomainObjects

protected java.util.Collection ejbsToDomainObjects(java.util.Collection ejbs)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

lazyLoadMap

public java.util.Map lazyLoadMap(KennewickObject anObject,
                                 java.lang.String fieldName)
                          throws java.lang.Exception
Specified by:
lazyLoadMap in interface IBroker
Throws:
java.lang.Exception

populateValueObjectImpl

protected void populateValueObjectImpl(java.lang.Object valueObject,
                                       KennewickObject domainObject)
                                throws java.lang.Exception
Throws:
java.lang.Exception

getValueObjectInstance

protected java.lang.Object getValueObjectInstance(java.lang.String id)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

getBeanInstance

protected java.lang.Object getBeanInstance(java.lang.String id)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

domainInclude

protected boolean domainInclude(java.util.Collection domainObjects,
                                KennewickObject anObject)

populateDomainObjectImpl

protected void populateDomainObjectImpl(java.lang.Object valueObject,
                                        KennewickObject domainObject,
                                        boolean firstInvocation)
                                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2004 Media Fortress, LLC, LLC. Licensed for commercial use under the Apache 2.0 License.