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

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

?? abstractenterprisebean.java

?? spring framework 2.5.4源代碼
?? JAVA
字號:
/*
 * Copyright 2002-2007 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.support;

import javax.ejb.EnterpriseBean;

import org.springframework.beans.BeansException;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.access.BeanFactoryLocator;
import org.springframework.beans.factory.access.BeanFactoryReference;
import org.springframework.context.access.ContextJndiBeanFactoryLocator;
import org.springframework.util.WeakReferenceMonitor;

/**
 * Base class for Spring-based EJB 2.x beans. Not intended for direct subclassing:
 * Extend {@link AbstractStatelessSessionBean}, {@link AbstractStatefulSessionBean}
 * or {@link AbstractMessageDrivenBean} instead.
 *
 * <p>Provides a standard way of loading a Spring BeanFactory. Subclasses act as a
 * facade, with the business logic deferred to beans in the BeanFactory. Default
 * is to use a {@link org.springframework.context.access.ContextJndiBeanFactoryLocator},
 * which will initialize an XML ApplicationContext from the class path (based on a JNDI
 * name specified). For a different locator strategy, <code>setBeanFactoryLocator</code>
 * may be called (<i>before</i> your EJB's <code>ejbCreate</code> method is invoked,
 * e.g. in <code>setSessionContext</code>). For use of a shared ApplicationContext between
 * multiple EJBs, where the container class loader setup supports this visibility, you may
 * instead use a {@link org.springframework.context.access.ContextSingletonBeanFactoryLocator}.
 * Alternatively, {@link #setBeanFactoryLocator} may be called with a custom implementation
 * of the {@link org.springframework.beans.factory.access.BeanFactoryLocator} interface.
 *
 * <p>Note that we cannot use <code>final</code> for our implementation of EJB lifecycle
 * methods, as this would violate the EJB specification.
 *
 * @author Rod Johnson
 * @author Colin Sampaleanu
 * @author Juergen Hoeller
 * @see org.springframework.context.access.ContextJndiBeanFactoryLocator
 * @see org.springframework.context.access.ContextSingletonBeanFactoryLocator
 */
public abstract class AbstractEnterpriseBean implements EnterpriseBean {

	public static final String BEAN_FACTORY_PATH_ENVIRONMENT_KEY = "java:comp/env/ejb/BeanFactoryPath";


	/**
	 * Helper strategy that knows how to locate a Spring BeanFactory (or
	 * ApplicationContext).
	 */
	private BeanFactoryLocator beanFactoryLocator;

	/** factoryKey to be used with BeanFactoryLocator */
	private String beanFactoryLocatorKey;

	/** Spring BeanFactory that provides the namespace for this EJB */
	private BeanFactoryReference beanFactoryReference;


	/**
	 * Set the BeanFactoryLocator to use for this EJB. Default is a
	 * ContextJndiBeanFactoryLocator.
	 * <p>Can be invoked before loadBeanFactory, for example in constructor or
	 * setSessionContext if you want to override the default locator.
	 * <p>Note that the BeanFactory is automatically loaded by the <code>ejbCreate</code>
	 * implementations of AbstractStatelessSessionBean and
	 * AbstractMessageDriverBean but needs to be explicitly loaded in custom
	 * AbstractStatefulSessionBean <code>ejbCreate</code> methods.
	 * @see AbstractStatelessSessionBean#ejbCreate
	 * @see AbstractMessageDrivenBean#ejbCreate
	 * @see AbstractStatefulSessionBean#loadBeanFactory
	 * @see org.springframework.context.access.ContextJndiBeanFactoryLocator
	 */
	public void setBeanFactoryLocator(BeanFactoryLocator beanFactoryLocator) {
		this.beanFactoryLocator = beanFactoryLocator;
	}

	/**
	 * Set the bean factory locator key.
	 * <p>In case of the default BeanFactoryLocator implementation,
	 * ContextJndiBeanFactoryLocator, this is the JNDI path. The default value
	 * of this property is "java:comp/env/ejb/BeanFactoryPath".
	 * <p>Can be invoked before {@link #loadBeanFactory}, for example in the constructor
	 * or <code>setSessionContext</code> if you want to override the default locator key.
	 * @see #BEAN_FACTORY_PATH_ENVIRONMENT_KEY
	 */
	public void setBeanFactoryLocatorKey(String factoryKey) {
		this.beanFactoryLocatorKey = factoryKey;
	}

	/**
	 * Load a Spring BeanFactory namespace. Subclasses must invoke this method.
	 * <p>Package-visible as it shouldn't be called directly by user-created
	 * subclasses.
	 * @see org.springframework.ejb.support.AbstractStatelessSessionBean#ejbCreate()
	 */
	void loadBeanFactory() throws BeansException {
		if (this.beanFactoryLocator == null) {
			this.beanFactoryLocator = new ContextJndiBeanFactoryLocator();
		}
		if (this.beanFactoryLocatorKey == null) {
			this.beanFactoryLocatorKey = BEAN_FACTORY_PATH_ENVIRONMENT_KEY;
		}

		this.beanFactoryReference = this.beanFactoryLocator.useBeanFactory(this.beanFactoryLocatorKey);

		// We cannot rely on the container to call ejbRemove() (it's skipped in
		// the case of system exceptions), so ensure the the bean factory
		// reference is eventually released.
		WeakReferenceMonitor.monitor(this, new BeanFactoryReferenceReleaseListener(this.beanFactoryReference));
	}

	/**
	 * Unload the Spring BeanFactory instance. The default {@link #ejbRemove()}
	 * method invokes this method, but subclasses which override <code>ejbRemove()</code>
	 * must invoke this method themselves.
	 * <p>Package-visible as it shouldn't be called directly by user-created
	 * subclasses.
	 */
	void unloadBeanFactory() throws FatalBeanException {
		// We will not ever get here if the container skips calling ejbRemove(),
		// but the WeakReferenceMonitor will still clean up (later) in that case.
		if (this.beanFactoryReference != null) {
			this.beanFactoryReference.release();
			this.beanFactoryReference = null;
		}
	}

	/**
	 * May be called after <code>ejbCreate()</code>.
	 * @return the bean factory
	 */
	protected BeanFactory getBeanFactory() {
		return this.beanFactoryReference.getFactory();
	}

	/**
	 * EJB lifecycle method, implemented to invoke <code>onEjbRemove()</code>
	 * and unload the BeanFactory afterwards.
	 * <p>Don't override it (although it can't be made final): code your shutdown
	 * in {@link #onEjbRemove()}.
	 */
	public void ejbRemove() {
		onEjbRemove();
		unloadBeanFactory();
	}

	/**
	 * Subclasses must implement this method to do any initialization they would
	 * otherwise have done in an <code>ejbRemove()</code> method.
	 * The BeanFactory will be unloaded afterwards.
	 * <p>This implementation is empty, to be overridden in subclasses.
	 * The same restrictions apply to the work of this method as to an
	 * <code>ejbRemove()<code> method.
	 */
	protected void onEjbRemove() {
		// empty
	}


	/**
	 * Implementation of WeakReferenceMonitor's ReleaseListener callback interface.
	 * Release the given BeanFactoryReference if the monitor detects that there
	 * are no strong references to the handle anymore.
	 */
	private static class BeanFactoryReferenceReleaseListener implements WeakReferenceMonitor.ReleaseListener {

		private final BeanFactoryReference beanFactoryReference;

		public BeanFactoryReferenceReleaseListener(BeanFactoryReference beanFactoryReference) {
			this.beanFactoryReference = beanFactoryReference;
		}

		public void released() {
			this.beanFactoryReference.release();
		}
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆91小视频| 国产欧美一区二区在线观看| 国产亚洲一区字幕| 午夜伦理一区二区| 国产精品一区二区三区99| 欧美综合欧美视频| 欧美丰满嫩嫩电影| 一区二区三区 在线观看视频| 久久精品国产精品青草| 一本色道亚洲精品aⅴ| 久久久久久9999| 亚洲成人第一页| 成人动漫精品一区二区| 欧美另类变人与禽xxxxx| 亚洲视频一二三区| 国模一区二区三区白浆| 欧美天天综合网| 成人免费在线播放视频| 国内精品免费在线观看| 欧美日韩久久久| 精品国产一区二区三区忘忧草| 亚洲一区二区欧美| 99精品一区二区| 欧美国产精品中文字幕| 老司机免费视频一区二区| 欧美色图第一页| 综合av第一页| 日本不卡一区二区三区| 亚洲欧洲日本在线| 韩国中文字幕2020精品| 久久久久久夜精品精品免费| 麻豆精品蜜桃视频网站| 欧美一级片免费看| 午夜精品影院在线观看| 欧美视频日韩视频在线观看| 亚洲国产美国国产综合一区二区| 色婷婷一区二区| 久久精品国产99久久6| 亚洲成精国产精品女| 国内久久精品视频| 欧美一区二区大片| 亚洲bt欧美bt精品| 欧美日韩国产另类不卡| 亚洲青青青在线视频| 成人综合在线网站| 欧美国产1区2区| 国产成人精品一区二| 国产在线国偷精品免费看| 精品国产123| 乱中年女人伦av一区二区| 欧美日韩电影在线| 亚洲小少妇裸体bbw| 在线观看欧美精品| 亚洲小少妇裸体bbw| 欧美日韩国产首页在线观看| 日本午夜一区二区| 日韩欧美卡一卡二| 九色综合狠狠综合久久| 久久影音资源网| 国产九色精品成人porny| 欧美国产精品久久| 高清视频一区二区| 久久精品视频在线免费观看| 精品一区二区三区的国产在线播放| 日韩三级.com| 毛片av一区二区三区| 国产亚洲一区字幕| 成人免费看片app下载| 国产精品国产a| 国产成人精品亚洲777人妖| 国产人妖乱国产精品人妖| 丁香六月久久综合狠狠色| 国产亚洲人成网站| 91色.com| 一区二区三区四区中文字幕| 欧美性大战久久久久久久蜜臀| 亚洲成av人片在线观看无码| 欧美一级片在线看| 成人午夜精品在线| 亚洲天堂av一区| 欧美网站一区二区| 国产乱人伦偷精品视频不卡| 国产欧美一区在线| 色综合欧美在线| 中文字幕在线不卡| 一区二区日韩电影| 欧美喷潮久久久xxxxx| 免费成人小视频| 久久久国产精品不卡| 色综合久久综合| 亚洲成人免费观看| 精品久久久久久无| 99久久婷婷国产精品综合| 亚洲精品免费一二三区| 亚洲激情中文1区| 日韩欧美激情在线| 国产成人精品午夜视频免费| 日韩美女啊v在线免费观看| 欧美视频在线一区| 久久99久久99精品免视看婷婷| 精品三级av在线| 91丨国产丨九色丨pron| 午夜精品成人在线视频| 一区二区国产视频| 91精品欧美久久久久久动漫| 国产一区 二区 三区一级| 亚洲一区视频在线观看视频| www成人在线观看| 色视频成人在线观看免| 国产一区二区91| 亚洲最色的网站| 91麻豆精品国产91久久久| www.欧美日韩| 美国av一区二区| 亚洲国产综合在线| 久久久精品国产免大香伊 | 亚洲第一会所有码转帖| 欧美专区日韩专区| 国产很黄免费观看久久| 亚洲国产视频直播| 日韩欧美亚洲国产另类| 色94色欧美sute亚洲线路一ni| 蜜桃精品视频在线观看| 日本一区二区三区在线不卡| 欧美肥妇毛茸茸| 99精品久久久久久| 蜜臀av性久久久久蜜臀aⅴ四虎| 一区二区在线观看免费视频播放| 精品少妇一区二区三区日产乱码 | 麻豆精品一区二区| 亚洲精品免费在线观看| 国产午夜精品在线观看| 欧美变态口味重另类| 欧美在线一二三| 成人午夜电影网站| 精品一区二区三区在线播放 | 精品国产乱码91久久久久久网站| 懂色av一区二区三区免费看| 成人福利电影精品一区二区在线观看| 国产欧美一区二区在线观看| 国产成人自拍高清视频在线免费播放| 国产精品成人一区二区三区夜夜夜| 久久九九久精品国产免费直播| 777xxx欧美| 色综合久久久久久久| 国产清纯白嫩初高生在线观看91| 欧美一区二区在线免费观看| 一本大道综合伊人精品热热| 亚洲欧洲av一区二区三区久久| 青青青伊人色综合久久| 欧美精品色一区二区三区| 亚洲国产成人91porn| 99v久久综合狠狠综合久久| 精品久久久久久无| 日韩av中文在线观看| jlzzjlzz亚洲日本少妇| 26uuu国产电影一区二区| 免费在线观看日韩欧美| 欧美人与性动xxxx| 日韩av一区二| 亚洲国产精品传媒在线观看| 91网站在线播放| 成人h动漫精品| 国产麻豆日韩欧美久久| 精品写真视频在线观看| 精品无码三级在线观看视频| 美女一区二区在线观看| 男女激情视频一区| 激情图区综合网| 777奇米四色成人影色区| 欧美久久久影院| 欧美日韩一区在线| 欧美日韩免费视频| 岛国精品在线观看| 国产99一区视频免费| jizz一区二区| 在线观看欧美黄色| 欧美一区三区四区| 久久久久九九视频| 中文字幕制服丝袜一区二区三区| √…a在线天堂一区| 夜夜嗨av一区二区三区中文字幕| 亚洲成a人在线观看| 精品一区二区在线看| 大白屁股一区二区视频| 色av一区二区| 欧美一二三四在线| 欧美激情一区在线| 亚洲精品欧美专区| 日本成人在线一区| 国产成人在线视频免费播放| 波多野结衣精品在线| 欧美在线影院一区二区| 欧美成人性战久久| 中文字幕第一区二区| 亚洲国产人成综合网站| 韩国在线一区二区| 色婷婷久久一区二区三区麻豆| 欧美一区二区在线看| 国产女人aaa级久久久级 |