anonymous wrote : I would like to create, if possible of course, an interface as a
component. And use this to control the tasks of my business process. Depending on the
implementation of such interface that is deployed, actions would behave differently.
It is not possible to directly define an interface as a Seam component, but it is possible
to have your components implement a common interface and refer to that interface where
your component is used. This is definitely recommended to allow differing implementations
to be swapped out as you describe.
Thus, if you have a component:
...
| @Name("hookComponent")
| public class HookComponentImpl implements HookComponent {
| ...
You tie your use of the component to the interface just like you would when injecting an
SFSB:
...
| @Name("commonComponent")
| public class CommonComponent {
| ...
| @In HookComponent hookComponent;
| ...
Here Seam will inject an instance of HookComponentImpl as it is the component registered
in the context but this could easily be swapped out through a number of approaches
(deploying a specific application instance as you describe, install precedence,
configuration through components.xml, etc). Hope that helps.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112328#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...