org.objectweb.jonas_ejb.container
Class JSessionRemote

java.lang.Object
  extended by javax.rmi.PortableRemoteObject
      extended by org.objectweb.jonas_ejb.container.JRemote
          extended by org.objectweb.jonas_ejb.container.JSessionRemote
All Implemented Interfaces:
java.rmi.Remote, javax.ejb.EJBObject
Direct Known Subclasses:
JRepStatefulRemote, JRepStatelessRemote

public abstract class JSessionRemote
extends JRemote
implements java.rmi.Remote

Generic part of the EJBObject implementation

Author:
Philippe Coq, Philippe Durieux

Field Summary
protected  JSessionSwitch bs
          bs
 
Fields inherited from class org.objectweb.jonas_ejb.container.JRemote
bf
 
Constructor Summary
JSessionRemote(JSessionFactory bf)
          constructor
 
Method Summary
 void checkSecurity(EJBInvocation ejbInv)
          Check if the access to the bean is authorized
 javax.ejb.EJBHome getEJBHome()
           
 javax.ejb.Handle getHandle()
          Obtains a handle for the EJB object.
 java.lang.Object getPrimaryKey()
           
 JSessionSwitch getSessionSwitch()
           
 boolean isIdentical(javax.ejb.EJBObject obj)
          Tests if a given EJB is identical to the invoked EJB object.
 void postInvoke(RequestCtx rctx)
          postInvoke is called after any request.
 RequestCtx preInvoke(int txa)
          preInvoke is called before any request.
abstract  void remove()
          remove is implemented in the generated part.
 void setSessionSwitch(JSessionSwitch bs)
          finish initialization
 
Methods inherited from class org.objectweb.jonas_ejb.container.JRemote
exportObject, getBf, unexportObject
 
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

bs

protected JSessionSwitch bs
bs

Constructor Detail

JSessionRemote

public JSessionRemote(JSessionFactory bf)
               throws java.rmi.RemoteException
constructor

Parameters:
bf - The Session Factory
Throws:
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.
Method Detail

remove

public abstract void remove()
                     throws java.rmi.RemoteException,
                            javax.ejb.RemoveException
remove is implemented in the generated part.

Specified by:
remove in interface javax.ejb.EJBObject
Throws:
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.
javax.ejb.RemoveException - Thrown when the method failed due to remove failure.

getEJBHome

public javax.ejb.EJBHome getEJBHome()
Specified by:
getEJBHome in interface javax.ejb.EJBObject
Returns:
the enterprise Bean's home interface.

getPrimaryKey

public java.lang.Object getPrimaryKey()
                               throws java.rmi.RemoteException
Specified by:
getPrimaryKey in interface javax.ejb.EJBObject
Returns:
never carried out because a exception is thrown
Throws:
java.rmi.RemoteException - Always : Session bean has never a primary key

isIdentical

public boolean isIdentical(javax.ejb.EJBObject obj)
                    throws java.rmi.RemoteException
Tests if a given EJB is identical to the invoked EJB object. This is different whether the bean is stateless or stateful.

Specified by:
isIdentical in interface javax.ejb.EJBObject
Parameters:
obj - - An object to test for identity with the invoked object.
Returns:
True if the given EJB object is identical to the invoked object.
Throws:
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.

getHandle

public javax.ejb.Handle getHandle()
                           throws java.rmi.RemoteException
Obtains a handle for the EJB object. The handle can be used at later time to re-obtain a reference to the EJB object, possibly in a different JVM.

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

setSessionSwitch

public void setSessionSwitch(JSessionSwitch bs)
finish initialization

Parameters:
bs - the SessionSwitch

getSessionSwitch

public JSessionSwitch getSessionSwitch()
Returns:
the JSessionSwitch for this Session

preInvoke

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

Parameters:
txa - Transaction Attribute (Supports, Required, ...)
Returns:
A RequestCtx object
Throws:
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.

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 java.rmi.RemoteException
postInvoke is called after any request.

Parameters:
rctx - The RequestCtx that was returned at preInvoke()
Throws:
java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.