ilog.cpl.storage
Class IlpDeploymentParser

java.lang.Object
  extended by ilog.cpl.storage.IlpDeploymentParser

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.

Since:
JTGO 3.0

Nested Class Summary
static interface IlpDeploymentParser.IlpCustomHandler
          Interface for handlers of custom elements.
 
Constructor Summary
IlpDeploymentParser(File deploymentFile)
          Constructor
IlpDeploymentParser(URL deploymentURL)
          Constructor
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpDeploymentParser

public IlpDeploymentParser(File deploymentFile)
Constructor

Parameters:
deploymentFile - The deployment descriptor file to be loaded. Must be non null.

IlpDeploymentParser

public IlpDeploymentParser(URL deploymentURL)
Constructor

Parameters:
deploymentURL - The deployment descriptor file to be loaded. Must be non null.
Method Detail

parse

public void parse(URL defaultDocumentBase,
                  IlpDefaultContext context)
           throws IOException,
                  IlpDeploymentParsingException
Parses the deployment descriptor and creates a corresponding service context.

The deployment descriptor will be validated against the XML schema defined in data/ilog/cpl/schema/deploy.xsd.

Parameters:
defaultDocumentBase - The URL of the default document base.
context - The service context filled in by reading the deployment descriptor.
Throws:
IlpDeploymentParsingException
IOException

parse

public void parse(URL defaultDocumentBase,
                  IlpDefaultContext context,
                  boolean validate)
           throws IOException,
                  IlpDeploymentParsingException
Parses the deployment descriptor and applies the contents of the deployment descriptor to the given context.

Parameters:
defaultDocumentBase - Document base
context - Context that will be modified
validate - Validates or not the deployment descriptor file
Throws:
IlpDeploymentParsingException
IOException
Since:
JTGO 4.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.