[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-1075) Documentation enhancement for injecting Logger (make clear when static is required)
Shane Bryzak (JIRA)
jira-events at lists.jboss.org
Wed Mar 21 22:29:03 EDT 2007
[ http://jira.jboss.com/jira/browse/JBSEAM-1075?page=all ]
Shane Bryzak closed JBSEAM-1075.
--------------------------------
Fix Version/s: 1.2.1.GA
Resolution: Done
Documentation updated. For non-static logger injection, the component must be created via Component.newInstance().
> 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
> 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