You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "David Blevins (JIRA)" <ji...@apache.org> on 2007/09/11 22:20:32 UTC

[jira] Created: (OPENEJB-678) Validation: Explicit check for InvocationContext incorrectly used in bean callbacks

Validation: Explicit check for InvocationContext incorrectly used in bean callbacks
-----------------------------------------------------------------------------------

                 Key: OPENEJB-678
                 URL: https://issues.apache.org/jira/browse/OPENEJB-678
             Project: OpenEJB
          Issue Type: Sub-task
            Reporter: David Blevins




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-678) Validation: Explicit check for InvocationContext incorrectly used in bean callbacks

Posted by "David Blevins (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526593 ] 

David Blevins commented on OPENEJB-678:
---------------------------------------

A very common mistake is to declare bean callbacks as follows:

@PostConstruct <any-scope> void <method-name>(InvocationContext)
@PreDestroy <any-scope> void <method-name>(InvocationContext)
@PrePassivate <any-scope> void <method-name>(InvocationContext)
@PostActivate <any-scope> void <method-name>(InvocationContext)

That is only allowed for Interceptors.  The correct syntax is

@PostConstruct <any-scope> void <method-name>()
@PreDestroy <any-scope> void <method-name>()
@PrePassivate <any-scope> void <method-name>()
@PostActivate <any-scope> void <method-name>()

This is checked for in org.apache.openejb.config.rules.CheckCallbacks.  Just need to improve the logic to check for this type explicitly and add more specific info.

> Validation: Explicit check for InvocationContext incorrectly used in bean callbacks
> -----------------------------------------------------------------------------------
>
>                 Key: OPENEJB-678
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-678
>             Project: OpenEJB
>          Issue Type: Sub-task
>            Reporter: David Blevins
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.