JSlim  


com.gtcgroup.jslim
Class JSlimEJBHome

java.lang.Object
  extended bycom.gtcgroup.jslim.JSlimEJBHome
All Implemented Interfaces:
javax.ejb.EJBHome, IJSlimCachable, java.rmi.Remote

final class JSlimEJBHome
extends java.lang.Object
implements javax.ejb.EJBHome, IJSlimCachable

This class implements EJBHome in order to override methods throwing a RemoteException or RemoveException. If an exception is thrown, all cached objects are discarded preventing further use. The typical scenario supported is the unavailability of a previously available remote resource.

Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.

Since:
v. 1.0
Author:
MDT (MarvinToll@gtcGroup.com)

Field Summary
private  javax.ejb.EJBHome ejbHome
          The EJBHome interface must be extended by all enterprise Beans' remote home interfaces.
private  int intUrlSelected
          Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
 
Constructor Summary
JSlimEJBHome()
          Constructor.
JSlimEJBHome(javax.ejb.EJBHome ejbHome, int intUrlSelected)
          Constructor.
 
Method Summary
 javax.ejb.EJBMetaData getEJBMetaData()
          Obtain the EJBMetaData interface for the enterprise Bean.
 javax.ejb.HomeHandle getHomeHandle()
          Obtain a handle for the remote home object.
 int getUrlSelected()
          Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
 void remove(javax.ejb.Handle handle)
          Remove an EJB object identified by its handle.
 void remove(java.lang.Object primaryKey)
          Remove an EJB object identified by its primary key.
private static void rethrowRemoteException(java.rmi.RemoteException e)
           
private static void rethrowRemoveException(javax.ejb.RemoveException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ejbHome

private final javax.ejb.EJBHome ejbHome
The EJBHome interface must be extended by all enterprise Beans' remote home interfaces.


intUrlSelected

private final int intUrlSelected
Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

Constructor Detail

JSlimEJBHome

public JSlimEJBHome()
Constructor.


JSlimEJBHome

public JSlimEJBHome(javax.ejb.EJBHome ejbHome,
                    int intUrlSelected)
Constructor.

Parameters:
ejbHome - The EJBHome interface must be extended by all enterprise Beans' remote home interfaces.
intUrlSelected - Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
Method Detail

getUrlSelected

public final int getUrlSelected()
Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

Specified by:
getUrlSelected in interface IJSlimCachable
Returns:
Which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

remove

public final void remove(java.lang.Object primaryKey)
                  throws java.rmi.RemoteException,
                         javax.ejb.RemoveException
Remove an EJB object identified by its primary key.

This method can be used only for an entity bean. An attempt to call this method on a session bean will result in a RemoteException.

Specified by:
remove in interface javax.ejb.EJBHome
Throws:
javax.ejb.RemoveException - Thrown if the enterprise Bean or the container does not allow the client to remove the object.
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.

getEJBMetaData

public final javax.ejb.EJBMetaData getEJBMetaData()
                                           throws java.rmi.RemoteException
Obtain the EJBMetaData interface for the enterprise Bean. The EJBMetaData interface allows the client to obtain information about the enterprise Bean.

The information obtainable via the EJBMetaData interface is intended to be used by tools.

Specified by:
getEJBMetaData in interface javax.ejb.EJBHome
Returns:
The enterprise Bean's EJBMetaData interface.
Throws:
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.

remove

public final void remove(javax.ejb.Handle handle)
                  throws java.rmi.RemoteException,
                         javax.ejb.RemoveException
Remove an EJB object identified by its handle.

Specified by:
remove in interface javax.ejb.EJBHome
Throws:
javax.ejb.RemoveException - Thrown if the enterprise Bean or the container does not allow the client to remove the object.
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.

getHomeHandle

public final javax.ejb.HomeHandle getHomeHandle()
                                         throws java.rmi.RemoteException
Obtain a handle for the remote home object. The handle can be used at later time to re-obtain a reference to the remote home object, possibly in a different Java Virtual Machine.

Specified by:
getHomeHandle in interface javax.ejb.EJBHome
Returns:
A handle for the remote home object.
Throws:
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.

rethrowRemoteException

private static void rethrowRemoteException(java.rmi.RemoteException e)
                                    throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

rethrowRemoveException

private static void rethrowRemoveException(javax.ejb.RemoveException e)
                                    throws javax.ejb.RemoveException
Throws:
javax.ejb.RemoveException

JSlim  


Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.