InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.15: Administering custom services (overview)

6.6.15: Administering custom services (overview)

Configuring a custom service provides the ability to plug into a WebSphere application server to define a hook point to be executed at server startup and shutdown. It allows configurable extensions to the application server runtime.

The application server runtime will load the classname specified in the custom service properties and call its initialize() method, passing in a Properties object that contains the configuration information for the service. The configuration information for the custom service can be arbitrary name-value pair properties, or information contained is an external file, such as an XML file on disk somewhere.

Custom service property in the administrative configuration file

For the multiple server edition of Advanced Edition, the administrative server configuration file contains the property:

com.ibm.websphere.preconfiguredCustomServices
that is a list of files containing XML configuration of custom services. The files in the list are read every time a new application server is configured. Any custom services contained in those files are automatically added to the configuration of the application server. This allows, for example, extensions to be defined in those files that will be made part of every server, automatically.

The file with these preconfigured custom services must be in the same format as the XML config files used by Advanced Single Server Edition, (such as server-cfg.xml). The preconfigured custom service file format must include Domain, Node, and Server elements. The parser expects these and will fail unless these elements are in the file surrounding the actual custom service elements. The precise value for these elements (Domain, Node, Server) does not matter; they just must be present in the configuration file.

Attached is a sample service.xml that defines a preconfigured CustomService.

<!--
This file defines a custom service for the automatic generation of
plugin configuration data. When this service is enabled, the plugin
configuration files will be regenerated whenever you start an
application server. To enable this custom service by default, change
the "enable" property from "false" to "true".

NOTE: Changes to this file will not affect existing application
servers. When a new application server is created, it will contain
a custom service defined by the properties in this file. To change
the properties of this custom service on an existing application server,
you must edit the service's properties in the administration client.
-->

<applicationserver:Domain xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:applicationserver="applicationserver.xmi"
xmlns:server="server.xmi" xmi:id="">
<nodes xmi:id="">
<servers xsi:type="applicationserver:ApplicationServer" xmi:id="">
<customServices xmi:id="PluginCfgService"
enable="false"
description="If enabled, the plugin configuration files will be
regenerated when the application server is started"
displayName="Automatic Generation of Plugin Configuration"
externalConfigURL=""
classname="com.ibm.websphere.plugincfg.initializers.AEPluginCfgService">
</customServices>
</servers>
</nodes>
</applicationserver:Domain>

Go to previous article: Updating data source and data source provider configurations with the Application Client Resource Configuration Tool Go to next article: Properties of custom services

 

 
Go to previous article: Updating data source and data source provider configurations with the Application Client Resource Configuration Tool Go to next article: Properties of custom services