* fixed use of @Factory@ instead of @FactoryPostProcessor@

git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/hera/trunk@8085 5a64d73e-33d6-4ccc-9058-23f8668ecac9
This commit is contained in:
Oliver Gierke
2009-11-27 14:54:32 +00:00
parent a8b1176ffa
commit 04a9aa4287

View File

@@ -79,7 +79,7 @@ public class HostImpl implements Host {
<section id="core.collecting-beans"> <section id="core.collecting-beans">
<title>Collecting Spring beans dynamically</title> <title>Collecting Spring beans dynamically</title>
<para>With the <classname>BeanListBeanFactoryPostProcessor</classname> <para>With the <classname>BeanListBeanFactory</classname>
<productname>Hera</productname> provides a Spring container extension, <productname>Hera</productname> provides a Spring container extension,
that allows to lookup beans of a given type in the current that allows to lookup beans of a given type in the current
<interfacename>ApplicationContext</interfacename> and register them as <interfacename>ApplicationContext</interfacename> and register them as
@@ -94,7 +94,7 @@ public class HostImpl implements Host {
&lt;property name="plugins" ref="plugins" /&gt; &lt;property name="plugins" ref="plugins" /&gt;
&lt;/bean&gt; &lt;/bean&gt;
&lt;bean class="org.synyx.hera.plugin.support.BeanListBeanFactoryPostProcessor"&gt; &lt;bean class="org.synyx.hera.plugin.support.BeanListBeanFactory"&gt;
&lt;property name="lists"&gt; &lt;property name="lists"&gt;
&lt;map&gt; &lt;map&gt;
&lt;entry key="plugins" value="org.acme.MyPluginInterface" /&gt; &lt;entry key="plugins" value="org.acme.MyPluginInterface" /&gt;
@@ -114,18 +114,17 @@ public class HostImpl implements Host {
automatically as long as it is annotated with <code>@Component</code>, automatically as long as it is annotated with <code>@Component</code>,
<code>@Service</code> a.s.o.</para> <code>@Service</code> a.s.o.</para>
<para>The <classname>BeanListBeanFactoryPostProcessor</classname> in turn <para>The <classname>BeanListBeanFactory</classname> in turn allows
allows registering a map of lists to be created, where the maps entry key registering a map of lists to be created, where the maps entry key is the
is the id under which the list will be registered and the entry's value is id under which the list will be registered and the entry's value is the
the type to be looked up.</para> type to be looked up.</para>
<note> <note>
<para>The design of the <para>The design of the <classname>BeanListBeanFactory</classname> might
<classname>BeanListBeanFactoryPostProcessor</classname> might seem a seem a little confusing at first (especially to set a map on a property
little confusing at first (especially to set a map on a property named named lists). This is due to the posibility to register more than one
lists). This is due to the posibility to register more than one list to list to be looked up. We think about dropping this functionality for the
be looked up. We think about dropping this functionality for the sake of sake of simplicity in future versions.</para>
simplicity in future versions.</para>
</note> </note>
<simplesect> <simplesect>
@@ -194,12 +193,12 @@ public class HostImpl implements Host {
<title>Plugin beans</title> <title>Plugin beans</title>
<para>Using plain interfaces and <para>Using plain interfaces and
<classname>BeanListBeanFactoryPostProcessor</classname> offers an easy way <classname>BeanListBeanFactory</classname> offers an easy way to
to dynamically lookup beans in Spring environments. Nevertheless, very dynamically lookup beans in Spring environments. Nevertheless, very often
often you face the situation that you want to have dedicated access to a you face the situation that you want to have dedicated access to a subset
subset of all plugins, choose plugins by a given criteria or use a decent of all plugins, choose plugins by a given criteria or use a decent default
default plugin or the like. Thus we need a basic infrastructure interface plugin or the like. Thus we need a basic infrastructure interface for
for plugin interfaces to extend and a more sophisticated plugin plugin interfaces to extend and a more sophisticated plugin
container.</para> container.</para>
<simplesect> <simplesect>
@@ -268,11 +267,10 @@ registry.getPluginsFor(ProductType.HARDWARE, new MyException("Damn!");</programl
<simplesect> <simplesect>
<title>Configuration and namespace</title> <title>Configuration and namespace</title>
<para>Similar to the <para>Similar to the <classname>BeanListBeanFactory</classname>
<classname>BeanListBeanFactoryPostProcessor</classname> described in described in <xref linkend="core.collecting-beans" /> Hera provides a
<xref linkend="core.collecting-beans" /> Hera provides a <classname>PluginRegistryBeanFactory</classname> to automatically lookup
<classname>PluginRegistryBeanFactoryPostProcessor</classname> to beans of a dedicated type to be aggregated in a
automatically lookup beans of a dedicated type to be aggregated in a
<classname>PluginRegistry</classname>. Note that the type has to be <classname>PluginRegistry</classname>. Note that the type has to be
assignable to <interfacename>Plugin</interfacename> to let the registry assignable to <interfacename>Plugin</interfacename> to let the registry
work as expected.</para> work as expected.</para>