Runtime tools : Core components : Externalizers : Concepts : How externalizers work
  
How externalizers work
Preparing an externalizer
The following is a description of what the toolkit does to prepare to use externalizers:
1 When starting up, the toolkit reads the settings section of the toolkit definition (btt.xml) file:
com.ibm.dse.base.Settings.reset( URL or Path );
The URL for the configuration file can be downloaded from the Web server as a parameter of the startup applet. After installing the toolkit, the configuration file for the client is located in <toolkit root>\dse and the configuration file for the server is located in <toolkit root>\dse\server.
2 The toolkit initializes the externalizers.
com.ibm.dse.base.Settings.initializeExternalizers(com.ibm.dse.base.Settings.MEMORY);
3 The externalizers read the generic toolkit definition files.
4 The externalizers use the information contained in the definition file to create the runtime tag structure in memory.
5 The externalizers resolves references to other definitions (tag linking) and updates the runtime tag structure.
Using an externalizer
Once the toolkit is initialized, the toolkit uses an externalizer in the following way to initialize an object:
1 The application requires a new instance of an object.
2 The toolkit obtains the externalizer for the object.
3 If the object cache for objects (formats and processors only) is enabled and the object's class implements the Cacheable interface, the externalizer's readObject method looks in the cache's Hashtable for the requested object:
If the object is not in the cache, the externalizer continues this process to initialize the object.
If the object is in the cache, the externalizer returns the requested operation and removes the reference to it from the cache Hashtable.
4 The externalizer searches for the object definition in the runtime tag structure in memory. The search order depends on the type of entity being defined and whether the definition file is generic or self-defined. The externalizer uses the first definition it finds.
5 If the object definition has a defined implementation class (the implClass attribute), the externalizer creates the object using that class. If the object definition does not have a defined implementation class, the externalizer uses the class defined in the generic toolkit definition (btt.xml) file.
6 Once the externalizer has instantiated the object, it gets the object's values from the object's tag using its initializeFromTag(Tag) method. The externalizer then uses these values to initialize the object.
7 The toolkit uses the object.
8 If the object is cacheable and the application invokes the putIntoCache static method in the object's externalizer, the toolkit stores object in the appropriate object cache. The toolkit can then reuse it.
Go up to
Concepts