| Context and Deployment Descriptor > The Context Services > Class Loader |
Class Loader |
INDEX
PREVIOUS
NEXT
|
The Class Loader service is defined by the interface IlpClassLoaderService.
It enables JViews TGO to load classes used in the definition of the business model and in the styling of the components and objects. This is performed with a class loader that is different from the default class loader provided by the Java framework. By default, it is done with the class loader service defined by the class IlpDefaultClassLoaderService which tries to load classes in the following order:
IlpClassLoaderService provides the method loadClass which returns the Java class that corresponds to the given class name. If the class name cannot be loaded, this method should throw a ClassNotFoundException.
public Class loadClass (String name) throws ClassNotFoundException
You can initialize the class loader service in the deployment descriptor file using the tag <classLoader> as follows:
[<classLoader javaClass="class name"/>]
where javaClass indicates the name of a Java class that implements the IlpClassLoaderService interface.
The following example illustrates the customization of the class loader service through the deployment descriptor:
<?xml version="1.0"?> <deployment xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation = "ilog/cpl/schema/deploy.xsd"> <classLoader javaClass = "package.MyClassLoader" /> </deployment>
IlpDefaultContext context = ... IlpClassLoaderService service = new MyClassLoaderService(); context.addService(IlpClassLoaderService.class, service);
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |