Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #40066 Back to Issue ]
Summary 0040066: API Change: EntityPersistenceEventObserver declared as an @ApplicationScoped bean
Revision 2019-02-01 10:01 by caristu
Description The fix for issue 0040046 declares the EntityPersistenceEventObserver class as an @ApplicationScoped bean. This is done because having no annotation, classes extending this one are @Dependent by default, which means than on every write operation done with DAL (save, update, delete) a new instance of every EntityPersistenceEventObserver listening to any of those operations is created.

This is an API change because by default now there only will be one instance of every class extending EntityPersistenceEventObserver (unless the scope would be overridden in the subclass).

Besides, after this API change, event handlers should be proxyable objects for WELD by default. Proxyable classes are those classes which are not final and does not contain any final methods.

For this reason, if an @ApplicationScoped event handler is defined as final or with a final method, the following exception will be thrown on server startup: "org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class is not proxyable because the type is final or it contains a final method"

Note that it is still possible to define event handlers as Dependent by explicitly using the @Dependent annotation. In that case it is not required to define the event handler as a proxyable class.
Revision 2019-02-01 09:58 by caristu
Description The fix for issue 0040046 declares the EntityPersistenceEventObserver class as an @ApplicationScoped bean. This is done because having no annotation, classes extending this one are @Dependent by default, which means than on every write operation done with DAL (save, update, delete) a new instance of every EntityPersistenceEventObserver listening to any of those operations is created.

This is an API change because by default now there only will be one instance of every class extending EntityPersistenceEventObserver (unless the scope would be overridden in the subclass).

Besides, after this API change, event handlers should be proxyable objects for WELD. Proxyable classes are those classes which are not final and does not contain any final methods.

For this reason, if an @ApplicationScoped event handler is defined as final or with a final method, the following exception will be thrown on server startup: "org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class is not proxyable because the type is final or it contains a final method"
Revision 2019-02-01 09:57 by caristu
Description The fix for issue 0040046 declares the EntityPersistenceEventObserver class as an @ApplicationScoped bean. This is done because having no annotation, classes extending this one are @Dependent by default, which means than on every write operation done with DAL (save, update, delete) a new instance of every EntityPersistenceEventObserver listening to any of those operations is created.

This is an API change because by default now there only will be one instance of every class extending EntityPersistenceEventObserver (unless the scope would be overridden in the subclass).

Besides, after this API change, event handlers should be proxyable objects for WELD. Proxyable classes are those classes which are not final and does not contain any final methods.

For this reason, if an event handler is defined with a final method, the following exception will be thrown on server startup: "org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class is not proxyable because the type is final or it contains a final method"
Revision 2019-01-30 14:04 by caristu
Description The fix for issue 0040046 declares the EntityPersistenceEventObserver class as an @ApplicationScoped bean. This is done because having no annotation, classes extending this one are @Dependent by default, which means than on every write operation done with DAL (save, update, delete) a new instance of every EntityPersistenceEventObserver listening to any of those operations is created.

This is an API change because by default now there only will be one instance of every class extending EntityPersistenceEventObserver (unless the scope would be overridden in the subclass).


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker