Server Assemblers Wizard
Who should read this document
The Server Assessor Wizard is written for people who want to assemble the Phoenix server application. Premise assumes that you are more familiar with the basic concepts of the Phoenix framework.
This chapter focuses on assembly, and has no special requirements for Java. It also assumes that you are more familiar with the basic principles of the server, basic security measures, and performance adjustments.
Organization in this chapter
Information is organized, each section detailed in detail one aspect of the assembly server application.
content
1. What is a server application?
2. How to create a server application?
3. Config.xml specification
4. Assembly.xml specification
5. Environment.xml specification
Avalon Document Group Written
What is a server application?
Introduction
In Phoenix, the server application is a block of blocks, which provides a unified user service. Examples of server applications include mail servers, file servers, web servers, etc. The server application is a high-level component that contains a block of Blocks components.
In addition to Blocks, server applications also require a certain number of other components to complete. Server applications require configuration file definition settings (such as threads, security, logs, etc.); define how BLOCKs are wrapped together; define configuration data for the Block instance. Block also requires other resources specified by the application.
PETER DONALD, BERIN LORTISCH Writing
Create a server application
Introduction
This document describes the steps to assemble your first server application. Creating a server app is followed:
1. Select the blocks you want to assemble.
2. Write config.xml.
3. Write asmblembly.xml.
4. Write environment.xml.
5. Package the components and their related resources in a SAR file.
Select the blocks you want to assemble
As an assembly person, choose a desired exact block for your application is your responsibility. You can also get the blocks you need from your own resources, you can also use the core Blocks provided by Phoenix, order the components of others, or download components in the online knowledge base.
Write Config.xml
Blocks configuration data is stored in the config.xml file. For more information on config.xml, please refer to the config.xml specification.
Write askMBLY.XML
The next step is to write the assembly.xml file, the assembly.xml file details the blocks instance as the server application section. Every Block has a name. Each Block can have a dependency (which can be implemented by "provide" sub-elements. The PROVIDE element can map the namespace from the server to the block role namespace in the BlockInfo file. For more information about Assembly.xml, please refer to the Assembly.xml specification.
Write environment.xml
The next step is to write an Environment.xml file that is used to configure the principles based on code security, log management principles and thread pools. For more details on Environment.xml, see Environment.xml Specification.
Create a SAR file
SAR file format is a standard distributed phoenix service application format. It is a standard JAR file with a specific directory layout, config.xml, assembly.xml, and Environment.xml must be stored in the SAR-INF / directory of the file, and all JAR files, all blocks and support class libraries The SAR-INF / LIB directory must be stored.
Peter Donald writing
Config.xml file specification
Introduction
The purpose of the config.xml file is to provide configuration data for each block that needs to configure data. The format of the configuration data is specified by the Block specification. Thus, please refer to the Block document to learn the details. In the assembly.xml file, each element under the root element has a name corresponding to the Block specification. The content of this element is the configuration data of Block. CONFIG.XML example
XML Version = "1.0"?>
myauthorizer>
...
myblock>
config>
Peter Donald writing
AskEMBLY.XML file specification
Assembly file
Assembly.xml defines how to assemble applications, which also define blocks of the application and how to connect Blocks, which also define the app listener contained in the app.
In the early phoenix version, the configuration file can also be stored in the assembly file. Now it is now, the configuration data is stored in a separate configuration file (config.xml).
The root element of Assembly.xml must be the
The
Attributes
description
Class
Block implements the full restricted name of the class, this class must be public and must have a non-arranging public constructor. There must be a BlockInfo file to be related to this class.
Name
The only name of Block. This name is used to review this block in the ASSEMBLY file, or see the block in the config file. Block naming can only contain letters, numbers, "-", and ".".
Attributes
description
Alias
Use the key elements of the service and mapping service. The default is the value of the Name property.
Name
This attribute is serving the target Block. This must refer to another Block in the same application.
Role
Service role (Role). This must refer to one of the Denpendency list in the BlockInfo file of the Block. The service name and version are specified by Dependency, and must correspond to one of the service lists of the BlockInfo file.
Attributes
description
Disable
Use the Proxy object to invalid. The default is False.
The
Attributes
description
Class
The full restricted name of the listener class is a full-quilted name. This class must be public, and a non-arranging constructor of a public must be provided. It must be implemented ORG.AVALON.PHOENIX.ApplicationListener interface. Name
The only name of the listener. It is used to point to the listener in the configuration file. Only letters, numbers, "-" and "in naming.".
The
Assembly.xml file example
Below is an example of assembly.xml. It defines 2 blocks, named myAuthorizer and MyBlock, and defines a listener. MyBlock uses the Athorizer service provided by Myathorizer.
XML Version = "1.0"?>
Class = "com.biz.cornerstone.blocks.myauthorizer"> block> Class = "com.biz.cornerstone.blocks.myblock"> Role = "com.biz.cornerstone.services.authorizer" /> block> Class = "com.biz.cornerstone.listeners.mylistener"> listener> askMBLY> Peter Donald writing ENVIRONMENT.XML file specification Introduction The purpose of the Environment.xml file is to configure the environment or server application settings. The current information is meant to set security principles and configuration log settings. Below is an environment.xml file sample. Early thread pools are also set in this section, but this is not advocated. Note that the data in the ENVIRONMENT.XML file is stored in the server.xml file. ENVIRONMENT.XML example XML Version = "1.0"?> priority = "debug" /> Location = "/ logs / default.log" /> Location = "/ logs / authorizer.log" /> logs> Location = "sar: / conf / keystore" TYPE = "jks" /> Key-store = "foo-keystore"> Target = "$ {/} TMP $ {/} *" Action = "Read, Write" /> grant> Code-base = "sar: / SAR-INF / LIB / *" Key-store = "foo-keystore"> Target = "$ {/} TMP $ {/} *" Action = "Read, Write" /> grant> policy> environment> If the assembly is very experienced, the policy format is very obvious if the standard policy is very experienced. Note that if you give a specified policy, the Server application will run at all allowed permissions. Attribute evaluation occurs under the extension similar to the standard PLOCY file attribute. There are several additional properties that can be used for estimation. They include: app.home and app.name. There is a special thing to remind, and the user can use the form of URLs. For example: "SAR: / SAR-INF / LIB / *". This must apply JAR permissions in the SAR file. Note: These URLs must start with "SAR: /", must be "/" as a file segment without having to care about the operating system. LOGS clips can have two elements at the same time. Log-targets depicts logs and their species, and must have a log-targets named "default". Types are inheritance of nature, yet a priority, and one or more log-targets associated. See the Logging documentation for further understanding. There is another type of log configuration. It is easier to configure. Specify the log version attribute. See Org.apache.avalon.excalibur.logger in Javadoc to learn more. Below is a configuration example: XML Version = "1.0"?> factories> category> categories> rotation> file> targets> logs> environment> Note: Everything in this article is owned by the author of this article.