@Test public void suspendsRequired() throws Exception { PolicyUtil.require(exchange, TransactionPolicy.SUSPENDS_TRANSACTION); exchange.setPhase(ExchangePhase.IN); tm.begin(); Transaction tx1 = tm.getTransaction(); handler.handleMessage(exchange); Assert.assertNull(tm.getTransaction()); Assert.assertTrue(PolicyUtil.isProvided(exchange, TransactionPolicy.SUSPENDS_TRANSACTION)); exchange.setPhase(ExchangePhase.OUT); handler.handleMessage(exchange); Transaction tx2 = tm.getTransaction(); Assert.assertEquals(tx1, tx2); Assert.assertEquals(Status.STATUS_ACTIVE, tx2.getStatus()); }
private boolean suspendsRequired(Exchange exchange) { return PolicyUtil.isRequired(exchange, TransactionPolicy.SUSPENDS_TRANSACTION); }
TransactionHandler implements ExchangeHandler { private boolean suspendsRequired(Exchange exchange) { return PolicyUtil.isRequired(exchange, TransactionPolicy.SUSPENDS_TRANSACTION); } }
TransactionHandler implements ExchangeHandler { private boolean suspendsRequired(Exchange exchange) { return PolicyUtil.isRequired(exchange, TransactionPolicy.SUSPENDS_TRANSACTION); } TransactionHandler(); }
TransactionHandler implements ExchangeHandler { private boolean suspendsRequired(Exchange exchange) { return PolicyUtil.isRequired(exchange, TransactionPolicy.SUSPENDS_TRANSACTION); } TransactionHandler(); @Override void handleMessage(Exchange exchange); @Override void handleFault(Exchange exchange); }
TransactionHandler implements ExchangeHandler { private boolean suspendsRequired(Exchange exchange) { return PolicyUtil.isRequired(exchange, TransactionPolicy.SUSPENDS_TRANSACTION); } TransactionHandler(); @Override void handleMessage(Exchange exchange); @Override void handleFault(Exchange exchange);  }