|
Core Development Guide |
This chapter describes the kinds of applications you can build with Director and gives an overview of the architecture of a Director application. It contains the following sections:
A Director application is packaged in a single Director EAR file that contains several WAR files and JAR files. You can create the EAR by running the Director EAR Wizard in SilverStream eXtend Workbench. The wizard lets you select the subsystems you want to use and specify configuration properties for these subsystems. After you've finished making your selections, the wizard creates an EAR project that includes the J2EE modules you need for your application.
At the top level of the EAR, you will see several WAR files. Some of these (such as PAC.war, PMC.war, and the WAR for your custom Web application with portal functionality) are prepackaged Web applications that can be modified or deployed as is. These can be thought of as Web tiers. Others (such as Boot.war and ResourceSet.war) are supporting WARs required for the Director application architecture. In addition to the Web tiers and supporting WARs, you will also see one or more service WARs, which are WARs that provide subsystem services. ContentMgmtService.war and WebDAVService.war are examples of service WARs.
Under the library folder, you will see several service JAR files. These JARs contain classes that provide core services for a Director application.
Once you've run the Director EAR Wizard, you can add additional custom Web applications or other application-specific J2EE modules to the EAR. You can also add or remove subsystems, or make any other necessary changes to the structure and content of the EAR, just as you would with any J2EE application.
When you're ready to deploy the application, you can use the facilities provided with Workbench to upload the EAR to one or more servers.
For details on using the Director EAR wizard, see
Configuring a Director Application.
The J2EE specification does not require the EAR name to be part of the context for a WAR file. This can be problematic when multiple EAR files with similar content are deployed to the same server. For example, if you deploy the PAC in several different EAR files to the same server, the application server will not be able to distinguish the different versions of the PAC. Director introduces the notion of EAR namespacing to solve this problem. The namespace is part of the URL for accessing the Director Web tiers and custom Web applications.
When you run the Director EAR Wizard in Workbench, you can specify that EAR namespacing be enabled in the project. To implement namespacing, Director prefaces the context for each WAR with the namespace you specify. The context for each WAR is specified in the application.xml file for the EAR. The Director EAR Wizard uses the name assigned to the EAR as the default namespace.
For example, suppose you enable namespacing for an EAR and specify a namespace of MyEAR. Each module section in application.xml has a context-root element that prepends the namespace to the WAR name. The module section for the Content Management subsystem would look like this:
<module> <web> <web-uri>ContentMgmtService.war</web-uri> <context-root>/MyEAR/ContentMgmtService</context-root> </web> </module>
Other subsystems would have similar context-root entries.
When you deploy this EAR, you can use URLs like these to access the Director Web tiers (PAC and PMC):
http://localhost/MyEAR/PAC/main http://localhost/MyEAR/PMC/main
NOTE On a SilverStream server, if you deploy to a database other than SilverMaster, the URL would also include the database name.
A WAR file can access classes in a JAR file that is contained within that WAR, as well as classes in a JAR file that is placed outside the WAR in some other location within the EAR. Director applications take advantage of both of these configurations.
Classpath for WAR When a WAR file uses the services of a JAR file within the WAR, the classes in the WAR have no difficulty locating the classes in the JAR, since these classes are automatically included in the WAR's classloading environment. However, when a WAR file uses the services of a JAR file that is located outside the WAR, the JAR must be added to the classpath for the WAR. J2EE applications do this by setting the classpath in the MANIFEST.MF file in the META-INF directory within the WAR. For example, the MANIFEST.MF file for the Portal.war file includes several JAR files that are located in the library directory within the EAR:
Manifest-Version: 1.0 Created-By: 1.3.0(SilverStream Software) Class-Path: library/PortalService.jar library/ContentMgmtService.jar library/FrameworkService.jar library/SecurityService.jar library/DirectoryService.jar library/UserService.jar library/WorkflowService.jar library/RuleService.jar library/DirectoryServiceRealm.jar library/xalan.jar library/xerces.jar
Classpath for Framework Director applications also maintain a simulated classpath for the Framework, which allows the classes in the Framework to find classes in the other subsystem JAR files that have been included with a particular Director EAR configuration. For more information about the simulated classpath, see About the subsystems.xml file and the simulated classpath.
The WAR files and JAR files in the Director EAR contain standard J2EE objects such as:
In addition to these standard J2EE items, Director applications can also include these objects:
A Director EAR typically includes the WAR files that contain the administrative Web tiers:
|
WAR file |
Description |
|---|---|
|
PAC.war |
Contains the PAC Web tier |
|
PMC.war |
Contains the PMC Web tier |
A Director EAR typically includes one or more of the following WAR files, which provide additional services:
A Director EAR typically includes one or more WAR files that contain the code and resources for your application(s).
Each Director subsystem has one or more archive files associated with it. The archive files conform to the following naming convention:
Often a subsystem will be deployed in its entirety. However, Director allows you to deploy the archive files separately. For example, you might deploy the UserService.jar file without including the UserTag.jar, UserEjb.jar,and UserClient.jar files.
The following table indicates which archive files are available for each Director subsystem:
The following table outlines the interdependencies among the Director subsystems.
Several additional archive files are required for the successful execution of Director applications. These are considered dependencies of all the major services:
Like the DirectoryServiceRealm.jar, these modules are delivered in the /library directory of the Director EAR project. Most manifest files (META-INF/MANIFEST.MF) have these modules listed as dependencies.
The Director EAR Wizard and Setup Wizard enforce these dependencies. If you include a subsystem that depends on others, those other subsystems are also included in your project. If you try to remove a subsystem that others depend on, the Setup Wizard forces you to remove the dependent subsystems first before you can remove the subsystem they depend on.
To make its services available, a subsystem must register itself with the framework. The process of self-registration involves loading configuration and service information into the framework. Once this information has been loaded, the appropriate factories can produce the correct implementations for each requested service. The registration process is initiated by the Boot servlet, which starts up automatically when you deploy a Director EAR or restart the application server. The Boot servlet is contained within the Boot.war file. It is an autostart servlet that must be the first servlet to load within a Director EAR.
Boot process During the framework boot process, the Boot servlet starts up the base factory for the framework, which performs these operations:
Reads the config.xml file for each subsystem into the framework's memory space.
The config.xml file sets the configuration properties for a subsystem. It is typically located in the subsystem-name-conf subdirectory of the subsystem-nameService.jar file for the subsystem. For example, the Portal subsystem has a config.xml file in the PortalService-conf subdirectory of the PortalService.jar file.
In the case of the Web tier WAR files, the config.xml is located in the conf subdirectory of WEB-INF.
Performs any database processing required for each subsystem. For each subsystem that needs to load data into a database, the base factory creates the schema and loads the data, if necessary.
Each subsystem that requires database processing delivers scripts for creating the schema and loading the data. These scripts are located in the database subdirectory of the subsystem-name-conf subdirectory of the subsystem-nameService.jar file for the subsystem. For example, the Directory subsystem includes several database scripts in the DirectoryService-conf subdirectory of the DirectoryService.jar file.
For more information about how the subsystems perform database processing, see
How the subsystems access persistent data.
Reads the services.xml file for each subsystem into the framework's memory space.
The services.xml file sets properties for each of the services associated with a subsystem. It is located in the subsystem-name-conf subdirectory of the subsystem-nameService.jar file for the subsystem. For example, the Portal subsystem has a services.xml file in the PortalService-conf subdirectory of the PortalService.jar file.
In the case of the Web tier WAR files, the services.xml is located in the conf subdirectory of WEB-INF.
Notifies subsystem-specific service loaders that the main processing is done.
Starts all autostart services listed in services.xml files.
Autostart services have a startup property value of A (for automatic). Those services that have a startup element of M (for manual) are not started.
Messages during boot process Whenever you deploy a Director EAR or restart the application server, the server console prints out messages to inform you of the status of each step in the framework boot process:
###################################################################
###################################################################
###################################################################
### EboBaseFactory boot started
###################################################################
###################################################################
### EboBaseFactory add (config.xml) entries
###################################################################
Loading ContentMgmtService-conf/config.xml
Loading DirectoryService-conf/config.xml
Loading FrameworkService-conf/config.xml
Loading PortalService-conf/config.xml
Loading RuleService-conf/config.xml
Loading SearchService-conf/config.xml
Loading SecurityService-conf/config.xml
Loading UserService-conf/config.xml
###################################################################
### EboBaseFactory process db schema create/load
###################################################################
Initializing log named EboFwLog at logging level 3 with separator |
.....Adding log provider com.sssw.fw.log.EboStandardOutLoggingProvider to log EboFwLog
Schema exists for ContentMgmtService subsystem.
Schema exists for DirectoryService subsystem.
Schema exists for SecurityService subsystem.
Schema exists for UserService subsystem.
###################################################################
### EboBaseFactory notify custom db loaders
###################################################################
###################################################################
### EboBaseFactory add (services.xml) entries
###################################################################
Loading ContentMgmtService-conf/services.xml
with factory loader com.sssw.fw.factory.EboFactoryLoader
Loading DirectoryService-conf/services.xml
with factory loader com.sssw.fw.factory.EboFactoryLoader
Loading FrameworkService-conf/services.xml
with factory loader com.sssw.fw.factory.EboFactoryLoader
Loading PortalService-conf/services.xml
with factory loader com.sssw.fw.factory.EboFactoryLoader
Loading RuleService-conf/services.xml
with factory loader com.sssw.fw.factory.EboFactoryLoader
Loading SearchService-conf/services.xml
with factory loader com.sssw.fw.factory.EboFactoryLoader
Loading SecurityService-conf/services.xml
with factory loader com.sssw.fw.factory.EboFactoryLoader
Loading UserService-conf/services.xml
with factory loader com.sssw.fw.factory.EboFactoryLoader
###################################################################
### EboBaseFactory notify custom service loaders
###################################################################
###################################################################
### EboBaseFactory start auto-start services
###################################################################
Auto Starting
Interface : com.sssw.re.core.EboResourceListener
Service : com.sssw.re.core.EboResourceListener
Auto Starting
Interface : com.sssw.fw.security.core.EboResourceListener
Service : com.sssw.fw.security.core.EboResourceListener
Initializing log named EboSecurityLog at logging level 3 with separator |
.....Adding log provider com.sssw.fw.log.EboStandardOutLoggingProvider to log EboSecurityLog
###################################################################
### EboBaseFactory boot completed
###################################################################
###################################################################
LicenseInfo: Type: User, Version: 4.0, User: Unlimited
###################################################################
Initializing log named EboPortalLog at logging level 3 with separator |
.....Adding log provider com.sssw.fw.log.EboStandardOutLoggingProvider to log EboPortalLog
Loading resourceSet descriptor /WEB-INF/conf/resourceset.xml
Loading ResourceSet ==> PAC-ResourceSet <==, dynamicClassLoading = false, verbose = false
Loading resourceSet descriptor /WEB-INF/conf/resourceset.xml completed
Loading resourceSet descriptor /WEB-INF/conf/resourceset.xml
Loading ResourceSet ==> PMC-ResourceSet <==, dynamicClassLoading = false, verbose = false
Loading resourceSet descriptor /WEB-INF/conf/resourceset.xml completed
Loading resourceSet descriptor /WEB-INF/conf/resourceset.xml
Loading ResourceSet ==> SilverTimes-ResourceSet <==, dynamicClassLoading = true, verbose = false
Loading resourceSet descriptor /WEB-INF/conf/resourceset.xml completed
In order to read the config.xml and services.xml files during the boot process, the Boot servlet uses information in subsystems.xml, a Framework configuration file, to build a simulated classpath. The simulated classpath also enables classes in Director JARs to find classes in other JARs.
Limitations to finding classes In a J2EE application, each WAR within an EAR has its own classpath as defined by the MANIFEST.MF file. In addition, the EAR itself has its own classpath, which is separate from the classpath for each of the WARs it contains. This presents a problem when two JARs located directly within an EAR are on the classpath specified for a WAR, and a class in one of the JARs needs to access a class in the other JAR. Since J2EE does not provide a mechanism for the JAR files to discover the classpath for the WAR, another mechanism is needed to provide the classpath. The Framework addresses this problem by maintaining a simulated classpath. The simulated classpath gives the classes in the framework a way to see which JAR files may have been specified in the MANIFEST.MF file for the Boot.war file.
Correspondence of actual and simulated classpaths The Framework uses the subsystems.xml file in the FrameworkService-conf directory to determine which JAR files to include in the simulated classpath. The subsystems.xml file lists the subsystems by name:
<?xml version="1.0" encoding="UTF-8"?>
<subsystems>
<subsystem>ContentMgmtService</subsystem>
<subsystem>DirectoryService</subsystem>
<subsystem>FrameworkService</subsystem>
<subsystem>PortalService</subsystem>
<subsystem>RSSService</subsystem>
<subsystem>RuleService</subsystem>
<subsystem>SearchService</subsystem>
<subsystem>SecurityService</subsystem>
<subsystem>UserService</subsystem>
<subsystem>WorkflowService</subsystem>
</subsystems>
This list corresponds to the list of subsystem JAR files specified in the MANIFEST.MF file for the Boot.war:
Manifest-Version: 1.0
Created-By: 1.3.0(SilverStream Software)
Class-Path: library/DirectoryServiceRealm.jar
library/PortalCA.jar
library/WorkflowAL.jar
library/jakarta-regexp-1.2.jar
library/jbroker-web.jar
library/wasAuth.jar
library/xalan.jar
library/xml-apis.jar
library/PortalService.jar
library/DirectoryService.jar
library/UserService.jar
library/ContentMgmtService.jar
library/FrameworkService.jar
library/SecurityService.jar
library/SearchService.jar
library/RSSService.jar
library/RuleService.jar
library/WorkflowService.jar
Making sure the classpath is correct The subsystems.xml file lists the subsystems that may be in the classpath. If the subsystem names specified do not match the names specified in the MANIFEST.MF for the Boot.war file, the simulated classpath will not be correct. To ensure that it is correct, make sure the subsystem names specified in the subsystems.xml file exactly match the JAR file names for the subsystems specified in the MANIFEST.MF file for the Boot.war file.
The following subsystems depend on a database to store persistent information:
After the Framework Boot servlet reads the config.xml file for each subsystem, it performs any database processing required for the subsystems. The Boot servlet checks the config.xml file to determine if it needs to create the schema and load data. It does this by examining the following configuration properties:
For example, the config.xml file for the Directory subsystem has these settings for the db-load-on-startup and test-db-on-startup properties:
<property> <key>DirectoryService/db-load-on-startup</key> <value>true</value> </property> <property> <key>DirectoryService/test-db-on-startup</key> <value>AUTHGROUPS</value> </property>
When database processing is required for a subsystem, the boot servlet executes the scripts in the database subdirectory of the subsystem-name-conf subdirectory of the subsystem-nameService.jar file for the subsystem.
NOTE Do not edit the database scripts provided with the Director subsystems. These scripts should be used as is.
Director subsystems often require access to application resources that are not stored in a database or defined in the configuration and service elements for the subsystems. Resource sets provide a known location for these resources. A resource set holds definitions for rules, portal components, styles, and various descriptors that implement features provided by Director subsystems. They can also hold Java classes and images for your application.
Resource sets are also a tool for streamlining development because they can be configured to load resources from disk as well as from a deployed JAR. This dynamic loading of resources allows you to modify and test changes without having to redeploy the whole Director EAR.
Using the Resource Set in a Director Application describes how to use resource sets.
|
Core Development Guide |
Copyright © 2002, SilverStream Software, LLC, a wholly owned subsidiary of Novell, Inc. All rights reserved.