/*
 * Copyright 2018, TeamDev. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package io.spine.system.server;

import io.spine.annotation.Internal;

/**
 * A gateway which can close the underlying system context.
 */
@Internal
public interface MasterGateway extends SystemGateway {

    /**
     * Closes the underlying system context.
     *
     * @throws Exception if the context thrown an exception when closing
     */
    void closeSystemContext() throws Exception;

    /**
     * Creates a new instance of {@code MasterGateway}.
     *
     * @param system the underlying system context
     * @return new gateway
     */
    static MasterGateway newInstance(SystemContext system) {
        return new DefaultSystemGateway(system);
    }
}

@@ -1105,20 +1105,22 @@
 ch can c
-lose
+ontrol
  the und
@@ -1143,16 +1143,143 @@
 ontext.%0A
+ *%0A * %3Cp%3ESuch a gateway, for instance, may tell the system context%0A * to %7B@link io.spine.server.BoundedContext#close() close%7D.%0A
  */%0A@Int

Add some more details on `MasterGateway`.