|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IJavaComponent
Client interface of a Java component. I.e. any Java component provides an implementation of this interface when looked up.
A Java component is declared by using the component type com.zfabrik.java (see also IComponentDescriptor.COMPONENT_TYPE)
Java components generally serve Java type definitions to other components, for example Web applications.
One important defaulting mechanism applies to Java components: By convention, other component types that require or support an implementation, for example a Web application will use JavaComponentUtil to
identify a Java component that is used to load types from. Given a project com.acme.myproject, the default Java component to look for is com.acme.myproject/java, i.e. the
project name with an appended "/java". Components within the project use the private loader of that Java component by convention.
See also IComponentsRepository for a typical component repository layout.
In most cases Java components do hold Java resources, e.g. Java source files or JAR libraries. In some cases all types required are provided elsewhere, so that the project itself does not hold any Java resources. In that case a Java component does not require a folder structure but may be specified only a set of properties defining references to other Java components.
The folder structure of Java components assigns meaning to the following folders:
com.zfabrik.component.type=com.zfabrik.java java.publicReferences=<java component 1>, <java component 2>,... java.privateReferences=<java component n>, <java component n+1>,...
PUBREFS..class files and other resources to be added to the public types of the Java Component.PRIREFS..class files and other resources to be added to the private types of the Java Component.Foundation.MODE is set to "development"..class files and other resources to be added to the private types of the Java Component iff running in development mode.
Java components may "include" components of type com.zfabrik.files. This can be useful for libraries that cannot be shared by
just re-using the classes but instead require to be used within the using component's context, e.g. to load classes by name that would not be within
the library's scope. This is true for older versions of the Spring framework for example.
Files components may be included as API or impl provisioning depending on the reference used. The included source files or pre-compiled binaries are expected to comply to the following folder structure:
.class files and other resourcesThe following properties can be used in the component descriptor:
Everything referenced as public reference will be visible to the public interface of the referencing component as well as to all referencing the referencing component. In other words: References are transitive. In particular, anything required to compile the public types of a Java component must be referenced via this reference property.
Components may be specified as a comma-separated list. Component names that have no "/" will be defaulted by appending "/java".
Alternatively this reference points to a com.zfabrik.files component that must have a bin folder that will be included into this java component's java resources.
The files resource may also have a src folder that will be copied befor compilation into the public interface in src.api or src.
Components may be specified as a comma-separated list. Component names that have no "/" will be defaulted by appending "/java".
Alternatively this reference points to a com.zfabrik.files component that must have a bin folder that will be included into this java component's java resources.
The files resource may also have a src folder that will be copied befor compilation into the public interface in src.impl or private/src.
src.test, bin.test. When not running in development
mode, this setting will be ignored.
true as the value of this component property will be ignored by the compilation mechanism (as it will be in javadoc generation).
scala.
This property can be omitted for pure java components, otherwise one has to define all compilers in the right order - e.g: scala, java
| Field Summary | |
|---|---|
static java.lang.String |
COMPILE_ORDER
The compile order must be defined in java components that also contain non-java sources - e.g. |
static java.lang.String |
NOBUILD
A Java component specifying true as the value of this component property will be ignored by the compilation mechanism (as it will be in javadoc generation). |
static java.lang.String |
PRIINCS
Points to com.zfabrik.files or com.zfabrik.java components that must have a bin (or alternatively a bin.api, for Java components) folder that will be included into this java component's private java resources. |
static java.lang.String |
PRIREFS
Points to another java component whose public types will be shared with this one (and maybe others) Nothing referenced as private reference will be automatically exposed to the public interface of the referencing component nor to other components. |
static java.lang.String |
PUBINCS
Points to com.zfabrik.files or com.zfabrik.java components that must have a bin (or alternatively a bin.api, for Java components) folder that will be included into this java component's public java resources. |
static java.lang.String |
PUBREFS
Points to another java component whose public types will be shared with this one (and maybe others). |
static java.lang.String |
TESTINCS
Points to com.zfabrik.files or com.zfabrik.java components that must have a bin (or alternatively a bin.api, for Java components) folder that will be included into this java component's test java resources. |
static java.lang.String |
TESTREFS
Points to another java component whose public types will be shared with this one (and maybe others) if the execution mode, as defined by the system property Foundation.MODE
is set to "development". |
static java.lang.String |
TYPE_NAME
Type constant for Java components. |
| Method Summary | |
|---|---|
JavaComponentClassLoader |
getPrivateLoader()
Retrieve the private implementation's loader of this Java component. |
JavaComponentClassLoader |
getPublicLoader()
Retrieve the public interface's loader of this Java component. |
| Field Detail |
|---|
static final java.lang.String TYPE_NAME
IComponentDescriptor.COMPONENT_TYPE,
Constant Field Valuesstatic final java.lang.String PUBREFS
Everything referenced as public reference will be visible to the public interface of the referencing component as well as to all referencing the referencing component. In other words: References are transitive. In particular, anything required to compile the public types of a Java component must be referenced via this reference property.
Components may be specified as a comma-separated list. Component names that have no "/" will be defaulted by appending "/java".
JavaComponentUtil.fixJavaComponentName(String),
Constant Field Valuesstatic final java.lang.String PUBINCS
com.zfabrik.files or com.zfabrik.java components that must have a bin (or alternatively a bin.api, for Java components) folder that will be included into this java component's public java resources.
The component may also have a src (or alternatively src.api, for Java components) folder that will be copied before compilation into src.api.
static final java.lang.String PRIREFS
Components may be specified as a comma-separated list. Component names that have no "/" will be defaulted by appending "/java".
JavaComponentUtil.fixJavaComponentName(String),
Constant Field Valuesstatic final java.lang.String PRIINCS
com.zfabrik.files or com.zfabrik.java components that must have a bin (or alternatively a bin.api, for Java components) folder that will be included into this java component's private java resources.
The component may also have a src (or alternatively src.api, for Java components) folder that will be copied before compilation into src.impl.
static final java.lang.String TESTREFS
Foundation.MODE
is set to "development". Test references extend the private references. In conjunction with the tests source folder this allows to add test code and corresponding dependencies
that will be ignored by the runtime unless running in development mode.
PRIREFS,
Constant Field Valuesstatic final java.lang.String TESTINCS
com.zfabrik.files or com.zfabrik.java components that must have a bin (or alternatively a bin.api, for Java components) folder that will be included into this java component's test java resources.
The component may also have a src (or alternatively src.api, for Java components) folder that will be copied before compilation into src.test.
static final java.lang.String NOBUILD
true as the value of this component property will be ignored by the compilation mechanism (as it will be in javadoc generation).
static final java.lang.String COMPILE_ORDER
scala.
This property can be omitted for pure java components, otherwise one has to define all compilers in the right order - e.g: scala, java
| Method Detail |
|---|
JavaComponentClassLoader getPrivateLoader()
JavaComponentClassLoader getPublicLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||