BEA Systems, Inc.

com.beasys.commerce.foundation
Class PersistableHandle

java.lang.Object
  |
  +--com.beasys.commerce.foundation.PersistableHandle

public class PersistableHandle
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

A smart handle optimizes the the use of handles for entity beans by storing a local copy of the primary key (SmartKey) for the BSC Entity. This optimizes one of the most commonly performed operations of retrieving the key without accessing the remote object. This also makes it possible to compare the entities referenced by the smart handles.

See Also:
Entity, Serialized Form

Constructor Summary
PersistableHandle()
           
PersistableHandle(ConfigurableEntity entity)
          Constructor for PersistableHandle that takes in an Entity bean.
PersistableHandle(java.lang.String keyClassName, java.lang.String homeName, java.lang.String homeClassName, SmartKey smartKey)
          Constructor for PersistableHandle that takes in PrimaryKey Classname, Home name, Home Classname and SmartKey.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
          Checks to see if two PersistableHandles are equal.
 javax.ejb.EJBObject getEJBObject()
          Returns the EJBObject.
 javax.ejb.Handle getHandle()
          Returns the EJB Handle.
 java.lang.String getHomeClassName()
           
 java.lang.String getJndiHomeName()
           
 java.lang.String getKeyClassName()
           
 SmartKey getSmartKey()
          Returns the SmartKey If the PersistableHandle is empty, it returns a com.beasys.commerce.foundation.EmptySmartKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistableHandle

public PersistableHandle()

PersistableHandle

public PersistableHandle(ConfigurableEntity entity)
                  throws ApplicationException,
                         java.rmi.RemoteException
Constructor for PersistableHandle that takes in an Entity bean. Note for this release: the BeanHomeName must equal to the name of the RemoteInterfaceClassName.

PersistableHandle

public PersistableHandle(java.lang.String keyClassName,
                         java.lang.String homeName,
                         java.lang.String homeClassName,
                         SmartKey smartKey)
Constructor for PersistableHandle that takes in PrimaryKey Classname, Home name, Home Classname and SmartKey. Note for this release: the BeanHomeName must equal to the name of the RemoteInterfaceClassName.
Method Detail

getKeyClassName

public java.lang.String getKeyClassName()

getHomeClassName

public java.lang.String getHomeClassName()

getJndiHomeName

public java.lang.String getJndiHomeName()

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object o)
Checks to see if two PersistableHandles are equal.
Overrides:
equals in class java.lang.Object

getEJBObject

public javax.ejb.EJBObject getEJBObject()
                                 throws java.rmi.RemoteException
Returns the EJBObject. If the PersistableHandle is empty, it returns null.

getHandle

public javax.ejb.Handle getHandle()
                           throws java.rmi.RemoteException
Returns the EJB Handle. If the PersistableHandle is empty, it returns null.

getSmartKey

public SmartKey getSmartKey()
Returns the SmartKey If the PersistableHandle is empty, it returns a com.beasys.commerce.foundation.EmptySmartKey

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved