Java 类javax.ejb.MessageDrivenContext 实例源码

项目:tomee    文件:ContextLookupMdbBean.java   
@Override
public void lookupMessageDrivenContext() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);

            // lookup in enc
            final MessageDrivenContext sctx = (MessageDrivenContext) ctx.lookup("java:comp/env/mdbcontext");
            Assert.assertNotNull("The MessageDrivenContext got from java:comp/env/mdbcontext is null", sctx);

            // lookup using global name
            final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
            Assert.assertNotNull("The MessageDrivenContext got from java:comp/EJBContext is null ", ejbCtx);

            // verify context was set via legacy set method
            Assert.assertNotNull("The MessageDrivenContext is null from setter method", mdbContext);
        } catch (final Exception e) {
            Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }

}
项目:tomee    文件:ContextLookupMdbPojoBean.java   
public void lookupMessageDrivenContext() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);

            // lookup in enc
            final MessageDrivenContext sctx = (MessageDrivenContext) ctx.lookup("java:comp/env/mdbcontext");
            Assert.assertNotNull("The MessageDrivenContext got from java:comp/env/mdbcontext is null", sctx);

            // lookup using global name
            final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
            Assert.assertNotNull("The MessageDrivenContext got from java:comp/EJBContext is null ", ejbCtx);
        } catch (final Exception e) {
            Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }

}
项目:tomee    文件:EncMdbBean.java   
@Override
public void lookupMessageDrivenContext() throws TestFailureException {
    try {
        try {
            final InitialContext ctx = new InitialContext();
            Assert.assertNotNull("The InitialContext is null", ctx);

            // lookup in enc
            final MessageDrivenContext messageDrivenContext = (MessageDrivenContext) ctx.lookup("java:comp/env/mdbcontext");
            Assert.assertNotNull("The SessionContext got from java:comp/env/mdbcontext is null", messageDrivenContext);

            // lookup using global name
            final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
            Assert.assertNotNull("The SessionContext got from java:comp/EJBContext is null ", ejbCtx);

            // verify context was set via legacy set method
            Assert.assertNotNull("The MdbContext is null from setter method", mdbContext);
        } catch (final Exception e) {
            Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    } catch (final AssertionFailedError afe) {
        throw new TestFailureException(afe);
    }

}
项目:study-ocbcd    文件:DepositProcessBean.java   
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
    this.ctx = ctx;
    try {
        Context initialCtx = new InitialContext();
        homeCtx = (Context) initialCtx.lookup("java:comp/env");
    } catch(NamingException e) {
        e.printStackTrace();
        throw new EJBException(e);
    }
}
项目:tomee    文件:ContextLookupMdbBean.java   
@Override
public void setMessageDrivenContext(final MessageDrivenContext ctx) throws EJBException {
    this.mdbContext = ctx;
    try {
        final ConnectionFactory connectionFactory = (ConnectionFactory) new InitialContext().lookup("java:comp/env/jms");
        mdbInvoker = new MdbInvoker(connectionFactory, this);
    } catch (final Exception e) {
        throw new EJBException(e);
    }
}
项目:tomee    文件:BasicMdbBean.java   
@Override
public void setMessageDrivenContext(final MessageDrivenContext ctx) throws EJBException {
    this.mdbContext = ctx;
    testAllowedOperations("setMessageDrivenContext");
    try {
        final ConnectionFactory connectionFactory = (ConnectionFactory) new InitialContext().lookup("java:comp/env/jms");
        mdbInvoker = new MdbInvoker(connectionFactory, this);
    } catch (final Exception e) {
        throw new EJBException(e);
    }
}
项目:tomee    文件:InterceptorMdbBean.java   
@Override
public void setMessageDrivenContext(final MessageDrivenContext ctx) throws EJBException {
    this.mdbContext = ctx;
    try {
        mdbInvoker = new MdbInvoker(connectionFactory, this);
    } catch (final Exception e) {
        throw new EJBException(e);
    }
}
项目:tomee    文件:SetterInjectionMdbBean.java   
@Override
public void setMessageDrivenContext(final MessageDrivenContext ctx) throws EJBException {
    this.mdbContext = ctx;
    try {
        final ConnectionFactory connectionFactory = (ConnectionFactory) new InitialContext().lookup("java:comp/env/jms");
        mdbInvoker = new MdbInvoker(connectionFactory, this);
    } catch (final Exception e) {
        throw new EJBException(e);
    }
}
项目:tomee    文件:FieldInjectionMdbBean.java   
@Override
public void setMessageDrivenContext(final MessageDrivenContext ctx) throws EJBException {
    this.mdbContext = ctx;
    try {
        final ConnectionFactory connectionFactory = (ConnectionFactory) new InitialContext().lookup("java:comp/env/jms");
        mdbInvoker = new MdbInvoker(connectionFactory, this);
    } catch (final Exception e) {
        throw new EJBException(e);
    }
}
项目:tomee    文件:EncMdbBean.java   
@Override
public void setMessageDrivenContext(final MessageDrivenContext ctx) throws EJBException {
    this.mdbContext = ctx;
    try {
        final ConnectionFactory connectionFactory = (ConnectionFactory) new InitialContext().lookup("java:comp/env/jms");
        mdbInvoker = new MdbInvoker(connectionFactory, this);
    } catch (final Exception e) {
        throw new EJBException(e);
    }
}
项目:tomee    文件:MergeWebappJndiContext.java   
private <R extends JndiReference> boolean isPrivateReference(final R a) {
    if (!isResourceRef(a)) {
        return false;
    }

    final Class[] types = {EJBContext.class, EntityContext.class, SessionContext.class, MessageDrivenContext.class, UserTransaction.class};

    for (final Class type : types) {
        if (type.getName().equals(a.getType())) {
            return true;
        }
    }

    return false;
}
项目:Mastering-Java-EE-Development-with-WildFly    文件:OldSpecsWorkingBean.java   
@Override
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
    this.ctx = ctx;
    received = true;
}
项目:sistra    文件:AvisadorInmediatoFacadeEJB.java   
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
    this.messageDrivenContext = ctx;
}
项目:esper    文件:TerminalMDB.java   
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) throws EJBException {
    // System.out.println(TerminalMDB.class.getName() + "::setMessageDrivenContext invoked");
}
项目:omr    文件:ValidadorJMSListener.java   
@Override
public void setMessageDrivenContext(MessageDrivenContext arg0)
    throws EJBException {
    this.context = arg0;
}
项目:omr    文件:PersistenceJMSListener.java   
@Override
public void setMessageDrivenContext(MessageDrivenContext arg0)
    throws EJBException {
    this.context = arg0;
}
项目:gomall.la    文件:BaseMDB.java   
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) {
    super.setMessageDrivenContext(messageDrivenContext);
    setBeanFactoryLocator(ContextSingletonBeanFactoryLocator.getInstance("classpath*:beanRefContext.xml"));
    setBeanFactoryLocatorKey("applicationContext-main");
}
项目:messaging-samples    文件:BaseProcessingConsumer.java   
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
    mdbContext = ctx;
}
项目:mq-wlm-client    文件:WLMMDB.java   
public void setMessageDrivenContext(MessageDrivenContext ctx)
    throws EJBException {
  this.mdbCtx = ctx;
}
项目:mq-wlm-client    文件:WLMMDB.java   
/**
 * @return the MDB context
 */
protected MessageDrivenContext getMessageDrivenCtx() {
  return mdbCtx;
}
项目:mq-wlm-client    文件:WLMMDB1.java   
@Override
protected MessageDrivenContext getMessageDrivenCtx() {
  return mdbCtx;
}
项目:mq-wlm-client    文件:WLMMDB2.java   
@Override
protected MessageDrivenContext getMessageDrivenCtx() {
  return mdbCtx;
}
项目:study-ocbcd    文件:EjbMessageDrivenBean.java   
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
    System.out.println("setMessageDrivenContext");
}
项目:iaf    文件:CustomIfsaReceiverMDBAbstractBase.java   
public MessageDrivenContext getMessageDrivenContext() {
    return ejbContext;
}
项目:iaf    文件:CustomIfsaReceiverMDBAbstractBase.java   
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
    ejbContext = ctx;
}
项目:iaf    文件:GenericMDB.java   
public void setMessageDrivenContext(MessageDrivenContext ejbContext) throws EJBException {
    log.info("Received EJB-MDB Context");
    this.ejbContext = ejbContext;
}
项目:tomee    文件:SetterInjectionMdbBean.java   
public MessageDrivenContext getEjbContext() {
    return ejbContextField;
}
项目:tomee    文件:SetterInjectionMdbBean.java   
public void setEjbContext(final MessageDrivenContext ejbContext) {
    this.ejbContextField = ejbContext;
}
项目:tomee    文件:CustomMdbContainerTest.java   
@Resource
public void setMessageDrivenContext(final MessageDrivenContext messageDrivenContext) {
    lifecycle.push(Lifecycle.INJECTION);
}
项目:tomee    文件:QuartzMdbContainerTest.java   
@Resource
public void setMessageDrivenContext(final MessageDrivenContext messageDrivenContext) {
    lifecycle.push(Lifecycle.INJECTION);
}
项目:tomee    文件:JmsMdbContainerTest.java   
@Resource
public void setMessageDrivenContext(final MessageDrivenContext messageDrivenContext) {
    lifecycle.push(Lifecycle.INJECTION);
}
项目:tomee    文件:NoMessageDeliveryTest.java   
@Resource
public void setMessageDrivenContext(final MessageDrivenContext messageDrivenContext) {
    lifecycle.push(Lifecycle.INJECTION);
}
项目:jaffa-framework    文件:JaffaMessageBean.java   
/**
 * Standard EBJ method.
 * 
 * @param aContext
 *          the EJB context.
 */
public void setMessageDrivenContext(final MessageDrivenContext ctx) {
}
项目:hermes    文件:AbstractMessageDrivenBean.java   
/** 
 * Sets the associated message-driven context. The container calls this method after the instance creation.
 * @param mdc A MessageDrivenContext interface for the instance.
 */ 
public void setMessageDrivenContext(MessageDrivenContext mdc) {
    this.mdc = mdc;
}
项目:class-guard    文件:AbstractMessageDrivenBean.java   
/**
 * Required lifecycle method. Sets the MessageDriven context.
 * @param messageDrivenContext MessageDrivenContext
 */
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) {
    this.messageDrivenContext = messageDrivenContext;
}
项目:class-guard    文件:AbstractMessageDrivenBean.java   
/**
 * Convenience method for subclasses to use.
 * @return the MessageDrivenContext passed to this EJB by the EJB container
 */
protected final MessageDrivenContext getMessageDrivenContext() {
    return this.messageDrivenContext;
}
项目:mq-wlm-client    文件:WLMMDBBase.java   
/**
 * An example of how to have access to the MessageDrivenContext
 * @return The implementation returns the MessageDrivenContext via standard EJB semantics
 */
protected abstract MessageDrivenContext getMessageDrivenCtx();
项目:MOCHA    文件:AbstractPepsMessageDrivenBean.java   
/**
 * Start Spring ApplicationContext
 * 
 * @param messageDrivenContext Set the MBD context
 * 
 * @see org.springframework.ejb.support.AbstractMessageDrivenBean#setMessageDrivenContext(javax.ejb.MessageDrivenContext)
 */
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) {
    super.setMessageDrivenContext(messageDrivenContext);
    setBeanFactoryLocator(ContextSingletonBeanFactoryLocator.getInstance());
    setBeanFactoryLocatorKey("businessBeanFactory");
}