本文整理汇总了Java中javax.ejb.TransactionAttributeType.NEVER属性的典型用法代码示例。如果您正苦于以下问题:Java TransactionAttributeType.NEVER属性的具体用法?Java TransactionAttributeType.NEVER怎么用?Java TransactionAttributeType.NEVER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.ejb.TransactionAttributeType
的用法示例。
在下文中一共展示了TransactionAttributeType.NEVER属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetHandlerForBeanClass1
@Test
public void testGetHandlerForBeanClass1() {
@TransactionAttribute(TransactionAttributeType.NEVER)
class Bean {
}
assertSame(TransactionInvocationHandlers.TX_NEVER,
TransactionInvocationHandlers.getHandlerFor(Bean.class));
}
示例2: testCall
@Test
public void testCall() throws Exception {
final Object value = new Object();
@TransactionAttribute(TransactionAttributeType.NEVER)
class Bean implements Callable<Object> {
public Object call() {
return value;
}
}
DeployedSessionBean bean = new DeployedSessionBean(tmStub,
sessionContext, new Bean());
assertSame(value, bean.getInterfaceOrClass(Callable.class).call());
}
示例3: testCallWithSystemException
@Test(expected = EJBException.class)
public void testCallWithSystemException() {
@TransactionAttribute(TransactionAttributeType.NEVER)
class Bean implements Runnable {
public void run() {
throw new RuntimeException();
}
}
DeployedSessionBean bean = new DeployedSessionBean(tmStub,
sessionContext, new Bean());
bean.getInterfaceOrClass(Runnable.class).run();
}
示例4: testCallWithApplicationException1
@Test(expected = AppException.class)
public void testCallWithApplicationException1() {
@TransactionAttribute(TransactionAttributeType.NEVER)
class Bean implements Runnable {
public void run() {
throw new AppException();
}
}
DeployedSessionBean bean = new DeployedSessionBean(tmStub,
sessionContext, new Bean());
bean.getInterfaceOrClass(Runnable.class).run();
}
示例5: testCallWithApplicationException2
@Test(expected = IOException.class)
public void testCallWithApplicationException2() throws Exception {
@TransactionAttribute(TransactionAttributeType.NEVER)
class Bean implements Callable<Void> {
public Void call() throws Exception {
throw new IOException();
}
}
DeployedSessionBean bean = new DeployedSessionBean(tmStub,
sessionContext, new Bean());
bean.getInterfaceOrClass(Callable.class).call();
}
示例6: checkMultipleInvocations
@TransactionAttribute(TransactionAttributeType.NEVER)
@PermitAll
@Override
public void checkMultipleInvocations() throws NamingException {
HashSet<String> servers = new HashSet<String>();
for(int i = 0 ; i <10 ; i++) {
final String server = proxy.getJBossServerName();
log.fine("Invocation routed to server " + server);
servers.add(server);
}
log.info("Invocations routed to the following servers : " + servers);
}
示例7: getTrue
@TransactionAttribute(TransactionAttributeType.NEVER)
public boolean getTrue(){
return true;
}