クラス AbstractApplicationContextFactory
java.lang.ObjectSE
org.springframework.batch.core.configuration.support.AbstractApplicationContextFactory
- 実装されたすべてのインターフェース:
ApplicationContextFactory
、org.springframework.beans.factory.Aware
、org.springframework.context.ApplicationContextAware
- 既知の直属サブクラス
GenericApplicationContextFactory
public abstract class AbstractApplicationContextFactory
extends ObjectSE
implements ApplicationContextFactory, org.springframework.context.ApplicationContextAware
親コンテキストと作成するコンテキストへのパスを取る
ApplicationContextFactory
実装。createApplicationContext
メソッドが呼び出されると、子 ApplicationContext
が返されます。子コンテキストは、リクエストされるたびに再作成されるわけではありません。遅延して初期化され、キャッシュされます。クライアントは、不要になったときに閉じていることを確認する必要があります。パスが設定されていない場合は、常に親が返されます。コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明org.springframework.context.ConfigurableApplicationContext
指定されたパスからApplicationContext
を作成します。protected abstract org.springframework.context.ConfigurableApplicationContext
createApplicationContext
(org.springframework.context.ConfigurableApplicationContext parent, ObjectSE... resources) boolean
protected final CollectionSE<ClassSE<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>>
親からコンテキストにコピーする必要がある Bean ファクトリポストプロセッサークラスのリストへの保護されたアクセス。int
hashCode()
protected final boolean
構成を親コンテキストからコピーする必要があるかどうかを決定するフラグへのサブクラスの保護されたアクセス。protected void
prepareBeanFactory
(org.springframework.beans.factory.config.ConfigurableListableBeanFactory parent, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) リフレッシュの前に Bean ファクトリでより複雑なことをしたい特別なサブクラスの拡張ポイント。protected void
prepareContext
(org.springframework.context.ConfigurableApplicationContext parent, org.springframework.context.ConfigurableApplicationContext context) リフレッシュの前にコンテキストを使用してより複雑なことを実行する特別なサブクラスの拡張ポイント。void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) 親アプリケーションコンテキストの Setter。void
setBeanFactoryPostProcessorClasses
(ClassSE<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses) 親コンテキストからコピーする必要がある Bean ファクトリポストプロセッサー (プロパティプレースホルダーなど) を決定します。void
setBeanPostProcessorExcludeClasses
(ClassSE<?>[] beanPostProcessorExcludeClasses) 親コンテキストからどの Bean ポストプロセッサーをコピーするかを除外して決定します。void
setCopyConfiguration
(boolean copyConfiguration) Bean ポストプロセッサーやカスタムエディターなどの設定を親コンテキストからコピーする必要があることを示すフラグ。toString()
コンストラクターの詳細
AbstractApplicationContextFactory
リソースを指定してファクトリインスタンスを作成します。リソースは、Spring 構成ファイル、または構成ファイルを含む Java パッケージです。- パラメーター:
resource
- ApplicationContext の作成に使用されるリソース。
メソッドの詳細
setCopyConfiguration
public void setCopyConfiguration(boolean copyConfiguration) Bean ポストプロセッサーやカスタムエディターなどの設定を親コンテキストからコピーする必要があることを示すフラグ。デフォルトはtrue
です。- パラメーター:
copyConfiguration
- 設定するフラグ値
isCopyConfiguration
protected final boolean isCopyConfiguration()構成を親コンテキストからコピーする必要があるかどうかを決定するフラグへのサブクラスの保護されたアクセス。- 戻り値:
- フラグ値
setBeanFactoryPostProcessorClasses
public void setBeanFactoryPostProcessorClasses(ClassSE<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses) 親コンテキストからコピーする必要がある Bean ファクトリポストプロセッサー (プロパティプレースホルダーなど) を決定します。デフォルトはPropertySourcesPlaceholderConfigurer
およびCustomEditorConfigurer
です。- パラメーター:
beanFactoryPostProcessorClasses
- コピーされるポストプロセッサー型の配列
setBeanPostProcessorExcludeClasses
親コンテキストからどの Bean ポストプロセッサーをコピーするかを除外して決定します。デフォルトはBeanFactoryAware
です (そのため、親 Bean ファクトリへの参照を持つポストプロセッサーは子にコピーされません)。これらのクラス自体がBeanPostProcessor
実装またはサブインターフェースである必要はないことに注意してください。- パラメーター:
beanPostProcessorExcludeClasses
- 設定するクラス
getBeanFactoryPostProcessorClasses
protected final CollectionSE<ClassSE<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>> getBeanFactoryPostProcessorClasses()親からコンテキストにコピーする必要がある Bean ファクトリポストプロセッサークラスのリストへの保護されたアクセス。- 戻り値:
- コピーにノミネートされたポストプロセッサーのクラス
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException 親アプリケーションコンテキストの Setter。- 次で指定:
- インターフェース
org.springframework.context.ApplicationContextAware
のsetApplicationContext
- 例外:
org.springframework.beans.BeansException
- 関連事項:
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
createApplicationContext
public org.springframework.context.ConfigurableApplicationContext createApplicationContext()指定されたパスからApplicationContext
を作成します。createApplicationContext
protected abstract org.springframework.context.ConfigurableApplicationContext createApplicationContext(org.springframework.context.ConfigurableApplicationContext parent, ObjectSE... resources) prepareContext
protected void prepareContext(org.springframework.context.ConfigurableApplicationContext parent, org.springframework.context.ConfigurableApplicationContext context) リフレッシュの前にコンテキストを使用してより複雑なことを実行する特別なサブクラスの拡張ポイント。デフォルトの実装は何もしません。- パラメーター:
parent
- 新しいアプリケーションコンテキストの親context
- リフレッシュされる前であるが、Bean ファクトリが初期化された後の新しいアプリケーションコンテキスト- 関連事項:
prepareBeanFactory
protected void prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory parent, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) リフレッシュの前に Bean ファクトリでより複雑なことをしたい特別なサブクラスの拡張ポイント。デフォルトの実装では、flag
セットに従って、親からすべての構成をコピーします。- パラメーター:
parent
- 新しいコンテキストの親 Bean ファクトリ (null にすることはできません)beanFactory
- Bean 定義がロードされる前の新しい Bean ファクトリ- 関連事項:
setCopyConfiguration(boolean)
DefaultListableBeanFactory.copyConfigurationFrom(ConfigurableBeanFactory)
toString
hashCode
public int hashCode()equals