當前位置: 首頁>>代碼示例>>Java>>正文


Java TransactionAttributeType.NEVER屬性代碼示例

本文整理匯總了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));
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:8,代碼來源:TransactionInvocationHandlersTest.java

示例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());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:13,代碼來源:DeployedSessionBeanTest.java

示例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();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:12,代碼來源:DeployedSessionBeanTest.java

示例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();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:12,代碼來源:DeployedSessionBeanTest.java

示例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();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:12,代碼來源:DeployedSessionBeanTest.java

示例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);
}
 
開發者ID:wfink,項目名稱:jboss-eap7.1-playground,代碼行數:13,代碼來源:DelegateROCBean.java

示例7: getTrue

@TransactionAttribute(TransactionAttributeType.NEVER)
public boolean getTrue(){
    return true;
}
 
開發者ID:arcuri82,項目名稱:testing_security_development_enterprise_systems,代碼行數:4,代碼來源:EJB_09_NEVER.java


注:本文中的javax.ejb.TransactionAttributeType.NEVER屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。