1 package org.objectweb.celtix.tools.common.toolspec; 2 3 import java.util.logging.Level ; 4 import java.util.logging.Logger ; 5 6 import org.objectweb.celtix.common.logging.LogUtils; 7 import org.objectweb.celtix.tools.common.ToolException; 8 public class ToolSupport implements Tool { 9 10 private static final Logger LOG = LogUtils.getL7dLogger(ToolSupport.class); 11 private ToolContext ctx; 12 13 public void init() throws ToolException { 14 if (LOG.isLoggable(Level.INFO)) { 15 LOG.info("Initializing " + this); 16 } 17 } 18 19 public void setContext(ToolContext c) { 20 if (LOG.isLoggable(Level.INFO)) { 21 LOG.info("Setting context to " + c); 22 } 23 this.ctx = c; 24 } 25 26 public ToolContext getContext() { 27 return ctx; 28 } 29 30 public void performFunction() throws ToolException { 31 if (LOG.isLoggable(Level.INFO)) { 32 LOG.info("Performing function"); 33 } 34 } 35 36 public void destroy() throws ToolException { 37 if (LOG.isLoggable(Level.INFO)) { 38 LOG.info("Destroying " + this); 39 } 40 } 41 } 42 | Popular Tags |