リファレンスマニュアルは次のように報告しています。
create-domain サブコマンドの実行時にドメイン カスタマイザが as-install/modules ディレクトリの JAR ファイルにある場合、カスタマイザは処理されます。ドメイン カスタマイザーは、DomainInitializer インターフェイスを実装するクラスです。
カスタマイズに関するドキュメントは見つかりませんでしたが、ソースに基づいて、ドメインの作成中に domain.xml をカスタマイズするためにドメイン初期化子が使用されていることがわかります。
package org.glassfish.api.admin.config;
import org.jvnet.hk2.annotations.Contract;
import org.glassfish.api.admin.config.Container;
/**
* Marker interface to mark inhabitants that require some minimal initial
* configuration to be inserted into a newly create domain's domain.xml
*
* @author Nandini Ektare
*/
@Contract
public interface DomainInitializer {
/**
* The actual initial config that needs to be inserted into
* the fresh domain.xml
*
* See {@link Attribute#value()} for how the default value is inferred.
*
*/
public <T extends Container> T getInitialConfig(DomainContext initialCtx);
}
ここでソースを見つけることができます。
getInitialConfig
メソッドはインスタンスを返しますContainer
。Container
インターフェイスはorg.jvnet.hk2.config.ConfigBeanProxy
、プロキシのように見えるインターフェイスをDom
クラスに拡張します。
/**
* Marker interface that signifies that the interface
* is meant to be used as a strongly-typed proxy to
* {@link Dom}.
*
* <p>
* To obtain the Dom object, use {@link Dom#unwrap(ConfigBeanProxy)}.
* This design allows the interfaces to be implemented by other code
* outside DOM more easily.
*
* @author Kohsuke Kawaguchi
* @see Dom#unwrap(ConfigBeanProxy)
* @see DuckTyped
* @see Element
* @see Attribute
*/
public interface ConfigBeanProxy {
hk2は、ドメインのカスタマイズがどのように機能するかを理解するための鍵であることがわかりました。
他の誰かがあなたにもっと有益な情報を提供できることを願っています。