public class LiveBeansView extends ObjectSE implements LiveBeansViewMBean, ApplicationContextAware
ApplicationContext
(ローカル LiveBeansView
Bean 定義を持つ)またはすべての登録済み ApplicationContexts("spring.liveBeansView.mbeanDomain" 環境プロパティによって駆動される)から現在の Bean とそれらの依存関係のスナップショットを作成します。メモ: この機能はまだベータ版であり、主に Eclipse Spring Tool Suite 3.1 以降で使用するように設計されています。
getSnapshotAsJson()
, LiveBeansViewServlet
修飾子と型 | フィールドと説明 |
---|---|
static StringSE | MBEAN_APPLICATION_KEY MBean アプリケーションキー。 |
static StringSE | MBEAN_DOMAIN_PROPERTY_NAME 「MBean ドメイン」プロパティ名。 |
コンストラクターと説明 |
---|
LiveBeansView() |
修飾子と型 | メソッドと説明 |
---|---|
protected SetSE<ConfigurableApplicationContext> | findApplicationContexts() 現在のアプリケーションに適用可能なすべての ApplicationContexts を見つけます。 |
protected StringSE | generateJson(SetSE<ConfigurableApplicationContext> contexts) 指定された ApplicationContexts の Bean の JSON スナップショットを実際に生成します。 |
protected StringSE | getEscapedResourceDescription(BeanDefinition bd) 指定された Bean 定義のリソースの説明を決定し、それに基本的な JSON エスケープ(バックスラッシュ、二重引用符)を適用します。 |
StringSE | getSnapshotAsJson() 現在の Bean とその依存関係の JSON スナップショットを生成し、アクティブな ApplicationContexts から findApplicationContexts() をすべて見つけてから、generateJson(java.util.Set) に委譲します。 |
protected boolean | isBeanEligible(StringSE beanName, BeanDefinition bd, ConfigurableBeanFactory bf) 指定された Bean が LiveBeansView JSON スナップショットに含める資格があるかどうかを判別します。 |
void | setApplicationContext(ApplicationContext applicationContext) このオブジェクトが実行される ApplicationContext を設定します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static final StringSE MBEAN_DOMAIN_PROPERTY_NAME
public void setApplicationContext(ApplicationContext applicationContext)
ApplicationContextAware
通常の Bean プロパティの設定後、ただし InitializingBean.afterPropertiesSet()
またはカスタム init メソッドなどの init コールバックの前に呼び出されます。ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
、ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
および MessageSourceAware
の後に呼び出されます(該当する場合)。
ApplicationContextAware
の setApplicationContext
applicationContext
- このオブジェクトによって使用される ApplicationContext オブジェクト BeanInitializationException
public StringSE getSnapshotAsJson()
findApplicationContexts()
をすべて見つけてから、generateJson(java.util.Set)
に委譲します。LiveBeansViewMBean
の getSnapshotAsJson
protected SetSE<ConfigurableApplicationContext> findApplicationContexts()
この LiveBeansView に特定の ApplicationContext が設定されていない場合に呼び出されます。
protected StringSE generateJson(SetSE<ConfigurableApplicationContext> contexts)
この実装では、サードパーティのライブラリの依存関係を回避するために、JSON 解析ライブラリを使用しません。コンテキスト記述オブジェクトの配列を生成します。各オブジェクトには、コンテキストと親属性、Bean 記述オブジェクトがネストされた Bean 属性が含まれます。各 Bean オブジェクトには、Bean、スコープ、型、リソース属性と、現在の Bean が依存する Bean 名のネストされた配列を持つ依存関係属性が含まれています。
contexts
- ApplicationContexts のセット protected boolean isBeanEligible(StringSE beanName, BeanDefinition bd, ConfigurableBeanFactory bf)
beanName
- Bean の名前 bd
- 対応する Bean 定義 bf
- 含む Bean ファクトリ true
。それ以外の場合は false
@Nullable protected StringSE getEscapedResourceDescription(BeanDefinition bd)
bd
- リソース記述を作成する Bean 定義