How to subclass a managed bean
I don't even know if I can explain what I want to do here, but here goes: I have a generic abstract "Task" class with common properties (name, description, startDate, endDate, isEnabled, owner), and a property called "editorAction" that specified the JSF action to call when editing this Task.
There are also many subclasses of the Task class (such as HttpTask, FtpTask, EmailTask, etc). For each Task subclass, I have specified a separate managed Bean.
Now, I have a "list" page, where all current tasks are displayed. Each item in the list is of type Task. When the user clicks the "edit" link for the item, I need to:
a) set the relevant managed bean for the type of task being edited, and
b) launch the relevant editor for the Task.
These tasks come from a database table, and the editor action is specified in the database.
What I'd like to be able to do is specify asingle managed bean of type Task, then set the value of that bean to any object that is a valid subclass of the Task class. How can I go about doing this? It seems like this is all managed by Faces internally. How can I go about setting the value of a managed bean programmatically?

