public class IlpDeploymentParser extends Object
This class allows you to load a context from a deployment descriptor in XML.
The deployment descriptors which can be parsed have the following syntax:
<deployment> [<locale> <language>xxx</language> <country>xxx</country> [variant>xxx</variant>] </locale>] [<urlAccess [verbose="bool"] [documentBase="xxx"]> [<relativePath>xxx</relativePath>]* [<absolutePath>xxx</absolutePath>]* </urlAccess>] [<classManager> [<file>xxx</file>]* </classManager>] [<blinkingManager> <onPeriod>111</onPeriod> <offPeriod>111</offPeriod> </blinkingManager>] [<typeConverter javaClass="class name"/>] [<classLoader javaClass="class name"/>] [<synchronizationStrategy type="application"|"servlet"/>] [<custom handlerClass="java class name of handler" [handleFirst="true"|"false"]> anything </custom>] </deployment>
When the deployment descriptor is being parsed, its contents will be automatically
validated against the defined XML schema (data/ilog/cpl/schema/deploy.xsd
).
If you do not want to perform this validation, use method parse(URL,IlpDefaultContext,boolean)
.
Note 1: The type converter class must implement the IlpTypeConverter
and contain either a default constructor or a constructor that takes a single
IlpContext
as parameter.
Note 2: The class loader class must implement the IlpClassLoaderService
and contain either a default constructor or a constructor that takes a single
IlpContext
as parameter.
Note 3: There is no particular order for the top-level elements. For example, you can put the class manager before the locale.
Modifier and Type | Class and Description |
---|---|
static interface |
IlpDeploymentParser.IlpCustomHandler
Interface for handlers of custom elements.
|
Constructor and Description |
---|
IlpDeploymentParser(File deploymentFile)
Constructor
|
IlpDeploymentParser(URL deploymentURL)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
parse(URL defaultDocumentBase,
IlpDefaultContext context)
Parses the deployment descriptor and creates a corresponding service context.
|
void |
parse(URL defaultDocumentBase,
IlpDefaultContext context,
boolean validate)
Parses the deployment descriptor and applies the contents of the deployment
descriptor to the given context.
|
public IlpDeploymentParser(File deploymentFile)
deploymentFile
- The deployment descriptor file to be loaded. Must be
non null.public IlpDeploymentParser(URL deploymentURL)
deploymentURL
- The deployment descriptor file to be loaded. Must be
non null.public void parse(URL defaultDocumentBase, IlpDefaultContext context) throws IOException, IlpDeploymentParsingException
The deployment descriptor will be validated against the XML schema
defined in data/ilog/cpl/schema/deploy.xsd
.
defaultDocumentBase
- The URL of the default document base.context
- The service context filled in by reading the deployment descriptor.IlpDeploymentParsingException
IOException
public void parse(URL defaultDocumentBase, IlpDefaultContext context, boolean validate) throws IOException, IlpDeploymentParsingException
defaultDocumentBase
- Document basecontext
- Context that will be modifiedvalidate
- Validates or not the deployment descriptor fileIlpDeploymentParsingException
IOException
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.