com.caucho.ejb.protocol
Class HandleImpl

java.lang.Object
  extended by com.caucho.ejb.protocol.AbstractHandle
      extended by com.caucho.ejb.protocol.HandleImpl
All Implemented Interfaces:
java.io.Serializable, Handle

public class HandleImpl
extends AbstractHandle

Handle implementation for EJB Objects.

 String url = "http://localhost:8080/ejb/houses?ejbid=Gryffindor";
 HandleImpl handle = new HandleImpl(url);

 test.RemoteBean bean = (test.RemoteBean) handle.getEJBObject();
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.ejb.protocol.AbstractHandle
log
 
Constructor Summary
HandleImpl()
          Null constructor for serialization.
HandleImpl(java.lang.String serverId, java.lang.String objectId)
          Create a new HandleImpl
 
Method Summary
 boolean equals(java.lang.Object b)
          Returns true if the test handle refers to the same object.
 EJBObject getEJBObject()
           
 java.lang.String getObjectId()
          Returns the URL suffix used as a primary key.
 java.lang.String getServerId()
          Return the URL prefix for the bean's home.
 java.lang.String getURL(java.lang.String protocol)
          Returns the URL for a particular protocol.
 int hashCode()
          The handle's hashcode is the same as the url's hashcode
 java.lang.String toString()
          The printed representation of the handle is the url.
 
Methods inherited from class com.caucho.ejb.protocol.AbstractHandle
getType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HandleImpl

public HandleImpl()
Null constructor for serialization.


HandleImpl

public HandleImpl(java.lang.String serverId,
                  java.lang.String objectId)
Create a new HandleImpl

Parameters:
serverId - the object's server
objectKey - the object id
Method Detail

getServerId

public java.lang.String getServerId()
Return the URL prefix for the bean's home.


getObjectId

public java.lang.String getObjectId()
Returns the URL suffix used as a primary key.

Specified by:
getObjectId in class AbstractHandle

getURL

public java.lang.String getURL(java.lang.String protocol)
Description copied from class: AbstractHandle
Returns the URL for a particular protocol.

Specified by:
getURL in class AbstractHandle

getEJBObject

public EJBObject getEJBObject()
                       throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

equals

public boolean equals(java.lang.Object b)
Returns true if the test handle refers to the same object. In this implementation, the handles are identical iff the urls are identical.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
The handle's hashcode is the same as the url's hashcode

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
The printed representation of the handle is the url.

Overrides:
toString in class java.lang.Object