PTLog API - 1.0

jp.ne.dti.lares.foozy.ptlog
Class LogDirector

java.lang.Object
  extended byjp.ne.dti.lares.foozy.ptlog.LogServer
      extended byjp.ne.dti.lares.foozy.ptlog.EffectiveLogServer
          extended byjp.ne.dti.lares.foozy.ptlog.IntermediateServer
              extended byjp.ne.dti.lares.foozy.ptlog.LogDirector

public class LogDirector
extends IntermediateServer

Direct logging request to appropriate log service provider.

This provides you to the way to set log service provider of some(or many) LogTap all at a time.

For example, it is assumed that your module has 4 classes which want to request logging defined as shown below:

 public class LogUtil {
     final static public LogDirector DIRECTOR = new LogDirector();
 }

 public class LogClient1 {
     final static private LogTap TAP =
     new LogTap(LogClient1.class, LogUtil.DIRECTOR);
 }

 public class LogClient2 {
     ... = new LogTap(LogClient2.class, LogUtil.DIRECTOR);
 }

 public class LogClient3 {
     ... = new LogTap(LogClient3.class, LogUtil.DIRECTOR);
 }

 public class LogClient4 {
     ... = new LogTap(LogClient4.class, LogUtil.DIRECTOR);
 }
 

Here, you can let log client classes request logging to "Log4J" service provider only by setServer with Log4jProvider.INSTANCE invocation on LogUtil.DIRECTOR of above example.

You can also chain multiple ones.


Field Summary
 
Fields inherited from class jp.ne.dti.lares.foozy.ptlog.IntermediateServer
servee_
 
Constructor Summary
LogDirector()
          Constructor.
LogDirector(LogServer server)
          Constructor.
 
Method Summary
 LogContext getContext(java.lang.Object subject)
          Get context for specified subject.
 
Methods inherited from class jp.ne.dti.lares.foozy.ptlog.IntermediateServer
getServer, setServer
 
Methods inherited from class jp.ne.dti.lares.foozy.ptlog.EffectiveLogServer
addServee_, getServees, removeServee_
 
Methods inherited from class jp.ne.dti.lares.foozy.ptlog.LogServer
addServee, fireReconfigure, getSubjectName, removeServee
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogDirector

public LogDirector()
Constructor.


LogDirector

public LogDirector(LogServer server)
Constructor.

Parameters:
server - initial server of director
Method Detail

getContext

public LogContext getContext(java.lang.Object subject)
Get context for specified subject.

This delegates request to getContext() on specified one.

Specified by:
getContext in class LogServer
Parameters:
subject - of logging.
Returns:
context for specified subject.

PTLog API - 1.0