User: phox    
  Date: 01/02/24 13:13:44

  Modified:    log4j/src/main/org/jboss/contrib/log4j Log4jService.java
  Log:
  Added constructor to start using configureAndWatch.
  
  Revision  Changes    Path
  1.2       +12 -1     contrib/log4j/src/main/org/jboss/contrib/log4j/Log4jService.java
  
  Index: Log4jService.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/contrib/log4j/src/main/org/jboss/contrib/log4j/Log4jService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Log4jService.java 2001/02/23 22:56:09     1.1
  +++ Log4jService.java 2001/02/24 21:13:44     1.2
  @@ -33,11 +33,19 @@
   // Attributes ----------------------------------------------------
     private String configuration;
     private Category cat;
  +  private int timeout;
  +  private boolean refreshFlag;
   
   // Constructors --------------------------------------------------
     public Log4jService(String _path) {
       configuration = _path;
  +    refreshFlag = false;
     }
  +  public Log4jService(String _path,int _timeout) {
  +    configuration = _path;
  +    timeout = _timeout;
  +    refreshFlag = true;
  +  }
   
   // Public --------------------------------------------------------
     public void handleNotification(Notification n,java.lang.Object handback) { 
  @@ -72,7 +80,10 @@
                                   throws java.lang.Exception {
       server.addNotificationListener(
         new ObjectName(server.getDefaultDomain(),"service","Log"),this,null,null);
  -    PropertyConfigurator.configure(configuration);
  +    if (refreshFlag)
  +      PropertyConfigurator.configureAndWatch(configuration,timeout);
  +    else
  +      PropertyConfigurator.configure(configuration);
       cat = Category.getRoot();
       return name == null ? new ObjectName(OBJECT_NAME) : name;
     }
  
  
  

Reply via email to