Managing Plug-in state

The aim of this page is to describe how we manage, within LarKC, the state of a plug-in so that the plug-in itself becomes stateless. This is of interest, for example, in the case that one plug-in instance needs to be reused by different workflows.

The agreed upon approach is to have the platform keep plug-in's state in 'context' objects which are passed to the plug-in at each invocation.

Current status: The necessary changes to the platform code (plug-in managers) and the plug-in API have been made. Now the platform will call 'createContext()' on each plug-in and whatever is returned is passed to each plug-in when it is invoked.

The sindice plug-in has been updated accordingly, which is the only plug-in we know about, for now, that needs to remember things between invocation (it remebers which page of results it is on)

Next steps: We leave to plug-in/workflow writers to start using the context object correctly, i.e. to store any necessary state between invocations and so become stateless.

Important reminder: The JEE extensions also pass the context object, but they don't return it. This will eventually be a problem and needs a fix. I suggest wrapping return values in some simple serialisable class, just as the 'in' parameters are handled. See the jee_extensions project.

LarkcProject/WP5/PluginState (last edited 2010-03-23 16:50:41 by ?GeorginaGallizo)