public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionStarted(ce); } };
public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionStarted(ce); } };
public void localTransactionStarted(ConnectionEvent event) { for (Iterator i = _eventListeners.iterator();i.hasNext(); ) ((ConnectionEventListener)i.next()).localTransactionStarted(event); }
protected void localTransactionStart(boolean isSPI) throws ResourceException { if (!isSPI) { ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED); for (int i = listeners.size() - 1; i >= 0; i--) { ConnectionEventListener listener = listeners.get(i); listener.localTransactionStarted(event); } } }
void notifyTxBegin(PersistenceManagerImpl handle) { ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED, null); ce.setConnectionHandle(handle); Collection localCels = null; synchronized (cels) { localCels = new ArrayList(cels); } for (Iterator i = localCels.iterator(); i.hasNext(); ) { ((ConnectionEventListener)i.next()).localTransactionStarted(ce); } }
break; case ConnectionEvent.LOCAL_TRANSACTION_STARTED: ((ConnectionEventListener) it.next()).localTransactionStarted(ce); break; case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
/** * 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 } } } }
l.localTransactionStarted(event); break;
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}); } }
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); } } }
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); } } }
/** * Notifies that the local transaction is beginning. * * @exception CommException If the wrapped physical connection * is lost. * @exception LocalTransactionException If a local transaction has already * begun. */ public synchronized void begin() throws ResourceException { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, this + " begin()"); if (! isValid()) throw new CommException("Physical connection to the underlying " + "JORAM server has been lost."); if (startedLocalTx) throw new LocalTransactionException("Local transaction has " + "already begun."); ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED); ConnectionEventListener listener; for (int i = 0; i < listeners.size(); i++) { listener = (ConnectionEventListener) listeners.get(i); listener.localTransactionStarted(event); } startedLocalTx = true; }
/** * Notifies that the local transaction is beginning. * * @exception CommException If the wrapped physical connection * is lost. * @exception LocalTransactionException If a local transaction has already * begun. */ public synchronized void begin() throws ResourceException { if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, this + " begin()"); if (! isValid()) throw new CommException("Physical connection to the underlying " + "JORAM server has been lost."); if (startedLocalTx) throw new LocalTransactionException("Local transaction has " + "already begun."); ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED); ConnectionEventListener listener; for (int i = 0; i < listeners.size(); i++) { listener = (ConnectionEventListener) listeners.get(i); listener.localTransactionStarted(event); } startedLocalTx = true; }
/** * 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()); } } }
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_STARTED: if (isDeliverStartedEvent()) { listener.localTransactionStarted(connectionEvent);