Skip to main content
Version: Early Access

Define a synthetic method

This topic covers defining and implementing methods on Configuration Items (CIs) in Deploy, specifically for control tasks.

In Deploy, you can define methods on configuration items (CIs). Each method can be executed on an instance of a CI via the GUI or CLI. Methods are used to implement control tasks, as actions on CIs to control the middleware. An example is starting or stopping a server.

The CI itself is responsible for implementing the specified method, either in Java or synthetically when extending an existing plugin such as the Generic plugin.

This example shows how to define a control task:

<type type="tc.DeployedDataSource" extends="generic.ProcessedTemplate" deployable-type="tc.DataSource"
container-type="tc.Server">
<generate-deployable type="tc.DataSource" extends="generic.Resource"/>
...
<method name="ping" description="Test whether the datasource is available"/>
</type>

The ping method defined above can be invoked on an instance of the tc.DeployedDataSource CI through the server REST interface, GUI, or CLI. The implementation of the ping method is part of the tc.DeployedDataSource CI.