亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pooledspringxaconnection.java

?? Jencks是一個輕量級的JCA容器。它可以輕松部署到Spring中以提供消息驅動的POJOs.此外Jencks通過使用類似于JMS,JAX-RPC,JBI與JCA CCI的API來提供對inboun
?? JAVA
字號:
/**  * Licensed under the Apache License, Version 2.0 (the "License");  * you may not use this file except in compliance with the License.  * You may obtain a copy of the License at  *  * http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS,  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  * See the License for the specific language governing permissions and  * limitations under the License.  *  **/package org.jencks.pool;import javax.jms.Session;import javax.jms.JMSException;import javax.jms.ConnectionConsumer;import javax.jms.Destination;import javax.jms.ServerSessionPool;import javax.jms.Topic;import javax.jms.ExceptionListener;import javax.jms.ConnectionMetaData;import javax.jms.Queue;import javax.jms.QueueSession;import javax.jms.TopicSession;import javax.jms.XAConnection;import javax.jms.TopicConnection;import javax.jms.QueueConnection;import javax.jms.XASession;import javax.transaction.TransactionManager;import javax.transaction.Status;import javax.transaction.SystemException;import javax.transaction.RollbackException;import javax.transaction.xa.XAResource;import org.springframework.transaction.support.TransactionSynchronizationManager;import org.springframework.transaction.support.TransactionSynchronization;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;public class PooledSpringXAConnection implements TopicConnection,		QueueConnection, XAConnection {	private static final Log log = LogFactory			.getLog(PooledSpringXAConnection.class);	private final ConnectionInfo connectionInfo;	private XASessionPool sessionPool;	private TransactionManager transactionManager;	private boolean stopped;	private boolean closed;	private boolean clientIdSetSinceReopen = false;	private PooledSpringXAConnectionFactory pooledConnectionFactory;	public PooledSpringXAConnection(			final PooledSpringXAConnectionFactory pooledConnectionFactory,			final TransactionManager transactionManager,			final XAConnection connection) {		this(pooledConnectionFactory, transactionManager, new ConnectionInfo(				connection), new XASessionPool(connection));	}	public PooledSpringXAConnection(			final PooledSpringXAConnectionFactory pooledConnectionFactory,			final TransactionManager transactionManager,			final ConnectionInfo connectionInfo, final XASessionPool sessionPool) {		this.pooledConnectionFactory = pooledConnectionFactory;		this.transactionManager = transactionManager;		this.connectionInfo = connectionInfo;		this.sessionPool = sessionPool;		this.closed = false;	}	/**	 * Factory method to create a new instance.	 */	public PooledSpringXAConnection newInstance() {		return new PooledSpringXAConnection(this.pooledConnectionFactory,				this.transactionManager, this.connectionInfo, this.sessionPool);	}	public void close() throws JMSException {		this.closed = true;	}	public void start() throws JMSException {		// TODO should we start connections first before pooling them?		getConnection().start();	}	public void stop() throws JMSException {		this.stopped = true;	}	public ConnectionConsumer createConnectionConsumer(			final Destination destination, final String selector,			final ServerSessionPool serverSessionPool, final int maxMessages)			throws JMSException {		return getConnection().createConnectionConsumer(destination, selector,				serverSessionPool, maxMessages);	}	public ConnectionConsumer createConnectionConsumer(Topic topic, String s,			ServerSessionPool serverSessionPool, int maxMessages)			throws JMSException {		return getConnection().createConnectionConsumer(topic, s,				serverSessionPool, maxMessages);	}	public ConnectionConsumer createDurableConnectionConsumer(			final Topic topic, final String selector, final String s1,			final ServerSessionPool serverSessionPool, final int i)			throws JMSException {		return getConnection().createDurableConnectionConsumer(topic, selector,				s1, serverSessionPool, i);	}	public String getClientID() throws JMSException {		return getConnection().getClientID();	}	public ExceptionListener getExceptionListener() throws JMSException {		return getConnection().getExceptionListener();	}	public ConnectionMetaData getMetaData() throws JMSException {		return getConnection().getMetaData();	}	public void setExceptionListener(ExceptionListener exceptionListener)			throws JMSException {		getConnection().setExceptionListener(exceptionListener);	}	public void setClientID(String clientID) throws JMSException {		if (this.clientIdSetSinceReopen) {			throw new JMSException(					"ClientID is already set on this connection.");		}		synchronized (this.connectionInfo) {			if (this.connectionInfo.isActualClientIdSet()) {				if (this.connectionInfo.getActualClientIdBase() == null ? clientID != null						: !this.connectionInfo.getActualClientIdBase().equals(								clientID)) {					throw new JMSException(							"A pooled Connection must only ever have its client ID set to the same value for the duration of the pooled ConnectionFactory.  It looks like code has set a client ID, returned the connection to the pool, and then later obtained the connection from the pool and set a different client ID.");				}			} else {				final String generatedId = getPooledConnectionFactory()						.generateClientID(clientID);				getConnection().setClientID(generatedId);				this.connectionInfo.setActualClientIdBase(clientID);				this.connectionInfo.setActualClientIdSet(true);			}		}		this.clientIdSetSinceReopen = true;	}	public ConnectionConsumer createConnectionConsumer(final Queue queue,			final String selector, final ServerSessionPool serverSessionPool,			final int maxMessages) throws JMSException {		return getConnection().createConnectionConsumer(queue, selector,				serverSessionPool, maxMessages);	}	public XASession createXASession() throws JMSException {		try {			if (log.isDebugEnabled()) {				log.debug("-->> ENTERING PooledSpringXAConnection.createXASession()");			}			if (this.transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION) {				if (log.isDebugEnabled()) {					log.debug("-->> ACTUAL TRANSACTION IS ACTIVE!");				}				final XASession session = (XASession) TransactionSynchronizationManager.getResource(this.connectionInfo.getConnection());				if (session != null) {					if (log.isDebugEnabled()) {						log.debug("-->> RETURNING ALREADY ACTIVE SESSION ASSOCIATED WITH CURRENT THREAD...");					}					return session;				} else {					if (log.isDebugEnabled()) {						log.debug("-->> NO ACTIVE SESSION ASSOCIATED WITH CURRENT THREAD, BORROWING...");					}					final PooledSpringXASession newSession = this.sessionPool.borrowSession();					newSession.setIgnoreClose(true);					if (log.isDebugEnabled()) {						log.debug("-->> ENLISTING NEW SESSION'S XAResource WITH TRANSACTION...");					}					this.transactionManager.getTransaction().enlistResource(newSession.getXAResource());					try {						if (log.isDebugEnabled()) {							log.debug("-->> BINDING NEW SESSION WITH TRANSACTION...");						}						TransactionSynchronizationManager.bindResource(this.connectionInfo.getConnection(), newSession);						try {							if (log.isDebugEnabled()) {								log.debug("-->> REGISTERING SYNCHRONIZATION WITH TRANSACTION...");							}							TransactionSynchronizationManager.registerSynchronization(new Synchronization(newSession));							return newSession;						} catch (Throwable t) {							if (log.isDebugEnabled()) {								log.debug("-->> CAUGHT EXCEPTION WHILE ASSOCIATING SESSION WITH TRANSACTION, UNBINDING RESOURCE.", t);							}							TransactionSynchronizationManager.unbindResource(connectionInfo.getConnection());							newSession.setIgnoreClose(false);							throw t;						}					} catch (Throwable t) {						if (log.isDebugEnabled()) {							log.debug("-->> CAUGHT EXCEPTION WHILE ASSOCIATING SESSION WITH TRANSACTION (2), DELISTING RESOURCE...", t);						}						this.transactionManager.getTransaction().delistResource(newSession.getXAResource(), XAResource.TMSUCCESS);						if (log.isDebugEnabled()) {							log.debug("-->> DESTROYING SESSION AND REMOVING FROM POOL...");						}						newSession.destroyAndRemoveFromPool();						if (log.isDebugEnabled()) {							log.debug("-->> RETHROWING EXCEPTION...");						}						if (t instanceof JMSException) {							throw (JMSException) t;						} else if (t instanceof RuntimeException) {							throw (RuntimeException) t;						} else if (t instanceof Error) {							throw (Error) t;						} else {							final JMSException jmsException = new JMSException("Unable to enlist session with transaction.");							jmsException.initCause(t);							throw jmsException;						}					}				}			} else {				if (log.isDebugEnabled())					log							.debug("-->> THERE IS NO ACTIVE TRANSACTION, SO JUST RETURNING BORROWED SESSION...");				return this.sessionPool.borrowSession();			}		} catch (SystemException e) {			final JMSException jmsException = new JMSException(					"System Exception");			jmsException.initCause(e);			throw jmsException;		} catch (RollbackException re) {			final JMSException jmsException = new JMSException(					"Rollback exception");			jmsException.initCause(re);			throw jmsException;		}	}	// Session factory methods	//-------------------------------------------------------------------------	public QueueSession createQueueSession(boolean transacted, int ackMode)			throws JMSException {		return (QueueSession) createSession(transacted, ackMode);	}	public TopicSession createTopicSession(boolean transacted, int ackMode)			throws JMSException {		return (TopicSession) createSession(transacted, ackMode);	}	public Session createSession(boolean transacted, int ackMode)			throws JMSException {		return createXASession();	}	// Implementation methods	//-------------------------------------------------------------------------	protected XAConnection getConnection() throws JMSException {		if (this.stopped || this.closed) {			throw new JMSException("Already closed");		}		return this.connectionInfo.getConnection();	}	public PooledSpringXAConnectionFactory getPooledConnectionFactory() {		return this.pooledConnectionFactory;	}	private class Synchronization implements TransactionSynchronization {		private final PooledSpringXASession session;		private Synchronization(PooledSpringXASession session) {			this.session = session;		}		public void suspend() {			if (log.isDebugEnabled()) {				log.debug("-->> PooledSpringXAConnection.[synchronization].suspend() CALLED...");			}			TransactionSynchronizationManager.unbindResource(connectionInfo.getConnection());		}		public void resume() {			if (log.isDebugEnabled()) {				log.debug("-->> PooledSpringXAConnection.[synchronization].resume() CALLED...");			}			TransactionSynchronizationManager.bindResource(connectionInfo.getConnection(), session);		}		public void beforeCommit(boolean readOnly) {		}		public void beforeCompletion() {		}		public void afterCompletion(int status) {			if (log.isDebugEnabled()) {				log.debug("-->> PooledSpringXAConnection.[synchronization].afterCompletion() CALLED...");			}			TransactionSynchronizationManager.unbindResource(connectionInfo.getConnection());			try {				// This will return session to the pool.				if (log.isDebugEnabled()) {					log.debug("-->> RETURNING JMS SESSION TO POOL...");				}				session.setIgnoreClose(false);				session.close();			} catch (JMSException e) {				throw new RuntimeException(e);			}		}	}	private static class ConnectionInfo {		private XAConnection connection;		private boolean actualClientIdSet;		private String actualClientIdBase;		public ConnectionInfo(final XAConnection connection) {			this.connection = connection;			this.actualClientIdSet = false;			this.actualClientIdBase = null;		}		public XAConnection getConnection() {			return connection;		}		public void setConnection(final XAConnection connection) {			this.connection = connection;		}		public synchronized boolean isActualClientIdSet() {			return actualClientIdSet;		}		public synchronized void setActualClientIdSet(				final boolean actualClientIdSet) {			this.actualClientIdSet = actualClientIdSet;		}		public synchronized String getActualClientIdBase() {			return actualClientIdBase;		}		public synchronized void setActualClientIdBase(				final String actualClientIdBase) {			this.actualClientIdBase = actualClientIdBase;		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人免费在线观看| 国产色产综合产在线视频| 成人丝袜视频网| 国产精品一区二区视频| 精品一区二区三区在线播放视频| 免费久久99精品国产| 日本vs亚洲vs韩国一区三区 | 蜜桃视频免费观看一区| 裸体一区二区三区| 精品一区二区三区免费观看| 激情五月婷婷综合| 成人av在线一区二区三区| 成人黄色国产精品网站大全在线免费观看 | 色婷婷久久久综合中文字幕| 色美美综合视频| 欧美巨大另类极品videosbest | 成人黄色小视频在线观看| k8久久久一区二区三区 | 欧美午夜片在线看| 欧美理论在线播放| 久久综合色天天久久综合图片| 国产欧美日韩另类一区| 综合自拍亚洲综合图不卡区| 亚洲最新视频在线播放| 奇米精品一区二区三区四区 | av男人天堂一区| 欧美亚日韩国产aⅴ精品中极品| 欧美福利电影网| 久久久99精品免费观看不卡| 亚洲色图在线看| 天堂成人免费av电影一区| 国产在线精品免费| 色呦呦网站一区| 欧美一区二区三区不卡| 国产精品网站在线播放| 五月婷婷久久丁香| 成人三级在线视频| 欧美疯狂做受xxxx富婆| 国产精品久久久久久久裸模| 天堂va蜜桃一区二区三区漫画版 | 亚洲一区二区3| 国产在线一区二区| 日韩欧美国产一区在线观看| 欧美精品一区二区三区在线播放| **性色生活片久久毛片| 激情综合一区二区三区| 欧美午夜在线观看| 亚洲欧洲av色图| 国产黄色精品网站| 欧美一区二区三区在线电影| 亚洲黄色尤物视频| 国产精品一区二区三区99| 3d成人动漫网站| 亚洲精品国产成人久久av盗摄| 精品一区二区三区视频在线观看| 欧美日韩精品福利| 一区二区免费看| 91女人视频在线观看| 久久久久久久久97黄色工厂| 麻豆一区二区在线| 在线成人免费观看| 亚洲一级二级三级| 91成人网在线| 一区二区三区影院| 色婷婷久久久亚洲一区二区三区| 中文字幕视频一区| 成人国产在线观看| 欧美国产成人在线| 国产精品亚洲专一区二区三区| 欧美一级在线免费| 免费欧美高清视频| 欧美性猛交xxxxxx富婆| 亚洲一区二区欧美日韩 | 亚洲精选免费视频| 91免费观看在线| 综合久久一区二区三区| 不卡av在线免费观看| 1区2区3区国产精品| 成人av第一页| 亚洲欧美激情插| 色婷婷久久99综合精品jk白丝| 国产无遮挡一区二区三区毛片日本| 在线观看网站黄不卡| 亚洲人成在线播放网站岛国| www.成人在线| 亚洲一二三区在线观看| 在线免费观看日本一区| 午夜久久久久久| 欧美mv和日韩mv的网站| 国产精品一区二区久久不卡| 国产精品家庭影院| 色综合久久中文综合久久牛| 亚洲一卡二卡三卡四卡五卡| 日韩一区二区三区视频在线观看| 狠狠色狠狠色综合系列| 国产精品久久久久久久午夜片| www.欧美日韩| 天天综合网 天天综合色| 欧美一区二区三区日韩视频| 国产精品一二三区| 一区二区三区在线视频播放| 91精品黄色片免费大全| 激情综合色丁香一区二区| 中文av字幕一区| 欧美日韩在线播放三区四区| 久久91精品久久久久久秒播| 久久久www成人免费无遮挡大片| 97国产一区二区| 日本不卡1234视频| 亚洲视频1区2区| 久久婷婷色综合| 欧美日韩国产欧美日美国产精品| 国产资源精品在线观看| 一区二区日韩av| 欧美mv和日韩mv的网站| 日韩午夜av电影| 91免费看视频| 国模冰冰炮一区二区| 亚洲国产裸拍裸体视频在线观看乱了| 精品欧美乱码久久久久久1区2区| 一本大道久久a久久综合婷婷| 韩国女主播一区| 性久久久久久久久| 亚洲视频一区在线| 久久精品欧美一区二区三区麻豆| 欧美视频在线观看一区| 国产精品一区免费在线观看| 肉丝袜脚交视频一区二区| 国产精品嫩草影院com| 日韩片之四级片| 欧美日韩高清一区二区| 99久久久精品| 国产成a人亚洲精| 免费在线观看成人| 亚洲va欧美va人人爽| 自拍偷拍亚洲综合| 日本一区二区免费在线| 精品欧美乱码久久久久久| 欧美群妇大交群中文字幕| 一本到三区不卡视频| 91免费国产在线| 97久久久精品综合88久久| 成人自拍视频在线| 国产大陆亚洲精品国产| 国产呦萝稀缺另类资源| 国内欧美视频一区二区| 九九**精品视频免费播放| 老司机精品视频在线| 日韩av电影免费观看高清完整版在线观看| 亚洲色图都市小说| 综合久久给合久久狠狠狠97色| 国产女同性恋一区二区| 中文字幕 久热精品 视频在线| 久久久噜噜噜久噜久久综合| 欧美精品一区二| 国产欧美一区二区在线观看| 欧美激情在线看| 亚洲国产精品ⅴa在线观看| 亚洲国产精品精华液2区45| 国产免费观看久久| 国产精品美女视频| 亚洲精品一卡二卡| 亚洲午夜久久久久久久久电影网| 亚洲一区二区三区爽爽爽爽爽| 亚洲成国产人片在线观看| 日日噜噜夜夜狠狠视频欧美人| 奇米色一区二区| 福利视频网站一区二区三区| 91在线免费视频观看| 欧美怡红院视频| 欧美一级黄色片| 国产欧美一区二区三区鸳鸯浴 | 一区二区三区四区激情| 亚洲一本大道在线| 日韩 欧美一区二区三区| 国产精品白丝av| 97se亚洲国产综合自在线| 欧美天堂亚洲电影院在线播放| 91精品国产色综合久久不卡蜜臀 | 亚洲一区在线播放| 美女脱光内衣内裤视频久久网站| 国产精品一线二线三线精华| 在线观看三级视频欧美| 欧美精品18+| 国产三级欧美三级日产三级99| 国产精品国产成人国产三级| 亚欧色一区w666天堂| 国产成人在线电影| 欧美三级三级三级爽爽爽| 精品福利一区二区三区免费视频| 最新中文字幕一区二区三区| 日韩精品成人一区二区在线| 大桥未久av一区二区三区中文| 欧美日韩国产在线观看| 国产精品午夜春色av| 秋霞国产午夜精品免费视频| 99麻豆久久久国产精品免费| 精品国产伦一区二区三区免费| 亚洲精品视频在线观看网站| 国产美女av一区二区三区|