I have an event observer class. It is a generic mailer. It takes event and creates an email of it. I want to create multiple instances of this observer class like so:
<m:Mailer
resource="WEB-INF/email/adminConfirmation.ftl"
emailNotificationAddress="admin@xxxx.com">
<order:onOrderChange>
<s:parameters>
<order:StateChange>
<s:Observes />
</order:StateChange>
</s:parameters>
</order:onOrderChange>
</m:Mailer>
<m:Mailer
resource="WEB-INF/email/userConfirmation.ftl"
emailNotificationAddress="${order.user.email}">
<order:onOrderChange>
<s:parameters>
<order:StateChange>
<s:Observes />
</order:StateChange>
</s:parameters>
</order:onOrderChange>
</m:Mailer>
And furthermore I would like it to inherit it's annotation based informations, so I don't have to declare this order:onOrderChange method each time. I tried to declare two instances with s:modifies. But in no matter what I do there is just one listener instance attached.
I desperately want to attach multiple, differently configured instances of the same class as event observers. And haven't found any solution yet...