001/*
002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     vpasquier <vpasquier@nuxeo.com>
016 */
017
018package org.nuxeo.ecm.automation.core.trace;
019
020import java.util.Map;
021
022import org.nuxeo.ecm.automation.OperationContext;
023import org.nuxeo.ecm.automation.OperationType;
024import org.nuxeo.ecm.automation.core.impl.ChainTypeImpl;
025import org.nuxeo.ecm.automation.core.impl.InvokableMethod;
026
027/**
028 * Automation tracer recording lightweight automation execution traces when mode deactivated.
029 *
030 * @since 5.7.3
031 */
032public class TracerLite extends Tracer {
033
034    protected TracerLite(TracerFactory factory) {
035        super(factory, true);
036    }
037
038    @Override
039    public void onOperation(OperationContext context, OperationType type, InvokableMethod method,
040            Map<String, Object> parms) {
041        if (type instanceof ChainTypeImpl) {
042            pushContext(type);
043            return;
044        }
045        Call call = new Call(chain, null, type, null, null);
046        calls.add(call);
047    }
048
049}