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

Priority of PreDestroyProcessor #9

Open
sectore opened this issue Jun 16, 2010 · 0 comments
Open

Priority of PreDestroyProcessor #9

sectore opened this issue Jun 16, 2010 · 0 comments

Comments

@sectore
Copy link

sectore commented Jun 16, 2010

Priority of PreDestroyProcessor has not to be 800 (ProcessorPriority.PRE_DESTROY), but less than 200 (ProcessorPriority.INJECT).

Background:
To remove property bindings based on [Inject("domainModel.anyProperty", bind="true")] of an unused bean, e.g. a presentation model, you have to dispatch BeanEvent.TEAR_DOWN_BEAN "by hand" using a [PostConstruct] declared method in a view. Check out the discussion here, too: http://groups.google.com/group/swiz-framework/browse_thread/thread/147725636697fd6c/47b4b47b4c4e2e5a#47b4b47b4c4e2e5a

Currently [PreDestroy] based on PreDestroyProcessor's tearDownMetadataTags() is called after unwireing a bean (e.g. presentation model) from a view base on InjectProcessor's tearDownBean() ( check: BeanFactory -> tearDownBean() ). Because all processors in Swiz.as are ordered by its priority. But in this case its not possible to dispatch a BeanEvent.TEAR_DOWN_BEAN including a reference to the bean (e.g. presentation model), because it is already unwired and null.

Changing the priority of PreDestroyProcessor to less than 200 (ProcessorPriority.INJECT) will fix it.

-Jens

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

No branches or pull requests

1 participant