/** * Copyright (C) 2010 INRIA, University of Lille 1 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact: frascati@ow2.org * * Author: Christophe Demarey * * Contributor(s): */ package com.programmez.sca.intent; import org.osoa.sca.annotations.Property; import org.ow2.frascati.tinfi.control.intent.IntentHandler; import org.ow2.frascati.tinfi.control.intent.IntentJoinPoint; /** * A basic log intent. */ public class Log implements IntentHandler { /** * A configurable header to add to log traces. */ @Property protected String header; // -------------------------------------------------------------------------- // Implementation of the IntentHandler interface // -------------------------------------------------------------------------- @Override public Object invoke(IntentJoinPoint ijp) throws Throwable { // // Before the current invocation. // System.err.println(header + " Before proceed"); // // Proceed the current invocation. // Object ret = ijp.proceed(); System.err.println(header + " result of proceed:" + (ret==null ? "null" : ret.toString())); // // After the current invocation. // System.err.println(header + " After proceed"); return ret; } }