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