BEA Systems, Inc.

theory.smart.foundation
Class SmartHandle

java.lang.Object
  |
  +--theory.smart.foundation.SmartHandle

public class SmartHandle
extends java.lang.Object
implements com.sun.java.util.collections.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
SmartHandle()
           
SmartHandle(Entity entity)
          Constructor for SmartHandle that takes in an Entity bean.
SmartHandle(java.lang.String keyClassName, java.lang.String homeName, java.lang.String homeClassName, SmartKey smartKey)
          Constructor for SmartHandle 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 SmartHandles are equal.
 javax.ejb.EJBObject getEJBObject()
          Returns the EJBObject.
 javax.ejb.Handle getHandle()
          Returns the EJB Handle.
 java.lang.String getHomeClassName()
           
 java.lang.String getHomeName()
           
 java.lang.String getKeyClassName()
           
 SmartKey getSmartKey()
          Returns the SmartKey If the SmartHandle is empty, it returns a theory.smart.foundation.EmptySmartKey
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartHandle

public SmartHandle()

SmartHandle

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

SmartHandle

public SmartHandle(java.lang.String keyClassName,
                   java.lang.String homeName,
                   java.lang.String homeClassName,
                   SmartKey smartKey)
Constructor for SmartHandle 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()

getHomeName

public java.lang.String getHomeName()

compareTo

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

equals

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

getEJBObject

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

getHandle

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

getSmartKey

public SmartKey getSmartKey()
Returns the SmartKey If the SmartHandle is empty, it returns a theory.smart.foundation.EmptySmartKey

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved