Home | History | Annotate | Download | only in output
      1 /*******************************************************************************
      2  * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
      3  * All rights reserved. This program and the accompanying materials
      4  * are made available under the terms of the Eclipse Public License v1.0
      5  * which accompanies this distribution, and is available at
      6  * http://www.eclipse.org/legal/epl-v10.html
      7  *
      8  * Contributors:
      9  *    Brock Janiczak - initial API and implementation
     10  *
     11  *******************************************************************************/
     12 package org.jacoco.agent.rt.internal.output;
     13 
     14 import java.io.IOException;
     15 
     16 import org.jacoco.core.runtime.AgentOptions;
     17 import org.jacoco.core.runtime.RuntimeData;
     18 
     19 /**
     20  * Common interface for different implementations that outputs execution data
     21  * dumps.
     22  */
     23 public interface IAgentOutput {
     24 
     25 	/**
     26 	 * Configure the agent controller with the supplied options and connect it
     27 	 * to the coverage runtime
     28 	 *
     29 	 * @param options
     30 	 *            Options used to configure the agent controller
     31 	 * @param data
     32 	 *            Execution data for this agent
     33 	 * @throws Exception
     34 	 *             in case startup fails
     35 	 */
     36 	public void startup(final AgentOptions options, final RuntimeData data)
     37 			throws Exception;
     38 
     39 	/**
     40 	 * Shutdown the agent controller and clean up any resources it has created.
     41 	 *
     42 	 * @throws Exception
     43 	 *             in case shutdown fails
     44 	 */
     45 	public void shutdown() throws Exception;
     46 
     47 	/**
     48 	 * Write all execution data in the runtime to a location determined by the
     49 	 * agent controller. This method should only be called by the Agent
     50 	 *
     51 	 * @param reset
     52 	 *            if <code>true</code> execution data is cleared afterwards
     53 	 * @throws IOException
     54 	 *             in case writing fails
     55 	 */
     56 	public void writeExecutionData(boolean reset) throws IOException;
     57 
     58 }
     59