Description
As discussed in CDITCK-215, there's something odd in ProcessSessionBean:
ProcessSessionBean<X> extends ProcessManagedBean<Object>
So, a ProcessSessionBean<Elephant> is not a ProcessManagedBean<Elephant> but a ProcessManagedBean<Object>. So the generic type parameter depends on which event type you are considering the event as.
To solve this I've modified GenericBeanEvent.getBeanClass() to
public Class<?> getBeanClassFor(Class<?> eventClass);
where you can pass in the type of the event you are thinking about. The implementations are unchanged except for GProcessSessionBean where it's now:
public Class<?> getBeanClassFor(Class<?> eventClass)
{
if (ProcessSessionBean.class.isAssignableFrom(eventClass))
else
{ return Object.class; }}
I also corrected the type parameter in
public class ProcessSessionBeanImpl<X> extends ProcessBeanImpl<Object> implements ProcessSessionBean<X>