public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionRolledback(ce); } };
public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionRolledback(ce); } };
public void localTransactionRolledback(ConnectionEvent event) { for (Iterator i = _eventListeners.iterator();i.hasNext(); ) ((ConnectionEventListener)i.next()).localTransactionRolledback(event); }
protected void localTransactionRollback(boolean isSPI) throws ResourceException { if (!isSPI) { ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK); for (int i = 0; i < listeners.size(); i++) { ConnectionEventListener listener = listeners.get(i); listener.localTransactionRolledback(event); } } }
void notifyTxRollback(PersistenceManagerImpl handle) { ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK, null); ce.setConnectionHandle(handle); Collection localCels = null; synchronized (cels) { localCels = new ArrayList(cels); } for (Iterator i = localCels.iterator(); i.hasNext(); ) { ((ConnectionEventListener)i.next()).localTransactionRolledback(ce); } }
/** * 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.localTransactionRolledback(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()); } } }
/** * Rollsback the local transaction. * * @exception CommException If the wrapped physical connection * is lost. * @exception LocalTransactionException If the local transaction has not * begun, or if the rollback fails. */ public synchronized void rollback() throws ResourceException { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, this + " rollback()"); if (! isValid()) throw new CommException("Physical connection to the underlying JORAM server has been lost."); if (! startedLocalTx) throw new LocalTransactionException("Local transaction has not begun."); try { session.rollback(); } catch (JMSException exc) { throw new LocalTransactionException("Rollback of the transacted JMS session failed: " + exc); } ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK); ConnectionEventListener listener; for (int i = 0; i < listeners.size(); i++) { listener = (ConnectionEventListener) listeners.get(i); listener.localTransactionRolledback(event); } startedLocalTx = false; }
for (int i = 0; i < listeners.size(); i++) { listener = (ConnectionEventListener) listeners.get(i); listener.localTransactionRolledback(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); } }
case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK: if (isDeliverRolledback()) { listener.localTransactionRolledback(connectionEvent);