public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionCommitted(ce); } };
public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionCommitted(ce); } };
public void localTransactionCommitted(ConnectionEvent event) { for (Iterator i = _eventListeners.iterator();i.hasNext(); ) ((ConnectionEventListener)i.next()).localTransactionCommitted(event); }
protected void localTransactionCommit(boolean isSPI) throws ResourceException { if (!isSPI) { ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED); for (int i = listeners.size() - 1; i >= 0; i--) { ConnectionEventListener listener = listeners.get(i); listener.localTransactionCommitted(event); } } }
void notifyTxCommit(PersistenceManagerImpl handle) { ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED, null); ce.setConnectionHandle(handle); Collection localCels = null; synchronized (cels) { localCels = new ArrayList(cels); } for (Iterator i = localCels.iterator(); i.hasNext(); ) { ((ConnectionEventListener)i.next()).localTransactionCommitted(ce); } }
void setJdbcAutoCommit(final boolean jdbcAutoCommit) throws SQLException { synchronized (stateLock) { if (inManagedTransaction) throw new SQLException("You cannot set autocommit during a managed transaction!"); this.jdbcAutoCommit = jdbcAutoCommit; } if (jdbcAutoCommit && inLocalTransaction.getAndSet(false)) { ArrayList copy; synchronized (cels) { copy = new ArrayList(cels); } ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED); for (int i = 0; i < copy.size(); ++i) { ConnectionEventListener cel = (ConnectionEventListener) copy.get(i); try { cel.localTransactionCommitted(ce); } catch (Throwable t) { getLog().trace("Error notifying of connection committed for listener: " + cel, t); } } } }
break; case 3: localConnectionEventListener.localTransactionCommitted(localConnectionEvent); break; case 4:
/** * Send event. */ private void sendEvent(ConnectionEvent event) { synchronized (listeners) { for (Iterator<ConnectionEventListener> i = listeners.iterator(); i.hasNext();) { ConnectionEventListener listener = i.next(); switch (event.getId()) { case ConnectionEvent.CONNECTION_CLOSED: listener.connectionClosed(event); break; case ConnectionEvent.CONNECTION_ERROR_OCCURRED: listener.connectionErrorOccurred(event); break; case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED: listener.localTransactionCommitted(event); break; case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK: listener.localTransactionRolledback(event); break; case ConnectionEvent.LOCAL_TRANSACTION_STARTED: listener.localTransactionStarted(event); break; default: // Unknown event, skip } } } }
/** * Send event. */ private void sendEvent(ConnectionEvent event) { synchronized (listeners) { for (Iterator<ConnectionEventListener> i = listeners.iterator(); i.hasNext();) { ConnectionEventListener listener = i.next(); switch (event.getId()) { case ConnectionEvent.CONNECTION_CLOSED: listener.connectionClosed(event); break; case ConnectionEvent.CONNECTION_ERROR_OCCURRED: listener.connectionErrorOccurred(event); break; case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED: listener.localTransactionCommitted(event); break; case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK: listener.localTransactionRolledback(event); break; case ConnectionEvent.LOCAL_TRANSACTION_STARTED: listener.localTransactionStarted(event); break; default: // Unknown event, skip } } } }
protected void sendEventToListener(ConnectionEvent coEvent, ConnectionEventListener listener) { if (coEvent.getId() == ConnectionEvent.CONNECTION_CLOSED) { listener.connectionClosed(coEvent); LOG.log(Level.FINE, "CONNECTION_CLOSED_EVENT_FIRED", new Object[] {listener}); } if (coEvent.getId() == ConnectionEvent.LOCAL_TRANSACTION_COMMITTED) { listener.localTransactionCommitted(coEvent); LOG.log(Level.FINE, "LOCAL_TX_COMMITTED_EVENT_FIRED", new Object[] {listener}); } if (coEvent.getId() == ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK) { listener.localTransactionRolledback(coEvent); LOG.log(Level.FINE, "LOCAL_TX_ROLLEDBACK_EVENT_FIRED", new Object[] {listener}); } if (coEvent.getId() == ConnectionEvent.LOCAL_TRANSACTION_STARTED) { listener.localTransactionStarted(coEvent); LOG.log(Level.FINE, "LOCAL_TX_STARTED_EVENT_FIRED", new Object[] {listener}); } if (coEvent.getId() == ConnectionEvent.CONNECTION_ERROR_OCCURRED) { listener.connectionErrorOccurred(coEvent); LOG.log(Level.FINE, "CTX_ERROR_OCURRED_EVENT_FIRED", new Object[] {listener}); } }
l.localTransactionCommitted(event); break;
public void fireConnectionEvent(int event) { ConnectionEvent connnectionEvent = new ConnectionEvent(this, event); connnectionEvent.setConnectionHandle(this.remoteConnection); for (ConnectionEventListener listener : this.listeners) { switch (event) { case LOCAL_TRANSACTION_STARTED: listener.localTransactionStarted(connnectionEvent); break; case LOCAL_TRANSACTION_COMMITTED: listener.localTransactionCommitted(connnectionEvent); break; case LOCAL_TRANSACTION_ROLLEDBACK: listener.localTransactionRolledback(connnectionEvent); break; case CONNECTION_CLOSED: listener.connectionClosed(connnectionEvent); break; default: throw new IllegalArgumentException("Unknown event: " + event); } } }
public void fireConnectionEvent(int event) { ConnectionEvent connnectionEvent = new ConnectionEvent(this, event); connnectionEvent.setConnectionHandle(this.fileConnection); for (ConnectionEventListener listener : this.listeners) { switch (event) { case LOCAL_TRANSACTION_STARTED: listener.localTransactionStarted(connnectionEvent); break; case LOCAL_TRANSACTION_COMMITTED: listener.localTransactionCommitted(connnectionEvent); break; case LOCAL_TRANSACTION_ROLLEDBACK: listener.localTransactionRolledback(connnectionEvent); break; case CONNECTION_CLOSED: listener.connectionClosed(connnectionEvent); break; default: throw new IllegalArgumentException("Unknown event: " + event); } } }
public void fireConnectionEvent(int event) { ConnectionEvent connnectionEvent = new ConnectionEvent(this, event); connnectionEvent.setConnectionHandle(this.executorConnection); for (ConnectionEventListener listener : this.listeners) { switch (event) { case LOCAL_TRANSACTION_STARTED: listener.localTransactionStarted(connnectionEvent); break; case LOCAL_TRANSACTION_COMMITTED: listener.localTransactionCommitted(connnectionEvent); break; case LOCAL_TRANSACTION_ROLLEDBACK: listener.localTransactionRolledback(connnectionEvent); break; case CONNECTION_CLOSED: listener.connectionClosed(connnectionEvent); break; default: throw new IllegalArgumentException("Unknown event: " + event); } } }
/** * Fire an event. * * @param event the event */ protected void fireConnectionEvent(ConnectionEvent event) { for (final ConnectionEventListener l : listeners) { switch (event.getId()) { case ConnectionEvent.CONNECTION_CLOSED: l.connectionClosed(event); break; case ConnectionEvent.CONNECTION_ERROR_OCCURRED: l.connectionErrorOccurred(event); break; case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED: l.localTransactionCommitted(event); break; case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK: l.localTransactionRolledback(event); break; case ConnectionEvent.LOCAL_TRANSACTION_STARTED: l.localTransactionStarted(event); break; default: LOG.error("unknown event id=" + event.getId()); } } }
for (int i = 0; i < listeners.size(); i++) { listener = (ConnectionEventListener) listeners.get(i); listener.localTransactionCommitted(event);
for (int i = 0; i < listeners.size(); i++) { listener = (ConnectionEventListener) listeners.get(i); listener.localTransactionCommitted(event);
private void raiseConnectionEvent(ConnectionEvent ce) { invalidateCache(); for (ConnectionEventListener cel : listeners) { switch (ce.getId()) { case ConnectionEvent.CONNECTION_CLOSED: cel.connectionClosed(ce); break; case ConnectionEvent.CONNECTION_ERROR_OCCURRED: cel.connectionErrorOccurred(ce); break; case ConnectionEvent.LOCAL_TRANSACTION_STARTED: cel.localTransactionStarted(ce); break; case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED: cel.localTransactionCommitted(ce); break; case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK: cel.localTransactionRolledback(ce); break; } } }
/** * Notifies the application server, through the {@link ConnectionEventListener}s it has registered with us, of what * happens with this connection. */ private void sendEvent(ConnectionEvent event) { for (Object object : listeners.getListeners()) { ConnectionEventListener listener = (ConnectionEventListener) object; switch (event.getId()) { case ConnectionEvent.CONNECTION_CLOSED: listener.connectionClosed(event); break; case ConnectionEvent.LOCAL_TRANSACTION_STARTED: listener.localTransactionStarted(event); break; case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED: listener.localTransactionCommitted(event); break; case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK: listener.localTransactionRolledback(event); break; case ConnectionEvent.CONNECTION_ERROR_OCCURRED: listener.connectionErrorOccurred(event); break; } } }
private void sendEventToListener(ConnectionEventListener listener, ConnectionEvent coEvent) { if (coEvent.getId() == ConnectionEvent.CONNECTION_CLOSED) { listener.connectionClosed(coEvent); } if (coEvent.getId() == ConnectionEvent.LOCAL_TRANSACTION_COMMITTED) { listener.localTransactionCommitted(coEvent); } if (coEvent.getId() == ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK) { listener.localTransactionRolledback(coEvent); } if (coEvent.getId() == ConnectionEvent.LOCAL_TRANSACTION_STARTED) { listener.localTransactionStarted(coEvent); } if (coEvent.getId() == ConnectionEvent.CONNECTION_ERROR_OCCURRED) { listener.connectionErrorOccurred(coEvent); } }