commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Commons Wiki] Update of "Logging/StaticLog" by JörgSchaible
Date Mon, 20 Aug 2007 06:50:37 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification.

The following page has been changed by JörgSchaible:
http://wiki.apache.org/jakarta-commons/Logging/StaticLog

The comment on the change is:
Add readResolve approach

------------------------------------------------------------------------------
  Like static members, transient ones are not part of the serialized data so this should be
  a serialization-compatible change.
  
+ Another approach is to implement the readResolve method that is automatically called at
deserialization time if present:
+ {{{
+   private transient Log log = LogFactory.getLog(Some.class);
+   private Object readResolve() {
+      log = LogFactory.getLog(Some.class);
+      return this;
+   }
+ }}}
+ See javadoc of Serializable interface for further information.
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message