本文整理汇总了Java中javax.ejb.MessageDrivenContext类的典型用法代码示例。如果您正苦于以下问题:Java MessageDrivenContext类的具体用法?Java MessageDrivenContext怎么用?Java MessageDrivenContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MessageDrivenContext类属于javax.ejb包,在下文中一共展示了MessageDrivenContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lookupMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
@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);
}
}
示例2: lookupMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
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);
}
}
示例3: lookupMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
@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);
}
}
示例4: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
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);
}
}
示例5: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
@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);
}
}
示例6: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
@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);
}
}
示例7: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
@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);
}
}
示例8: isPrivateReference
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
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;
}
示例9: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
@Override
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
this.ctx = ctx;
received = true;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:6,代码来源:OldSpecsWorkingBean.java
示例10: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
this.messageDrivenContext = ctx;
}
示例11: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) throws EJBException {
// System.out.println(TerminalMDB.class.getName() + "::setMessageDrivenContext invoked");
}
示例12: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
@Override
public void setMessageDrivenContext(MessageDrivenContext arg0)
throws EJBException {
this.context = arg0;
}
示例13: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) {
super.setMessageDrivenContext(messageDrivenContext);
setBeanFactoryLocator(ContextSingletonBeanFactoryLocator.getInstance("classpath*:beanRefContext.xml"));
setBeanFactoryLocatorKey("applicationContext-main");
}
示例14: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {
mdbContext = ctx;
}
示例15: setMessageDrivenContext
import javax.ejb.MessageDrivenContext; //导入依赖的package包/类
public void setMessageDrivenContext(MessageDrivenContext ctx)
throws EJBException {
this.mdbCtx = ctx;
}