Refine search
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); } }
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); } } }
void closeHandle(JcaExecutorServiceConnection handle) { ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED); event.setConnectionHandle(handle); for (ConnectionEventListener cel : listeners) { cel.connectionClosed(event); } } public PrintWriter getLogWriter() throws ResourceException {
/** * When closed, the item is not put into the idle pool. */ void killPool() { if (_listener != null) { ConnectionEvent event; event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED); _listener.connectionErrorOccurred(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 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); } }
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 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); } }
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); } } }
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); } } }
public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.connectionClosed(ce); } };
public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionStarted(ce); } };
public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionRolledback(ce); } };
public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.localTransactionCommitted(ce); } };
public void notify(ConnectionEventListener cel, ConnectionEvent ce) { cel.connectionErrorOccurred(ce); } };
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); } } }
/** * Close handle * * @param handle The handle */ protected void closeHandle( JcrSessionHandle handle ) { ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED); event.setConnectionHandle(handle); for (ConnectionEventListener cel : listeners) { cel.connectionClosed(event); } }
/** * Sends the fatal event. */ public void sendFatalEvent(Exception e) { _isPingRequired = true; if (_listener != null) { ConnectionEvent event; event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e); _listener.connectionErrorOccurred(event); } }
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); } } } }
ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK); for (int i = 0; i < copy.size(); ++i) try cel.localTransactionRolledback(ce);