1 6 7 package org.jzonic.jlo; 8 9 import org.jzonic.jlo.processor.LogProcessor; 10 import org.jzonic.jlo.processor.LogProcessorFactory; 11 12 import java.util.Vector ; 13 21 public class LogPipeManager { 22 23 private static final LogProcessor processor = LogProcessorFactory.getLogProcessor(); 24 private static LogPipeManager pipeManager = new LogPipeManager(); 25 private Vector pipes; 26 27 private LogPipeManager() { 28 pipes = new Vector (); 29 } 30 31 public static LogPipeManager getInstance() { 32 return pipeManager; 33 } 34 35 public void addLogPipe(LogPipe pipe) { 36 pipes.add(pipe); 37 } 38 39 public boolean hasPipes() { 40 if ( pipes.size() > 0 ) { 41 return true; 42 } 43 return false; 44 } 45 46 public void processLogRequest(LogRecord record) { 47 for ( int i = 0; i < pipes.size(); i++) { 48 LogPipe pipe = (LogPipe)pipes.get(i); 49 if ( pipe.getFilter() != null ) { 50 } 52 else { 53 processor.processEvent(pipe.getGenerator(), record); 54 } 55 } 56 } 57 58 } 59 | Popular Tags |