View Javadoc

1   /*
2    * $Id: LoggingActionHandler.java 7963 2007-08-21 08:53:15Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.providers.bpm.jbpm.actions;
12  
13  import org.apache.commons.logging.Log;
14  import org.apache.commons.logging.LogFactory;
15  import org.jbpm.graph.def.ActionHandler;
16  import org.jbpm.graph.exe.ExecutionContext;
17  
18  public abstract class LoggingActionHandler implements ActionHandler
19  {
20      protected transient Log logger = LogFactory.getLog(getClass());
21  
22      public void execute(ExecutionContext executionContext) throws Exception
23      {
24          if (logger.isDebugEnabled())
25          {
26              String currentNode = "???";
27              if (executionContext.getNode() != null)
28              {
29                  currentNode = executionContext.getNode().getFullyQualifiedName();
30              }
31              logger.debug("Executing action " + this.getClass().getName() + " from state \"" + currentNode
32                              + "\"");
33          }
34      }
35  }