org.ow2.jonas.lib.ejb21
Class JHome

java.lang.Object
  extended by javax.rmi.PortableRemoteObject
      extended by org.ow2.jonas.lib.ejb21.JHome
All Implemented Interfaces:
Remote, EJBHome
Direct Known Subclasses:
JEntityHome, JSessionHome

public abstract class JHome
extends PortableRemoteObject
implements EJBHome

This class represents an EJBHome Remote Interface It is shared between Sessions and Entities.

Author:
Philippe Coq, Philippe Durieux, eyindanga (Life cycle events)

Field Summary
protected  JFactory bf
           
protected  BeanDesc dd
           
protected  JMetaData ejbMetaData
           
protected  boolean unregistered
           
 
Constructor Summary
JHome(BeanDesc dd, JFactory bf)
          Constructor for the base class of the specific generated Home object.
 
Method Summary
 void checkSecurity(EJBInvocation ejbInv)
          Check if the access to the bean is authorized.
 JFactory getBf()
           
 BeanDesc getDd()
           
 EJBMetaData getEJBMetaData()
          Obtains the EJBMetaData for the enterprise Bean.
 HomeHandle getHomeHandle()
          Obtain a handle for the home object.
 String getJndiName()
          Get the jndi name for the bean.
 void postInvoke(RequestCtx rctx)
          postInvoke is called after any request.
 RequestCtx preInvoke(int txa)
          preInvoke is called before any request.
protected  void register()
          register this bean to JNDI (rebind).
abstract  void remove(Handle handle)
          Removes an EJB object identified by its handle.
abstract  void remove(Object primaryKey)
          Removes an EJB object identified by its primary key.
protected  void unregister()
          unregister this bean in JNDI (unbind).
 
Methods inherited from class javax.rmi.PortableRemoteObject
connect, exportObject, narrow, toStub, unexportObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ejbMetaData

protected JMetaData ejbMetaData

dd

protected BeanDesc dd

bf

protected JFactory bf

unregistered

protected boolean unregistered
Constructor Detail

JHome

public JHome(BeanDesc dd,
             JFactory bf)
      throws RemoteException
Constructor for the base class of the specific generated Home object.

Parameters:
dd - The Been Deployment Descriptor
bf - The Bean Factory
Throws:
RemoteException - exception
Method Detail

getEJBMetaData

public EJBMetaData getEJBMetaData()
                           throws RemoteException
Obtains the EJBMetaData for the enterprise Bean.

Specified by:
getEJBMetaData in interface EJBHome
Returns:
The enterprise Bean's EJBMetaData
Throws:
RemoteException - exception

getHomeHandle

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

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

remove

public abstract void remove(Handle handle)
                     throws RemoteException,
                            RemoveException
Removes an EJB object identified by its handle.

Specified by:
remove in interface EJBHome
Parameters:
handle - The EJB Handle
Throws:
RemoteException - exception
RemoveException - exception

remove

public abstract void remove(Object primaryKey)
                     throws RemoteException,
                            RemoveException
Removes an EJB object identified by its primary key.

Specified by:
remove in interface EJBHome
Parameters:
primaryKey - The Primary Key
Throws:
RemoteException - exception
RemoveException - exception

register

protected void register()
                 throws NamingException
register this bean to JNDI (rebind).

Throws:
NamingException - exception

unregister

protected void unregister()
                   throws NamingException
unregister this bean in JNDI (unbind).

Throws:
NamingException - exception

getJndiName

public String getJndiName()
Get the jndi name for the bean.

Returns:
The jndi name
Throws:
RemoteException

preInvoke

public RequestCtx preInvoke(int txa)
                     throws RemoteException
preInvoke is called before any request.

Parameters:
txa - Transaction Attribute (Supports, Required, ...)
Returns:
A RequestCtx object
Throws:
RemoteException - unexpected exception in preinvoke

checkSecurity

public void checkSecurity(EJBInvocation ejbInv)
Check if the access to the bean is authorized.

Parameters:
ejbInv - object containing security signature of the method, args of method, etc

postInvoke

public void postInvoke(RequestCtx rctx)
                throws RemoteException
postInvoke is called after any request.

Parameters:
rctx - The RequestCtx that was returned at preInvoke()
Throws:
RemoteException - unexpected exception in postinvoke

getDd

public BeanDesc getDd()
Returns:
Returns the dd.

getBf

public JFactory getBf()
Returns:
the bean factory


Copyright © 2010 OW2 Consortium. All Rights Reserved.