@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); } }
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); } }
@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); } }
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); } }
@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); } }
@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); } }
@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); } }
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; }
@Override public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException { this.ctx = ctx; received = true; }
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException { this.messageDrivenContext = ctx; }
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) throws EJBException { // System.out.println(TerminalMDB.class.getName() + "::setMessageDrivenContext invoked"); }
@Override public void setMessageDrivenContext(MessageDrivenContext arg0) throws EJBException { this.context = arg0; }
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) { super.setMessageDrivenContext(messageDrivenContext); setBeanFactoryLocator(ContextSingletonBeanFactoryLocator.getInstance("classpath*:beanRefContext.xml")); setBeanFactoryLocatorKey("applicationContext-main"); }
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException { mdbContext = ctx; }
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException { this.mdbCtx = ctx; }
/** * @return the MDB context */ protected MessageDrivenContext getMessageDrivenCtx() { return mdbCtx; }
@Override protected MessageDrivenContext getMessageDrivenCtx() { return mdbCtx; }
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException { System.out.println("setMessageDrivenContext"); }
public MessageDrivenContext getMessageDrivenContext() { return ejbContext; }
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException { ejbContext = ctx; }
public void setMessageDrivenContext(MessageDrivenContext ejbContext) throws EJBException { log.info("Received EJB-MDB Context"); this.ejbContext = ejbContext; }
public MessageDrivenContext getEjbContext() { return ejbContextField; }
public void setEjbContext(final MessageDrivenContext ejbContext) { this.ejbContextField = ejbContext; }
@Resource public void setMessageDrivenContext(final MessageDrivenContext messageDrivenContext) { lifecycle.push(Lifecycle.INJECTION); }
/** * Standard EBJ method. * * @param aContext * the EJB context. */ public void setMessageDrivenContext(final MessageDrivenContext ctx) { }
/** * 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; }
/** * Required lifecycle method. Sets the MessageDriven context. * @param messageDrivenContext MessageDrivenContext */ public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) { this.messageDrivenContext = messageDrivenContext; }
/** * Convenience method for subclasses to use. * @return the MessageDrivenContext passed to this EJB by the EJB container */ protected final MessageDrivenContext getMessageDrivenContext() { return this.messageDrivenContext; }
/** * An example of how to have access to the MessageDrivenContext * @return The implementation returns the MessageDrivenContext via standard EJB semantics */ protected abstract MessageDrivenContext getMessageDrivenCtx();
/** * 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"); }