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