org.objectweb.jonas_ejb.container
Class JMessageEndpoint

java.lang.Object
  extended byorg.objectweb.jonas_ejb.container.JMessageEndpoint
All Implemented Interfaces:
javax.ejb.EJBContext, javax.ejb.MessageDrivenContext

public class JMessageEndpoint
extends java.lang.Object
implements javax.ejb.MessageDrivenContext

Generic interposed class for Message Endpoints This class presents these interfaces, depending on object reached: MessageDrivenContext interface to the bean instance

Author:
Philippe Coq, Philippe Durieux, Christophe Ney (Easier Enhydra integration)

Field Summary
protected  JMdbEndpointFactory bf
           
protected  javax.ejb.MessageDrivenBean mdb
           
protected  javax.resource.spi.endpoint.MessageEndpoint mep
           
protected  boolean released
           
protected  org.objectweb.transaction.jta.TransactionManager tm
           
protected  int txattr
           
protected  javax.transaction.xa.XAResource xar
           
 
Constructor Summary
JMessageEndpoint(JMdbEndpointFactory bf, javax.ejb.MessageDrivenBean mdb)
          constructor
 
Method Summary
 void deliverTimeout(javax.ejb.Timer timer)
          Deliver a timeout to the bean
 java.security.Identity getCallerIdentity()
          Deprecated. @exception java.lang.IllegalStateException always
 java.security.Principal getCallerPrincipal()
           
 javax.ejb.EJBHome getEJBHome()
          Is disallowed.
 javax.ejb.EJBLocalHome getEJBLocalHome()
          Is disallowed.
 java.util.Properties getEnvironment()
          Deprecated. Use the JNDI naming context java:comp/env instead.
 boolean getReleasedState()
           
 boolean getRollbackOnly()
          Tests if the transaction has been marked for rollback only.
 javax.ejb.TimerService getTimerService()
          Get access to the EJB Timer Service.
 javax.transaction.UserTransaction getUserTransaction()
          Obtains the transaction demarcation interface.
 javax.transaction.xa.XAResource getXAResource()
           
 boolean isCallerInRole(java.security.Identity role)
          Deprecated. @throws java.lang.IllegalStateException for message driven bean because there is no security context available
 boolean isCallerInRole(java.lang.String roleLink)
          Test if the caller has a given role.
 void setProxy(javax.resource.spi.endpoint.MessageEndpoint mep)
           
 void setReleasedState(boolean state)
           
 void setRollbackOnly()
          Marks the current transaction for rollback.
 void setXAResource(javax.transaction.xa.XAResource xa)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bf

protected JMdbEndpointFactory bf

mdb

protected javax.ejb.MessageDrivenBean mdb

mep

protected javax.resource.spi.endpoint.MessageEndpoint mep

txattr

protected int txattr

tm

protected org.objectweb.transaction.jta.TransactionManager tm

xar

protected javax.transaction.xa.XAResource xar

released

protected boolean released
Constructor Detail

JMessageEndpoint

public JMessageEndpoint(JMdbEndpointFactory bf,
                        javax.ejb.MessageDrivenBean mdb)
constructor

Parameters:
bf - The MDB Endpoint Factory
mdb - The Message Driven Bean
Method Detail

setProxy

public void setProxy(javax.resource.spi.endpoint.MessageEndpoint mep)

getXAResource

public javax.transaction.xa.XAResource getXAResource()

setXAResource

public void setXAResource(javax.transaction.xa.XAResource xa)

getReleasedState

public boolean getReleasedState()

setReleasedState

public void setReleasedState(boolean state)

getTimerService

public javax.ejb.TimerService getTimerService()
                                       throws java.lang.IllegalStateException
Get access to the EJB Timer Service.

Specified by:
getTimerService in interface javax.ejb.EJBContext
Returns:
the EJB Timer Service
Throws:
java.lang.IllegalStateException - Thrown if the instance is not allowed to use this method

getCallerIdentity

public java.security.Identity getCallerIdentity()
Deprecated. @exception java.lang.IllegalStateException always

Obtains the java.security.Identity of the caller. disallowed in messagedriven bean method because there is no security context

Specified by:
getCallerIdentity in interface javax.ejb.EJBContext

getCallerPrincipal

public java.security.Principal getCallerPrincipal()
Specified by:
getCallerPrincipal in interface javax.ejb.EJBContext
Returns:
the java.security.Principal that identifies the caller.
Throws:
java.lang.IllegalStateException - if there is no principal

isCallerInRole

public boolean isCallerInRole(java.security.Identity role)
Deprecated. @throws java.lang.IllegalStateException for message driven bean because there is no security context available

Test if the caller has a given role.

Specified by:
isCallerInRole in interface javax.ejb.EJBContext

isCallerInRole

public boolean isCallerInRole(java.lang.String roleLink)
Test if the caller has a given role.

Specified by:
isCallerInRole in interface javax.ejb.EJBContext
Throws:
java.lang.IllegalStateException - for message driven bean because there is no security context available

setRollbackOnly

public void setRollbackOnly()
Marks the current transaction for rollback. Should be used only if the instance is associated with a transaction

Specified by:
setRollbackOnly in interface javax.ejb.EJBContext
Throws:
java.lang.IllegalStateException - if the instance is not associated with a transaction

getRollbackOnly

public boolean getRollbackOnly()
Tests if the transaction has been marked for rollback only.

Specified by:
getRollbackOnly in interface javax.ejb.EJBContext
Returns:
True if transaction has been marked for rollback.

getEJBHome

public javax.ejb.EJBHome getEJBHome()
Is disallowed. There is no home for message driven bean.

Specified by:
getEJBHome in interface javax.ejb.EJBContext
Throws:
java.lang.IllegalStateException - Always.

getEJBLocalHome

public javax.ejb.EJBLocalHome getEJBLocalHome()
Is disallowed. There is no local home for message driven bean.

Specified by:
getEJBLocalHome in interface javax.ejb.EJBContext
Throws:
java.lang.IllegalStateException - Always.

getEnvironment

public java.util.Properties getEnvironment()
Deprecated. Use the JNDI naming context java:comp/env instead.

Specified by:
getEnvironment in interface javax.ejb.EJBContext
Returns:
properties for the bean.

getUserTransaction

public javax.transaction.UserTransaction getUserTransaction()
                                                     throws java.lang.IllegalStateException
Obtains the transaction demarcation interface.

Specified by:
getUserTransaction in interface javax.ejb.EJBContext
Returns:
The UserTransaction interface that the enterprise bean instance can use for transaction demarcation.
Throws:
IllegalStateException: - Thrown if the instance container does not make the UserTransaction interface available to the instance.
java.lang.IllegalStateException

deliverTimeout

public void deliverTimeout(javax.ejb.Timer timer)
Deliver a timeout to the bean

Parameters:
timer - timer whose expiration caused this notification.