FileDocCategorySizeDatePackage
MessageBeanContextImpl.javaAPI DocGlassfish v2 API5710Fri May 04 22:32:58 BST 2007com.sun.ejb.containers

MessageBeanContextImpl

public final class MessageBeanContextImpl extends EJBContextImpl implements MessageDrivenContext
Implementation of EJBContext for message-driven beans
author
Kenneth Saks

Fields Summary
private static final Logger
_logger
private boolean
afterSetContext
Constructors Summary
MessageBeanContextImpl(Object ejb, BaseContainer container)


       
    
        super(ejb, container);
    
Methods Summary
protected voidcheckAccessToCallerSecurity()

        // A message-driven ejb's state transitions past UNINITIALIZED
        // AFTER ejbCreate
        if ( isUnitialized() || isInEjbRemove() ) {
            throw new java.lang.IllegalStateException("Operation not allowed");
        }

    
public voidcheckTimerServiceMethodAccess()


        // A message-driven ejb's state transitions past UNINITIALIZED
        // AFTER ejbCreate
        if ( isUnitialized() || isInEjbRemove() ) {
            throw new java.lang.IllegalStateException
                ("EJB Timer Service method calls cannot be called in " +
                 " this context");
        } 
    
public EJBHomegetEJBHome()

        RuntimeException exception = new java.lang.IllegalStateException
            ("getEJBHome not allowed for message-driven beans");
        throw exception;
    
EJBObjectImplgetEJBObjectImpl()

	throw new RuntimeException("No EJB Object for Message-driven beans");
    
public TimerServicegetTimerService()


        if( !afterSetContext ) {
            throw new java.lang.IllegalStateException("Operation not allowed");
        }

        ContainerFactoryImpl cf = (ContainerFactoryImpl)
            Switch.getSwitch().getContainerFactory();
        EJBTimerService timerService = cf.getEJBTimerService();
        if( timerService == null ) {
            throw new EJBException("EJB Timer service not available");
        }
        return new EJBTimerServiceWrapper(timerService, this);
    
public javax.transaction.UserTransactiongetUserTransaction()

	// The state check ensures that an exception is thrown if this
	// was called from the constructor or setMessageDrivenContext.
	// The remaining checks are performed by the container.
	if ( !this.afterSetContext ) {
	    throw new java.lang.IllegalStateException("Operation not allowed");
        }

	return ((BaseContainer)getContainer()).getUserTransaction();
    
public booleanisCallerInRole(java.lang.String roleRef)

        throw new java.lang.IllegalStateException("isCallerInRole() is not defined for message-driven ejbs");
    
public voidsetContextCalled()

        this.afterSetContext = true;
    
voidsetEJBObjectImpl(EJBObjectImpl ejbo)

	throw new RuntimeException("No EJB Object for Message-driven beans");
    
voidsetEJBStub(EJBObject ejbStub)

	throw new RuntimeException("No stubs for Message-driven beans");