# HG changeset patch # User Felix Wolfsteller # Date 1322641215 0 # Node ID 9c8d91708d28fb77b674b31000211436a80fd73e # Parent eb1136134d09607e185958e1959904a11d095f0c Added DataProvider interface (interface for inter-facet communication). artifacts/trunk@3330 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r eb1136134d09 -r 9c8d91708d28 ChangeLog --- a/ChangeLog Wed Nov 30 08:13:48 2011 +0000 +++ b/ChangeLog Wed Nov 30 08:20:15 2011 +0000 @@ -1,3 +1,12 @@ +2011-11-30 Felix Wolfsteller + + Added DataProvider interface that defines api for inter-facet + communication. + + * artifacts/src/main/java/de/intevation/artifacts/DataProvider.java: + New interface to prepare inter-facet pre-rendering communication + phase ('blackboard'). + 2011-11-30 Felix Wolfsteller Prepare inter-facet pre-rendering communication ('blackboard') phase. diff -r eb1136134d09 -r 9c8d91708d28 artifacts/src/main/java/de/intevation/artifacts/DataProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/de/intevation/artifacts/DataProvider.java Wed Nov 30 08:20:15 2011 +0000 @@ -0,0 +1,23 @@ +package de.intevation.artifacts; + +import de.intevation.artifacts.CallContext; + +/** + * DataProviders register on a Blackboard with a key (basically shouting + * "I can or know X!"). + * + * Consumers look at the blackboard and then consume data from these + * DataProvider, passing them (optional) parameterization and the blackboard + * itself. + * + * Through the blackboard-passing-when-consuming, also recursive patterns can + * be modelled (but take care, there is no in-built cycle detection). + */ +public interface DataProvider { + /** Register this DataProvider on a blackboard under a key. */ + public void register(CallContext blackboard); + + /** Provide data, given parameterization and a "blackboard". */ + public Object provideData(Object key, Object param, CallContext context); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :