当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionEventListener.connectionClosed方法代码示例

本文整理汇总了Java中javax.resource.spi.ConnectionEventListener.connectionClosed方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionEventListener.connectionClosed方法的具体用法?Java ConnectionEventListener.connectionClosed怎么用?Java ConnectionEventListener.connectionClosed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.resource.spi.ConnectionEventListener的用法示例。


在下文中一共展示了ConnectionEventListener.connectionClosed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: connectionClosed

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
void connectionClosed(WrappedConnection wc) {
	
	synchronized (this.handles) {
		handles.remove(wc);
	}
	
	ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
	ce.setConnectionHandle(wc);
	
	ArrayList<ConnectionEventListener> copy = null;
	synchronized (this.listeners) {
		copy = new ArrayList<ConnectionEventListener>(this.listeners);
	}
	
	for(ConnectionEventListener l: copy) {
		l.connectionClosed(ce);
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:19,代码来源:BasicManagedConnection.java

示例2: sendConnectionEvent

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
protected void sendConnectionEvent(ConnectionEvent connEvent) {
for (int i = listeners.size() - 1; i >= 0; i--) {
    ConnectionEventListener listener =
	(ConnectionEventListener) listeners.get(i);
    if (connEvent.getId() == ConnectionEvent.CONNECTION_CLOSED) {
	listener.connectionClosed(connEvent);
    } else if (connEvent.getId() ==
	       ConnectionEvent.CONNECTION_ERROR_OCCURRED) {
	listener.connectionErrorOccurred(connEvent);
    } else if (connEvent.getId() ==
	       ConnectionEvent.LOCAL_TRANSACTION_STARTED) {
	listener.localTransactionStarted(connEvent);
    } else if (connEvent.getId() ==
	       ConnectionEvent.LOCAL_TRANSACTION_COMMITTED) {
	listener.localTransactionCommitted(connEvent);
    } else if (connEvent.getId() ==
	       ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK) {
	listener.localTransactionRolledback(connEvent);
    }
}
   }
 
开发者ID:nologic,项目名称:nabs,代码行数:22,代码来源:JEManagedConnection.java

示例3: sendConnectionEvent

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
protected void sendConnectionEvent(ConnectionEvent connEvent) {
    for (int i = listeners.size() - 1; i >= 0; i--) {
        ConnectionEventListener listener =
            listeners.get(i);
        if (connEvent.getId() == ConnectionEvent.CONNECTION_CLOSED) {
            listener.connectionClosed(connEvent);
        } else if (connEvent.getId() ==
                   ConnectionEvent.CONNECTION_ERROR_OCCURRED) {
            listener.connectionErrorOccurred(connEvent);
        } else if (connEvent.getId() ==
                   ConnectionEvent.LOCAL_TRANSACTION_STARTED) {
            listener.localTransactionStarted(connEvent);
        } else if (connEvent.getId() ==
                   ConnectionEvent.LOCAL_TRANSACTION_COMMITTED) {
            listener.localTransactionCommitted(connEvent);
        } else if (connEvent.getId() ==
                   ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK) {
            listener.localTransactionRolledback(connEvent);
        }
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:22,代码来源:JEManagedConnection.java

示例4: fireConnectionEvent

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
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);
		}
	}
}
 
开发者ID:scheuchzer,项目名称:outbound-connector,代码行数:23,代码来源:GenericManagedConnection.java

示例5: connectionClosed

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
public void connectionClosed(CI handle) {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);
    // count down in case sending the event results in a handle getting removed.
    if (listeners != null) {
        for (ConnectionEventListener listener : reverse(listeners)) {
            listener.connectionClosed(event);
        }
    }
    if (listener != null) {
        listener.connectionClosed(event);
    }
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:14,代码来源:AbstractManagedConnection.java

示例6: closeHandle

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
/**
 * Close handle
 *
 * @param handle
 *          The handle
 */
void closeHandle(RabbitmqConnection handle) {
  ConnectionEvent event = new ConnectionEvent(this,
      ConnectionEvent.CONNECTION_CLOSED);
  event.setConnectionHandle(handle);
  for (ConnectionEventListener cel : listeners) {
    cel.connectionClosed(event);
  }

}
 
开发者ID:leogsilva,项目名称:rabbitmq-resource-adapter,代码行数:16,代码来源:RabbitmqManagedConnection.java

示例7: close

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
public void close(TransactionAssistant handle) {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);
    for(ConnectionEventListener l : listeners){
        l.connectionClosed(event);
    }
}
 
开发者ID:maxant,项目名称:genericconnector,代码行数:8,代码来源:ManagedTransactionAssistance.java

示例8: sendEvent

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
/**
 * Send an event.
 *
 * @param event The event to send.
 */
protected void sendEvent(final ConnectionEvent event) {
   if (logger.isTraceEnabled()) {
      ActiveMQRALogger.LOGGER.trace("sendEvent(" + event + ")");
   }

   int type = event.getId();

   // convert to an array to avoid concurrent modification exceptions
   ConnectionEventListener[] list = eventListeners.toArray(new ConnectionEventListener[eventListeners.size()]);

   for (ConnectionEventListener l : list) {
      switch (type) {
         case ConnectionEvent.CONNECTION_CLOSED:
            l.connectionClosed(event);
            break;

         case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
            l.localTransactionStarted(event);
            break;

         case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
            l.localTransactionCommitted(event);
            break;

         case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
            l.localTransactionRolledback(event);
            break;

         case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
            l.connectionErrorOccurred(event);
            break;

         default:
            throw new IllegalArgumentException("Illegal eventType: " + type);
      }
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:43,代码来源:ActiveMQRAManagedConnection.java

示例9: sendEvent

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
void sendEvent(ConnectionEvent ce)
{
	Vector list = (Vector) m_listeners.clone();
	int size = list.size();
	for (int i = 0; i < size; i++)
	{
		ConnectionEventListener l =
				(ConnectionEventListener) list.elementAt(i);
		switch (ce.getId())
		{
			case ConnectionEvent.CONNECTION_CLOSED:
				l.connectionClosed(ce);
				break;
			case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
				l.localTransactionStarted(ce);
				break;
			case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
				l.localTransactionCommitted(ce);
				break;
			case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
				l.localTransactionRolledback(ce);
				break;
			case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
				l.connectionErrorOccurred(ce);
				break;
			default:
				throw new IllegalArgumentException("Illegal eventType: " + ce.getId());
		}
	}
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:31,代码来源:OTMConnectionEventListener.java

示例10: closeHandle

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
/**
 * Close handle
 *
 * @param handle
 *          The handle
 */
void closeHandle(VertxConnectionImpl handle) {
  ConnectionEvent event = new ConnectionEvent(this,
      ConnectionEvent.CONNECTION_CLOSED);
  event.setConnectionHandle(handle);
  for (ConnectionEventListener cel : listeners) {
    cel.connectionClosed(event);
  }
}
 
开发者ID:vert-x3,项目名称:vertx-jca,代码行数:15,代码来源:VertxManagedConnection.java

示例11: closeHandle

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
/**
 *
 * @param handle
 */
public void closeHandle(BeanstalkdConnectionImpl handle) {
    try {
        ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
        event.setConnectionHandle(handle);
        for (ConnectionEventListener cel : listeners) {
            cel.connectionClosed(event);
        }
    } catch (Exception ex) {
        System.out.println(ex.getMessage());
        ex.printStackTrace(System.err);
        LOG.error("Error while closing connection", ex);
    }
}
 
开发者ID:svenvarkel,项目名称:beanstalkdconnector,代码行数:18,代码来源:BeanstalkdManagedConnection.java

示例12: closeHandle

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
/**
 * Close handle
 *
 * @param handle The handle
 */
void closeHandle(UnifiedSecurityConnection handle)
{
   connectionSet.remove(handle);

   ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
   event.setConnectionHandle(handle);

   List<ConnectionEventListener> copy = new ArrayList<ConnectionEventListener>(listeners);
   for (ConnectionEventListener cel : copy)
   {
      cel.connectionClosed(event);
   }

}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:20,代码来源:UnifiedSecurityManagedConnection.java

示例13: closeHandle

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
/**
 * Close handle
 *
 * @param handle The handle
 */
void closeHandle(WorkConnection handle)
{
   ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
   event.setConnectionHandle(handle);
   for (ConnectionEventListener cel : listeners)
   {
      cel.connectionClosed(event);
   }

}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:16,代码来源:WorkManagedConnection.java

示例14: closeHandle

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
/**
 * Close handle
 *
 * @param handle The handle
 */
void closeHandle(LazyConnection handle)
{
   ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
   event.setConnectionHandle(handle);
   for (ConnectionEventListener cel : listeners)
   {
      cel.connectionClosed(event);
   }
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:15,代码来源:LazyManagedConnection.java

示例15: closeHandle

import javax.resource.spi.ConnectionEventListener; //导入方法依赖的package包/类
/**
 * Close handle
 */
void closeHandle()
{
   ConnectionEvent closeEvent = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
   closeEvent.setConnectionHandle(connection);

   List<ConnectionEventListener> copy = new ArrayList<ConnectionEventListener>(listeners);
   for (ConnectionEventListener cel : copy)
   {
      cel.connectionClosed(closeEvent);
   }
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:15,代码来源:PerfManagedConnection.java


注:本文中的javax.resource.spi.ConnectionEventListener.connectionClosed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。