コード例 #1
0
 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);
     }
   }
 }