class SchemaLoad
extends java.lang.Object
The directory schema can be read from multiple input files. The main
schema (which defines the standard object classes that must always exist for
P2J) will be loaded from SYS_SCHEMA_NAME
. The J2SE method
ClassLoader.getSystemResource()
will be used to search the
classpath and load the first instance of this file. The file should be
found in the jar for P2J and it should not be modified since the P2J code
has heavy dependencies upon those definitions.
Applications may optionally add their own extensions to the directory schema.
This is done for such purposes as supporting custom security plugins using
data stored in the directory. Application schema extensions are loaded from
EXT_SCHEMA_NAME
using ClassLoader.getSystemResources()
which will return the list of all found resources. There can be more than
one, if there are enough jar files in the classpath that each contain that
file. It is valid for this file to be missing, it is completely optional.
Since there is no pathing information in either resource name, the associated files must be present in the root directory of the jar files being searched OR in the topmost directory of a path in the CLASSPATH.
This search process occurs regardless of any configuration. The core P2J schema will be read first and then any application extensions will be read. This is done very early in the initialization of the runtime environment, before the directory itself is active. The reason loading from resources is a reasonable approach is that the source code for P2J (and optionally for applications that have their own directory schema extensions) is already hard coded to the specific schema. For that reason, the schema upon which the code is dependent should be included with the code and there should be no need to require configuration in order to find it.
The format for both files is the same (see above), but the contents should generally not overlap. If the application extension specifies an object class name that is the same as one that is already defined, it will replace that object class. Please note that this is VERY DANGEROUS unless you know exactly what you are doing.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXT_SCHEMA_NAME
File name for directory schema extensions.
|
static java.lang.String[] |
required
List of object classes that must be present in the schema.
|
static java.lang.String |
SYS_SCHEMA_NAME
File name for the system directory schema.
|
Constructor and Description |
---|
SchemaLoad() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
initSchema()
Initialize the directory schema.
|
public static final java.lang.String SYS_SCHEMA_NAME
public static final java.lang.String EXT_SCHEMA_NAME
public static final java.lang.String[] required
static void initSchema() throws ConfigurationException
ConfigurationException
- in case of configuration error.