Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Injection on EJB interceptors is not working #3 #10

Closed
wants to merge 5 commits into from
Closed

Conversation

bbq2100
Copy link
Contributor

@bbq2100 bbq2100 commented Oct 29, 2014

This commit fixes the injection failure in @ejb Interceptors. See issue #3.

  • Implemented a approach based on the @InterceptorBinding mechanism. The solution replaces @interceptors() in processed beans with a global interceptor wrapper/proxy. The wrapper delegates the InvocationContext to the modified InterceptorBinding.
  • Implemented a cache optimization regarding the modification of Interceptor bindings of @ejb Interceptors.
  • Created Sample EJB together with a basic @AroundInvoke Interceptor to
    verify the NPE in EJB Interceptors proposed by @agori.
  • Fixed debug log in EntityManagerProducer
  • Processing @interceptors annotation and replacing with altered InterceptionBindings
  • Saving altered InterceptorBindings in GlobalInterceptorImpl (interceptor cache)

Qaiser Abbasi added 2 commits October 26, 2014 15:10
clean-ups the requested deployment validation in #5 by @carlosbarragan.

Details:
 - Validating correct dependency configuration in the deployment
process.
 - Refactored observed methodes in BeanTestExtension
 - Disabled TestInvalidInjectionPointConfiguration. The test case
contains the reason.
 - Updated snapshot version
 - various cleanups
This commit fixes the injection failure in @ejb Interceptors.

Details:
	- implemented an approach based on an @InterceptorBinding. The solution
replaces @interceptors() in processed beans with an global interceptor
wrapper/proxy. The wrapper delegates the InvocationContext to the
modified InterceptorBinding.
	- implemented a cache optimization regarding the modification of
Interceptor bindings in @ejb Interceptors.
	- implemented several test cases: 
	Created Sample EJB together with a basic @AroundInvoke Interceptor to
verify the NPE in the Interceptor proposed by @agori.
	- Fixed Debug log in EntityManagerProducer
	- Processing @interceptors annotation and replacing with altered
InterceptionBindings. 
	- Saving altered InterceptorBindings in GlobalInterceptorImpl
@bbq2100 bbq2100 added the bug label Oct 29, 2014
Qaiser Abbasi added 2 commits October 29, 2014 11:24
…t with the help of InterceptorWrapper (global interceptor) BeanTesting already supports correct transaction propagation in EJB interceptors. The transaction will be shared among invoked interceptor instances.

 Details:

 - the patch for issue #3 includes  a modification of InterceptorWrapperImpl. During the verification of the proposed bug by @agori (see issue  #4), I observed in TestEJBInterceptedByMultipleInterceptors a ClassCastException: occurs if an intercepted @ejb returns a value in a business method. The reason behind it was that InterceptorWrapperImpl didn´t returned results from invoked interceptor instances but rather the origin InvocationContext.

 - resolution of issue #4: the created test case (TestEJBInterceptedByMultipleInterceptors) demonstrates that EJB interceptors (Interceptor1SharingTransaction and Interceptor2SharingTransaction) are using an active transaction.
@bbq2100
Copy link
Contributor Author

bbq2100 commented Nov 2, 2014

The last commit provides a resolution for issue #4

@bbq2100
Copy link
Contributor Author

bbq2100 commented Nov 6, 2014

Great idea -> I´ll refactor it to a distinct Extension. Just a mom plz.^^

…ionality in seperate CDI Extensions

This commit provides a spreading of the former BeanTestExtension in seperate CDI Extensions. Namely: BaseExtension, EJBExtension and InterceptorExtension.
Further this commit contains various cleanups.

Details:

* Introduced Base class for CDI Extensions
* Created distinct CDI Extensions and registered in the javax.enterprise.inject.spi.Extension file
* Removed redundant type parameter from methods
* Pulled up various common methods in BaseExtension
* Updated Javadocs
@bbq2100
Copy link
Contributor Author

bbq2100 commented Nov 6, 2014

Done 😉

@carlosbarragan
Copy link
Member

  • This pull request still contains the commit with the compilation failure.
  • The last commit and last before that one can be squashed.
  • Commit 2fae656 was removed from master. Since GitHub erroneously pushed it, so it should not be introduced again.

@carlosbarragan
Copy link
Member

Since the commit history must be changed. I will close this pull request. Please open a new one with the changes mentioned in the last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants