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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? simpleremoteslsbinvokerinterceptor.java

?? spring framework 2.5.4源代碼
?? JAVA
字號:
/*
 * Copyright 2002-2008 the original author or authors.
 *
 * 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.springframework.ejb.access;

import java.lang.reflect.InvocationTargetException;
import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBObject;
import javax.naming.NamingException;

import org.aopalliance.intercept.MethodInvocation;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.remoting.RemoteLookupFailureException;
import org.springframework.remoting.rmi.RmiClientInterceptorUtils;

/**
 * Basic invoker for a remote Stateless Session Bean.
 * Designed for EJB 2.x, but works for EJB 3 Session Beans as well.
 *
 * <p>"Creates" a new EJB instance for each invocation, or caches the session
 * bean instance for all invocations (see {@link #setCacheSessionBean}).
 * See {@link org.springframework.jndi.JndiObjectLocator} for info on
 * how to specify the JNDI location of the target EJB.
 *
 * <p>In a bean container, this class is normally best used as a singleton. However,
 * if that bean container pre-instantiates singletons (as do the XML ApplicationContext
 * variants) you may have a problem if the bean container is loaded before the EJB
 * container loads the target EJB. That is because by default the JNDI lookup will be
 * performed in the init method of this class and cached, but the EJB will not have been
 * bound at the target location yet. The best solution is to set the "lookupHomeOnStartup"
 * property to "false", in which case the home will be fetched on first access to the EJB.
 * (This flag is only true by default for backwards compatibility reasons).
 *
 * <p>This invoker is typically used with an RMI business interface, which serves
 * as super-interface of the EJB component interface. Alternatively, this invoker
 * can also proxy a remote SLSB with a matching non-RMI business interface, i.e. an
 * interface that mirrors the EJB business methods but does not declare RemoteExceptions.
 * In the latter case, RemoteExceptions thrown by the EJB stub will automatically get
 * converted to Spring's unchecked RemoteAccessException.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @since 09.05.2003
 * @see org.springframework.remoting.RemoteAccessException
 * @see AbstractSlsbInvokerInterceptor#setLookupHomeOnStartup
 * @see AbstractSlsbInvokerInterceptor#setCacheHome
 * @see AbstractRemoteSlsbInvokerInterceptor#setRefreshHomeOnConnectFailure
 */
public class SimpleRemoteSlsbInvokerInterceptor extends AbstractRemoteSlsbInvokerInterceptor
		implements DisposableBean {

	private boolean cacheSessionBean = false;

	private EJBObject beanInstance;

	private final Object beanInstanceMonitor = new Object();


	/**
	 * Set whether to cache the actual session bean object.
	 * <p>Off by default for standard EJB compliance. Turn this flag
	 * on to optimize session bean access for servers that are
	 * known to allow for caching the actual session bean object.
	 * @see #setCacheHome
	 */
	public void setCacheSessionBean(boolean cacheSessionBean) {
		this.cacheSessionBean = cacheSessionBean;
	}


	/**
	 * This implementation "creates" a new EJB instance for each invocation.
	 * Can be overridden for custom invocation strategies.
	 * <p>Alternatively, override {@link #getSessionBeanInstance} and
	 * {@link #releaseSessionBeanInstance} to change EJB instance creation,
	 * for example to hold a single shared EJB component instance.
	 */
	protected Object doInvoke(MethodInvocation invocation) throws Throwable {
		EJBObject ejb = null;
		try {
			ejb = getSessionBeanInstance();
			return RmiClientInterceptorUtils.invokeRemoteMethod(invocation, ejb);
		}
		catch (NamingException ex) {
			throw new RemoteLookupFailureException("Failed to locate remote EJB [" + getJndiName() + "]", ex);
		}
		catch (InvocationTargetException ex) {
			Throwable targetEx = ex.getTargetException();
			if (targetEx instanceof RemoteException) {
				RemoteException rex = (RemoteException) targetEx;
				throw RmiClientInterceptorUtils.convertRmiAccessException(
				    invocation.getMethod(), rex, isConnectFailure(rex), getJndiName());
			}
			else if (targetEx instanceof CreateException) {
				throw RmiClientInterceptorUtils.convertRmiAccessException(
				    invocation.getMethod(), targetEx, "Could not create remote EJB [" + getJndiName() + "]");
			}
			throw targetEx;
		}
		finally {
			if (ejb != null) {
				releaseSessionBeanInstance(ejb);
			}
		}
	}

	/**
	 * Return an EJB component instance to delegate the call to.
	 * <p>The default implementation delegates to {@link #newSessionBeanInstance}.
	 * @return the EJB component instance
	 * @throws NamingException if thrown by JNDI
	 * @throws InvocationTargetException if thrown by the create method
	 * @see #newSessionBeanInstance
	 */
	protected EJBObject getSessionBeanInstance() throws NamingException, InvocationTargetException {
		if (this.cacheSessionBean) {
			synchronized (this.beanInstanceMonitor) {
				if (this.beanInstance == null) {
					this.beanInstance = newSessionBeanInstance();
				}
				return this.beanInstance;
			}
		}
		else {
			return newSessionBeanInstance();
		}
	}

	/**
	 * Release the given EJB instance.
	 * <p>The default implementation delegates to {@link #removeSessionBeanInstance}.
	 * @param ejb the EJB component instance to release
	 * @see #removeSessionBeanInstance
	 */
	protected void releaseSessionBeanInstance(EJBObject ejb) {
		if (!this.cacheSessionBean) {
			removeSessionBeanInstance(ejb);
		}
	}

	/**
	 * Reset the cached session bean instance, if necessary.
	 */
	protected void refreshHome() throws NamingException {
		super.refreshHome();
		if (this.cacheSessionBean) {
			synchronized (this.beanInstanceMonitor) {
				this.beanInstance = null;
			}
		}
	}

	/**
	 * Remove the cached session bean instance, if necessary.
	 */
	public void destroy() {
		if (this.cacheSessionBean) {
			synchronized (this.beanInstanceMonitor) {
				removeSessionBeanInstance(this.beanInstance);
			}
		}
	}

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合图片区| 美女在线视频一区| 美国毛片一区二区| 91国产福利在线| 国产精品每日更新在线播放网址| 亚洲午夜视频在线| 成人听书哪个软件好| 精品区一区二区| 污片在线观看一区二区| av日韩在线网站| 国产日韩影视精品| 国产精品一区二区x88av| 欧美日韩国产在线观看| 亚洲女同ⅹxx女同tv| 日本亚洲电影天堂| 色婷婷av一区二区三区gif| 91精品国产一区二区人妖| 国产精品理论在线观看| 韩国三级在线一区| 91超碰这里只有精品国产| 欧美激情综合五月色丁香小说| 亚洲v日本v欧美v久久精品| 岛国精品一区二区| 久久精品夜色噜噜亚洲aⅴ| 日韩制服丝袜先锋影音| 欧洲一区在线电影| 美女视频黄 久久| 91精品视频网| 免费xxxx性欧美18vr| 欧美午夜不卡视频| 亚洲3atv精品一区二区三区| 在线观看日韩电影| 亚洲成人手机在线| 欧美一区二区在线免费观看| 亚洲成人久久影院| 日韩欧美在线不卡| 国产麻豆成人精品| 中文字幕一区二区三区蜜月 | av一区二区三区四区| 中文字幕一区视频| 欧美日韩一区中文字幕| 日韩精品乱码av一区二区| 精品久久久久久久久久久久包黑料 | 99久久综合99久久综合网站| 国产精品久久久久久久第一福利| 91色视频在线| 六月丁香婷婷色狠狠久久| 日本一区二区动态图| 欧美午夜一区二区| 国产一区二区三区免费| 自拍偷自拍亚洲精品播放| 欧美日韩久久久久久| 国产精品中文有码| 亚洲成av人片在线观看| 欧美国产在线观看| 7777精品伊人久久久大香线蕉的 | 亚洲国产日韩a在线播放性色| 51精品国自产在线| 91麻豆产精品久久久久久| 免费成人美女在线观看| 亚洲日本成人在线观看| 精品黑人一区二区三区久久| 91小宝寻花一区二区三区| 狠狠色狠狠色综合| 久久99在线观看| 亚洲电影第三页| 亚洲手机成人高清视频| 国产精品久久久久久久久免费樱桃| 欧美美女视频在线观看| 欧美日韩中文精品| 91亚洲男人天堂| 波多野结衣在线aⅴ中文字幕不卡| 国产自产v一区二区三区c| 婷婷开心激情综合| 日韩av电影免费观看高清完整版| 亚洲欧美日韩一区二区三区在线观看| 国产人成一区二区三区影院| 精品久久久久久久久久久久久久久久久 | 1024成人网色www| 亚洲欧洲99久久| 自拍偷拍国产精品| 一区二区三区四区亚洲| 亚洲欧美一区二区不卡| 亚洲视频香蕉人妖| 亚洲精品日韩专区silk| 一区二区三区四区不卡视频| 亚洲欧美自拍偷拍色图| 国产精品久久久久久久裸模| 亚洲综合色网站| 日本不卡123| 高清shemale亚洲人妖| 成人丝袜高跟foot| 欧美体内she精高潮| 欧美一级xxx| 中文字幕av在线一区二区三区| 一区在线观看视频| 五月天中文字幕一区二区| 免费高清在线一区| 成人av网站在线观看| 欧美疯狂性受xxxxx喷水图片| 久久久无码精品亚洲日韩按摩| 中文字幕亚洲不卡| 激情都市一区二区| 在线日韩国产精品| 久久久精品中文字幕麻豆发布| 亚洲欧美一区二区久久| 韩国一区二区三区| 91精品福利在线一区二区三区| 国产精品免费视频网站| 日本成人在线看| 在线视频欧美精品| 国产精品久久久久久久久免费樱桃| 日本 国产 欧美色综合| 97se亚洲国产综合自在线观| 日韩精品一区二区三区视频在线观看 | 在线观看欧美黄色| 成人免费在线观看入口| 国产成人免费高清| 久久亚区不卡日本| 国内成人免费视频| 欧美不卡在线视频| 黑人精品欧美一区二区蜜桃| 91精品国产综合久久精品| 午夜精品免费在线| 91色乱码一区二区三区| 亚洲一区二区三区四区五区中文| 成人精品视频.| 亚洲人成亚洲人成在线观看图片| 成人综合婷婷国产精品久久免费| 精品国产乱码久久久久久牛牛| 久久99精品国产麻豆不卡| 精品国产免费人成电影在线观看四季| 日韩精品亚洲专区| 久久久精品免费网站| 99国产精品99久久久久久| 亚洲美女一区二区三区| 欧美日韩国产a| 国产乱色国产精品免费视频| 国产色产综合产在线视频| 日本二三区不卡| 免费成人美女在线观看| 国产精品免费aⅴ片在线观看| 不卡的av在线| 蜜桃久久久久久| 一区在线观看视频| 精品福利一区二区三区| 92精品国产成人观看免费| 午夜激情久久久| 中文字幕中文字幕在线一区 | 国产精品一区三区| 亚洲成人综合在线| 中文字幕一区二区三区在线不卡| 欧美日韩亚洲国产综合| 成人av在线一区二区| 精品一区二区三区视频| 一区二区三区中文在线| 国产亚洲一二三区| 日韩欧美国产1| 欧美日韩亚洲另类| 99久久精品国产导航| 国产在线看一区| 麻豆一区二区在线| 久久精品国产精品青草| 婷婷一区二区三区| 亚洲一区二区视频在线| 中文字幕一区二区三区不卡 | 色综合色狠狠天天综合色| av午夜精品一区二区三区| 国产盗摄一区二区三区| 国产一区美女在线| 国产一区二区伦理| 国产成人免费在线观看| 粉嫩久久99精品久久久久久夜 | 中文字幕+乱码+中文字幕一区| 久久久精品国产免费观看同学| 久久综合精品国产一区二区三区| 精品少妇一区二区三区视频免付费| 欧美大胆一级视频| 久久青草欧美一区二区三区| 中文字幕乱码亚洲精品一区| 日韩一区欧美小说| 午夜精品在线视频一区| 精品一区二区三区欧美| 国产酒店精品激情| 色综合网站在线| 欧美电视剧免费全集观看| 国产精品污www在线观看| 亚洲激情六月丁香| 黄色小说综合网站| 色综合天天综合色综合av | 欧美美女视频在线观看| 久久精品亚洲精品国产欧美| 亚洲欧美成aⅴ人在线观看| 人人精品人人爱| 色香蕉久久蜜桃| 久久久一区二区| 人人爽香蕉精品| 欧美日韩在线播放一区| 国产精品免费久久| 国产一区二区精品久久99|