View Javadoc

1   package org.sonatype.aether;
2   
3   /*******************************************************************************
4    * Copyright (c) 2010-2011 Sonatype, Inc.
5    * All rights reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    *   http://www.eclipse.org/legal/epl-v10.html
9    *******************************************************************************/
10  
11  /**
12   * A trace of nested requests that are performed by the repository system. This trace information can be used to
13   * correlate repository events with higher level operations in the application code that eventually caused the events. A
14   * single trace can carry an arbitrary object as data which is meant to describe a request/operation that is currently
15   * executed. For call hierarchies within the repository system itself, this data will usually be the {@code *Request}
16   * object that is currently processed. When invoking methods on the repository system, client code may provide a request
17   * trace that has been prepopulated with whatever data is useful for the application to indicate its state for later
18   * evaluation when processing the repository events.
19   * 
20   * @author Benjamin Bentmann
21   * @see RepositoryEvent#getTrace()
22   */
23  public interface RequestTrace
24  {
25  
26      /**
27       * Gets the data associated with this trace.
28       * 
29       * @return The data associated with this trace or {@code null}.
30       */
31      Object getData();
32  
33      /**
34       * Gets the parent of this trace.
35       * 
36       * @return The parent of this trace or {@code null} if this is the root of the trace stack.
37       */
38      RequestTrace getParent();
39  
40      /**
41       * Creates a new child of this trace.
42       * 
43       * @param data The data to associate with the child, may be {@code null}.
44       * @return The child trace, never {@code null}.
45       */
46      RequestTrace newChild( Object data );
47  
48  }