public synchronized void start(StartContext context) throws StartException { userTransactionRegistry = new UserTransactionRegistry(); }
/** * Fire the user transaction started event */ void userTransactionStarted() { assert registry != null : "registry is null"; registry.userTransactionStarted(); } }
/** * Add a listener * @param listener The listener */ public void addListener(UserTransactionListener listener) { UserTransactionListenerImpl impl = new UserTransactionListenerImpl(listener); delegator.addListener(impl); listeners.put(listener, impl); }
/** * Remove a listener * @param listener The listener */ public void removeListener(UserTransactionListener listener) { UserTransactionListenerImpl impl = listeners.get(listener); if (impl != null) { delegator.removeListener(impl); listeners.remove(listener); } }
/** * Remove a provider * @param provider The provider */ public void removeProvider(UserTransactionProvider provider) { UserTransactionProviderImpl impl = providers.get(provider); if (impl != null) { delegator.removeProvider(impl); providers.remove(provider); } }
/** * Add a provider * @param provider The provider */ public void addProvider(UserTransactionProvider provider) { UserTransactionProviderImpl impl = new UserTransactionProviderImpl(provider); delegator.addProvider(impl); providers.put(provider, impl); }
/** * Fire the user transaction started event */ void userTransactionStarted() { UserTransactionRegistry registry = this.registry; if (registry != null) registry.userTransactionStarted(); } }
@Override public void start(StartContext context) throws StartException { jpaUserTransactionListener = new JPAUserTransactionListener(); userTransactionRegistryInjectedValue.getValue().addListener(jpaUserTransactionListener); }
@Override public void stop(StopContext context) { userTransactionRegistryInjectedValue.getValue().removeListener(jpaUserTransactionListener); jpaUserTransactionListener = null; }
/** * Fire a user transaction started event */ public void userTransactionStarted() { delegator.userTransactionStarted(); } }
@Override public void start(StartContext context) throws StartException { jpaUserTransactionListener = new JPAUserTransactionListener(); userTransactionRegistryInjectedValue.getValue().addListener(jpaUserTransactionListener); }
@Override public void stop(StopContext context) { userTransactionRegistryInjectedValue.getValue().removeListener(jpaUserTransactionListener); jpaUserTransactionListener = null; }
public synchronized void start(StartContext context) throws StartException { userTransactionRegistry = new UserTransactionRegistry(); }
public void begin() throws NotSupportedException, SystemException { tm.begin(); UserTransactionRegistry registry = this.registry; if (registry != null) registry.userTransactionStarted(); try { for (UserTransactionStartedListener listener : listeners) listener.userTransactionStarted(); } catch (SystemException e) { rollback(); } }
public synchronized void start(StartContext context) throws StartException { userTransactionRegistry = new UserTransactionRegistry(); }
public void begin() throws NotSupportedException, SystemException { testAvailability(); tm.begin(); UserTransactionRegistry registry = this.registry; if (registry != null) registry.userTransactionStarted(); try { for (UserTransactionStartedListener listener : listeners) listener.userTransactionStarted(); } catch (SystemException e) { rollback(); } }