Các hướng dẫn tham khảo các báo cáo:
Nếu tùy miền được tìm thấy trong các tập tin JAR trong khi cài đặt/modules thư mục khi tiểu mục tạo tên miền được chạy, tùy biến được xử lý. Tùy biến tên miền là lớp triển khai giao diện DomainInitializer.
Tôi không tìm thấy tài liệu về tùy chỉnh nhưng dựa trên nguồn tôi có thể tìm ra rằng công cụ khởi tạo tên miền được sử dụng để tùy chỉnh domain.xml trong khi tạo tên miền.
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);
}
Bạn có thể tìm nguồn here.
phương thức getInitialConfig
trả về phiên bản Container
. giao diện Container
mở rộng giao diện org.jvnet.hk2.config.ConfigBeanProxy
đó dường như là một proxy để Dom
lớp:
/**
* 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 {
tôi tìm ra rằng hk2 là chìa khóa để hiểu làm thế nào tùy miền hoạt động.
Tôi hy vọng người khác có thể cung cấp cho bạn một số thông tin hữu ích hơn.