2012-07-26 26 views
8

Tôi nhìn thấy thông báo log này khi sử dụng lệnh tạo miền với GlassFish 3.1.1Trình khởi tạo miền GlassFish 3.1.x là gì?

No domain initializers found, bypassing customization step 

gì có thể được thực hiện với initializers miền? Có tài liệu nào không?

Ví dụ về tạo tên miền tập quán với sản lượng khai thác gỗ được hiển thị ở đây,

http://docs.oracle.com/cd/E18930_01/html/821-2433/create-domain-1.html

Trả lời

4

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.

Các vấn đề liên quan