本文整理匯總了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;
}