/**
 * Copyright 2016-2017 The OpenTracing Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package io.opentracing;

import java.io.Closeable;

/**
 * In any execution context (or any thread, etc), there is at most one "activeSpan" {@link Span} primarily responsible
 * for the work accomplished by the surrounding application code. That active Span may be accessed via the
 * {@link ActiveSpanSource#activeSpan()} method. If the application needs to defer work that should be part of the same
 * Span, the Source provides a {@link ActiveSpan#defer} method that returns a {@link Continuation}; this continuation
 * may be used to re-activate and continue the {@link Span} in that other asynchronous executor and/or thread.
 *
 * <p>
 * {@link ActiveSpan}s are created via {@link Tracer.SpanBuilder#startActive()} or {@link ActiveSpanSource#adopt}. They
 * can be {@link ActiveSpan#defer()}ed as {@link ActiveSpan.Continuation}s, then re-{@link Continuation#activate()}d
 * later.
 *
 * @see ActiveSpanSource
 */
public interface ActiveSpan extends Closeable, Span {
    /**
     * Mark the end of the activeSpan period for the {@link Span} pinned by this {@link ActiveSpan}. When the last
     * {@link ActiveSpan} is deactivated for a given {@link Span}, it is automatically {@link Span#finish()}ed.
     * <p>
     * <p>
     * NOTE: It is an error to call deactivate() more than once on a single {@link ActiveSpan}.
     *
     * @see Closeable#close() {@link ActiveSpan}s are auto-closeable and may be used in try-with-resources blocks
     */
    void deactivate();

    /**
     * "Fork" a new {@link Continuation} associated with this {@link ActiveSpan} and {@link Span}, as well as any
     * 3rd-party execution context of interest.
     * <p>
     * <p>
     * The associated {@link Span} will not {@link Span#finish()} while a {@link Continuation} is outstanding; in
     * this way, it provides a reference/pin just like an @{ActiveSpan} does.
     *
     * @return a new {@link Continuation} to {@link Continuation#activate()} at the appropriate time.
     */
    Continuation defer();

    /**
     * A {@link Continuation} can be used *once* to activate a Span along with any non-OpenTracing execution context
     * (e.g., MDC), then deactivate when processing activity moves on to another Span. (In practice, this activeSpan
     * period typically extends for the length of a deferred async closure invocation.)
     *
     * <p>
     * Most users do not directly interact with {@link Continuation}, {@link Continuation#activate()} or
     * {@link ActiveSpan#deactivate()}, but rather use {@link ActiveSpanSource}-aware Runnables/Callables/Executors.
     * Those higher-level primitives need not be defined within the OpenTracing core API, and so they are not.
     *
     * <p>
     * NOTE: {@link Continuation} extends {@link Closeable} rather than AutoCloseable in order to keep support
     * for JDK1.6.
     *
     * @see ActiveSpanSource#adopt(Span)
     */
    interface Continuation {
        /**
         * Make the Span (and other execution context) encapsulated by this Continuation activeSpan and return it.
         *
         * <p>
         * NOTE: It is an error to call activate() more than once on a single Continuation instance.
         *
         * @see ActiveSpanSource#adopt(Span)
         * @return a handle to the newly-activated Span
         */
        ActiveSpan activate();
    }

}

@@ -734,26 +734,44 @@
 tive
+%22 %7B@link 
 Span
-%22 
+%7D/
 %7B@link 
+Active
 Span%7D
+%0A *
  pri
@@ -788,19 +788,16 @@
 ponsible
-%0A *
  for the
@@ -861,26 +861,36 @@
 hat 
-a
+@%7Blink A
 ctive
- 
 Span
+%7D
  may be
+%0A *
  acc
@@ -902,19 +902,16 @@
  via the
-%0A *
  %7B@link 
@@ -1002,16 +1002,19 @@
 hould be
+%0A *
  part of
@@ -1022,19 +1022,16 @@
 the same
-%0A *
  Span, t
@@ -1119,16 +1119,19 @@
 uation%7D;
+%0A *
  this co
@@ -1140,19 +1140,16 @@
 inuation
-%0A *
  may be 
@@ -1233,16 +1233,19 @@
 executor
+%0A *
  and/or 
@@ -1636,20 +1636,16 @@
 e active
-Span
  period 
@@ -1833,35 +1833,24 @@
 %0A     * %3Cp%3E%0A
-     * %3Cp%3E%0A
      * NOTE:
@@ -1931,16 +1931,25 @@
 iveSpan%7D
+ instance
 .%0A     *
@@ -2276,27 +2276,16 @@
   * %3Cp%3E%0A
-     * %3Cp%3E%0A
      * T
@@ -3383,16 +3383,23 @@
 er than 
+%7B@code 
 AutoClos
@@ -3403,16 +3403,17 @@
 loseable
+%7D
  in orde

Make javadoc work and fix some documentation bugs