1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package stats; 25 26 import share.LogWriter; 27 /** 28 * 29 * @author sw93809 30 */ 31 public class SimpleOutProducer implements LogWriter { 32 33 34 /** initialization, here a filename might be given 35 * or a dbUrL 36 */ initialize(share.DescEntry entry, boolean active)37 public boolean initialize(share.DescEntry entry, boolean active) { 38 return true; 39 } 40 41 /** Method to print 42 */ println(String msg)43 public void println(String msg) { 44 45 } 46 47 /** will mostly be used by outproducers to sum up 48 * the information, maybe write them to a db 49 */ summary(share.DescEntry entry)50 public boolean summary(share.DescEntry entry) { 51 String header = "***** State for "+entry.longName+" ******"; 52 System.out.println(header); 53 if (entry.hasErrorMsg) { 54 System.out.println(entry.ErrorMsg); 55 System.out.println("Whole "+entry.EntryType+": "+entry.State); 56 } else { 57 System.out.println("Whole "+entry.EntryType+": "+entry.State); 58 } 59 for (int i=0;i<header.length();i++) { 60 System.out.print("*"); 61 } 62 System.out.println(""); 63 return true; 64 } 65 getWatcher()66 public Object getWatcher() { 67 return null; 68 } 69 setWatcher(Object watcher)70 public void setWatcher(Object watcher) { 71 } 72 73 } 74