1 4 package org.oddjob.monitor.model; 5 6 import org.oddjob.OJConstants; 7 import org.oddjob.arooa.ArooaContext; 8 import org.oddjob.arooa.Lifecycle; 9 import org.oddjob.logging.ConsoleArchiver; 10 import org.oddjob.logging.LocalConsoleArchiver; 11 import org.oddjob.logging.Log4jArchiver; 12 import org.oddjob.logging.LogArchiver; 13 import org.oddjob.util.ThreadManager; 14 15 20 public class ExplorerModel { 21 23 24 private Object root; 25 26 27 private ArooaContext arooaContext; 28 29 30 private String logFormat; 31 32 33 private ThreadManager threadManager; 34 35 36 private LogArchiver logArchiver; 37 38 39 private ConsoleArchiver consoleArchiver; 40 41 42 48 public void setRoot(Object rootNode) { 49 this.root = rootNode; 50 logArchiver = new Log4jArchiver(rootNode, 51 logFormat == null ? OJConstants.DEFAULT_LOG_FORMAT : logFormat); 52 consoleArchiver = new LocalConsoleArchiver(rootNode); 53 } 54 55 60 public Object getRoot() { 61 return root; 62 } 63 64 69 public void setThreadManager(ThreadManager threadManager) { 70 this.threadManager = threadManager; 71 } 72 73 78 public ThreadManager getThreadManager() { 79 return threadManager; 80 } 81 82 88 public void setArooaContext(ArooaContext arooaContext) { 89 this.arooaContext = arooaContext; 90 } 91 92 98 public ArooaContext getArooaContext() { 99 return arooaContext; 100 } 101 102 106 public void destroy() { 107 Lifecycle.destroy(logArchiver); 108 Lifecycle.destroy(consoleArchiver); 109 } 110 111 116 public String getLogFormat() { 117 return logFormat; 118 } 119 120 125 public void setLogFormat(String logFormat) { 126 this.logFormat = logFormat; 127 } 128 129 138 public LogArchiver getLogArchiver() { 139 return logArchiver; 140 } 141 142 151 public ConsoleArchiver getConsoleArchiver() { 152 return consoleArchiver; 153 } 154 } 155 | Popular Tags |