[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1075) Documentation enhancement for injecting Logger (make clear when static is required)

Stephen Friedrich (JIRA) jira-events at lists.jboss.org
Wed Feb 27 17:09:43 EST 2008


    [ http://jira.jboss.com/jira/browse/JBSEAM-1075?page=comments#action_12400774 ] 
            
Stephen Friedrich commented on JBSEAM-1075:
-------------------------------------------

Note that it is necessary for the entity to also have a @Name annotation (or be defined in components.xml as a seam component).

> Documentation enhancement for injecting Logger (make clear when static is required)
> -----------------------------------------------------------------------------------
>
>                 Key: JBSEAM-1075
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1075
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: Documentation Issues
>    Affects Versions: 1.2.0.GA
>         Environment: All
>            Reporter: Arjan van Bentem
>         Assigned To: Shane Bryzak
>            Priority: Optional
>             Fix For: 1.2.1.GA
>
>
> The documentation of @Logger in "3.6 Logging" states at http://fisheye.jboss.com/browse/JBoss/jboss-seam/doc/reference/en/modules/concepts.xml?r=1.53#l976
>     It doesn't matter if you declare the log variable static or not?it will work either way.
> I think this should be enhanced to read, for example:
>     It doesn't matter if you declare the log variable static or not?it will work either way,
>     except for entity beans which needs the logger to be static.
> ...maybe followed by an example:
>     @Entity
>     @Name("member")
>     @Table(uniqueConstraints = @UniqueConstraint(columnNames = "membername"))
>     public class Member implements Serializable
>     {
>        @Logger private static Log log;
>        :
>        public void setMemberName(String memberName)
>        {
>           log.info("setting memberName");
>           this.memberName = memberName;
>        }
>        :
>     }
> At least, that's what I've found; when not declaring it static it will not get injected or is lost (I'm not sure which), and thus would yield a NullPointerException upon usage.
> Likewise, "22.2. Annotations for bijection" at http://fisheye.jboss.com/browse/JBoss/jboss-seam/doc/reference/en/modules/annotations.xml?r=1.55#l355 now states
>     Specifies that a component field is to be injected with an instance of org.jboss.seam.log.Log.
> ...but maybe this could be extended to read:
>     Specifies that a component field is to be injected with an instance of org.jboss.seam.log.Log.
>     Remember that for entity beans the actual variable needs to be declared static.
> Cheers,
> Arjan.

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

        



More information about the seam-issues mailing list