Transmitter Plugin API

Overview

Transmitter plugins perform two tasks: channel customization based on user preferences and channel feedback in the form of logging information.

Plugins work as follows: The first time an update request is made on a channel, the plugin will be instantiated. The plugin's init() method will be called, which you can override to do your initialization. From then on, the processRequest method will be called once for each request. Your processRequest method will perform any log interpretation as well as channel customization.

Channels provide feedback in the form of log messages. You, as the channel developer, can decide what information you want to log. For instance, if you have a ad rotation widget and wish to record impressions, you can do so by logging that information using the channel log api.

Each call to appendLog results in a separate, time-stamped log entry. When the channel is next updated all the log entries are combined and sent as an array of bytes to your transmitter plugin for that channel. If there is no transmitter plugin for that channel, the data is copied to a default log file for that channel. Then you can use some other tools to parse the log file. If you have a plugin, however, then you can use it to process the individual log entries and do whatever you want.


Plugin APIs

To create a transmitter plugin, you have to subclass marimba.plugin.Plugin. Your Plugin subclass will surely override the processRequest method.


Directory Structure

Your plugin is just part of the definition of your channel. It's placed in a subdirectory of your channel called "plugin". In that directory is a properties.txt file, and the classes and data which implement the plugin. Currently there is only one property, "main", which is the name of your Plugin subclass.

The classpath for your plugin is that plugin directory, plus the classpath for your channel. Therefore, it is now possible to share classes between your channel and your plugin. In previous releases, it was not possible to share classes this way. So, if your class is MyPlugin, then your directory looks like this:

	channel/<code>
	channel/<data>
	channel/plugin/properties.txt
	channel/plugin/parameters.txt
	channel/plugin/MyPlugin.class
See the Headlines channel for a look at an actual channel with a plugin.


Important classes

marimba.channel.Application
This is the main Channel class. Subclass this class to create your own channel.
marimba.plugin.Plugin
This class is subclasses to create your own plugin.
marimba.plugin.RequestContext
This is an interface for querying information about the request being handled.


Other links

Also available are: