Creating a DTK Plugin

To create and commit a DTK plugin: 

  1. Create the different Java files required for the type of plugin you want to create. See the chapters describing each plugin for further information.

  2. Compile all the Java files for your plugin into classes:

    > javac -classpath $CLASSPATH com/mycompany/myagent/*.java

Note!

Do not use the default package context in the Java code. All classes in MediationZone must have unique names.

  1. Create a user defined *.jar file containing the classes, see the section below, Creating a User Defined Jar File.

  2. Create a user defined *.mzp package containing the *.jar file, see the section below, Creating a User Defined Package.

  3. Commit your user defined package, see the section below, Committing a User Defined Package.

Creating a User Defined Jar

To create a *.jar file containing the classes, use the following command syntax:

> jar cvf my_agent.jar com/mycompany/myagent/*.class

It is also possible to add resources to a jar file, just append any resource name to your "jar create" command. This allows you to, for instance, add images that your class depends on to the jar:

> jar cvf my_agent.jar com/mycompany/myagent/*.class com/mycompany/myagent/myagent_icon.svg

Creating a User Defined Package

In order to insert the *.jar file into MediationZone, a package containing the jar file must first be created. A package gives the *.jar file a name and a version. The mzsh pcreate command creates a code package used for composing packages (.mzp) in order to create additional functionality and updates. The name and version will be visible in the About window once the new package has been committed into the system.

A package is created using the pcreate command in the mzsh Command Line Tool:

Argument

Description

Argument

Description

<name>

The name of the package

<version>

The version string of the package

<package-file>

The resulting package file name

[ -level <default level>]

Specifies if this software should support update to a running system. The default level can either be platform or execution. Execution implies that the component can be updated when the system is running, for example upgrading to a newer agent version.

Note!

Not all kinds of software using the development toolkit can be updated and also that a third party library being used by the software may or may not support the execution level.

[ -revision <revision>]

Used to show the revision number from which the .mzp file is built, that is from a revision management system.

[ -repository <repository>]

Used to show the repository from which the .mzp file is built, that is from a revision management system.

-hidden

Used if the .mzp file is not supposed to be visible in the system, for example in the ">About dialog.

[ -level <level name>] file=<file-to-include>

The level name can either be platform or execution. Each filename to be included can optionally be preceded by a level.

[ -osgi <true/false> ]

Used to indicate if the .mzp file has a separate third party java library file that is not packaged by MediationZone. The default value is set to false.

Exporting 3PP Packages

It is advisable to use a Java wrapper as a proxy for exporting the packages used by your custom mzp.

[ -exportpackages <Java wrapper>]

A mandatory option when osgi is set to true. This option is used to export the Java wrapper for use by the DTK plugin.

[ -exported <export-version> file=<jar file>]

This option is used to export all Java packages that comes bundled in a third party library package. This option is especially useful when there are multiple large third party library packages that contains large quantities of packages embedded within them.

Committing a User Defined Package

Â