You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Stan Silvert (JIRA)" <de...@myfaces.apache.org> on 2006/04/05 03:30:01 UTC

[jira] Created: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

         Key: MYFACES-1246
         URL: http://issues.apache.org/jira/browse/MYFACES-1246
     Project: MyFaces Core
        Type: New Feature

  Components: JSR-252  
    Reporter: Stan Silvert


Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.

See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Mathias Broekelmann (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475337 ] 

Mathias Broekelmann commented on MYFACES-1246:
----------------------------------------------

I looked into the spec section 5.4. Besides PostConstruct and PreDestroy there should also be a way to inject various j2ee container specific resources. As this is definitly out of scope for myfaces implementation I think we should find a way for j2ee containers to define their own implementation for this. Suns RI uses some kind of InjectionProvider which is implemented by j2ee containers. I think we schould do it in the same way.

> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Dennis Byrne
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Mathias Broekelmann (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475134 ] 

Mathias Broekelmann commented on MYFACES-1246:
----------------------------------------------

Hi Dennis, any progress on this?

> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Dennis Byrne
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Bernd Bohmann (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475182 ] 

Bernd Bohmann commented on MYFACES-1246:
----------------------------------------

Just found

 <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-annotation_1.0_spec</artifactId>
      <version>1.0</version>
    </dependency>

> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Dennis Byrne
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Dennis Byrne (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475580 ] 

Dennis Byrne commented on MYFACES-1246:
---------------------------------------

Thanks Bernd, Hi Paul,

Paul, I plan on diving into this for the weekend.  Thanks for the information but I'm not sure what you're saying.  Are you saying I should not bother implementing this for the sake of passing J2EE TCK?  

Ultimately I think we can all agree MyFaces should have this functionality w/ or w/out a full container.  Please give me any info you can ASAP in order to avoid unnecessary work.   

> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Dennis Byrne
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Paul McMahan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475588 ] 

Paul McMahan commented on MYFACES-1246:
---------------------------------------

Dennis, sorry I can see how my comment could be easily misunderstood.  Yes I agree that MyFaces shoiuld support the @PostConstruct and @PreDestroy annotations with or without a full JEE container.  My comments were mainly in reaction to Mathias' observation that MyFaces should also provide support for resource injection when running in a JEE container.  If you agree with Mathias and want to tackle JEE resource injection as part of this JIRA then I wanted to let you know about Geronimo's current level of support for annotations, which discovers annotations and handles resource injection in servlets, filters, and listeners but not in managed beans.  To add support for resource injection in managed beans we could take the approach that Mathias recommends where the JEE container implements an InjectionProvider interface.  Geronimo is currently using MyFaces for JSF 1.2 support so as a Geronimo committer I can work with you on defining and testing this interface.  Hope this makes better sense now.

> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Dennis Byrne
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Dennis Byrne (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475139 ] 

Dennis Byrne commented on MYFACES-1246:
---------------------------------------

Hi Mathias,

I made no progress on this one.  Two challenges in finishing it.  First, find the binary for the annotation dependency.  I've found this to be difficult, but today there may be more options in ibiblio.

http://mail-archives.apache.org/mod_mbox/myfaces-dev/200606.mbox/%3cW4589819188293511151146019@webmail1%3e

If we can't get the jar, programmatically parsing the annotation string manually will work as well :(

I have also been a little frustrated with the spec on this one.

http://www.archivesat.com/JavaServerFaces_development/thread1036089.htm

Looking at things now, I +1 for doing the simplest thing that will pass TCK.  I have some time this weekend.  Why don't I tackle this then.  I've noticed you are very active lately, you can focus on other stuff.



> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Dennis Byrne
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Dennis Byrne (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475593 ] 

Dennis Byrne commented on MYFACES-1246:
---------------------------------------

Well, I appreciate the help but I'd like to nail this one for all environments.  I've got a few unit tests running for @PC and I don't think it should be too much.  Once again, thanks.  And feel free to help this way.  You can never have enough info.

> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Dennis Byrne
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Bernd Bohmann (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477778 ] 

Bernd Bohmann commented on MYFACES-1246:
----------------------------------------

Just added an AnnotationProcessor based on the tomcat implementation.
You can configure it with a servlet init param or a service provider.
The fallback implementation try to setup a Processor base on the classpath

> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Bernd Bohmann
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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


[jira] Commented: (MYFACES-1246) JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.

Posted by "Paul McMahan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475348 ] 

Paul McMahan commented on MYFACES-1246:
---------------------------------------

Apache Geronimo has recently started introducing annotation support, including resource injection.  It is enabled by scanning an application's classloader during deployment for annotations, adding the resources to JNDI, and then allowing the various JEE containers to perform the injections by looking up the resource in JNDI when the object is brought into service.  In the case of JSF, the servlet container (tomcat or jetty) is responsible for finding annotations when it activates a servlet, filter, or listener and doing the resource injection or handling @PostConstruct, @PreDestroy, etc.

Since MyFaces 1.2 is now integrated with geronimo/server/trunk it should not be too difficult to start running some tests with annotations.  Also, as Bernd has pointed out Geronimo provides an annotation spec jar and in fact already adds it to the classpath for the servlet containers where MyFaces is enabled.  Furthermore, Geronimo/XBean has some utility classes that can be used to process and discover annotations that could prove useful to MyFaces.

I think Mathias' idea about using an InjectionProvider makes a lot sense since currently Tomcat 6 (and maybe Jetty) only scans for and processes annotations in servlets, filters, and listeners.   I can help with this item for MyFaces in Geronimo.

> JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1246
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1246
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-252
>            Reporter: Stan Silvert
>         Assigned To: Dennis Byrne
>
> Specified that implementations running in a JSR-250 compliant container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
> Specified that methods annotated with @PreDestroy be called when the scope for the bean is ending.
> See https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=252

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