aeron-cluster/src/main/java/io/aeron/cluster/ClusteredMediaDriver.java
public static ClusteredMediaDriver launch(
        final MediaDriver.Context driverCtx,
        final Archive.Context archiveCtx,
        final ConsensusModule.Context consensusModuleCtx)
    {
        final MediaDriver driver = MediaDriver.launch(driverCtx
            .spiesSimulateConnection(true));

        final Archive archive = Archive.launch(archiveCtx
            .mediaDriverAgentInvoker(driver.sharedAgentInvoker())
            .errorHandler(driverCtx.errorHandler())
            .errorCounter(driverCtx.systemCounters().get(SystemCounterDescriptor.ERRORS)));

        final ConsensusModule consensusModule = ConsensusModule.launch(consensusModuleCtx);

        return new ClusteredMediaDriver(driver, archive, consensusModule);
    }
public static ClusteredMediaDriver launch(
        final MediaDriver.Context driverCtx,
        final Archive.Context archiveCtx,
        final ConsensusModule.Context consensusModuleCtx)
    {
        final MediaDriver driver = MediaDriver.launch(driverCtx
            .spiesSimulateConnection(true));

        final Archive archive = Archive.launch(archiveCtx
            .mediaDriverAgentInvoker(driver.sharedAgentInvoker())
            .errorHandler(driverCtx.errorHandler())
            .errorCounter(driverCtx.systemCounters().get(SystemCounterDescriptor.ERRORS)));

        final ConsensusModule consensusModule = ConsensusModule.launch(consensusModuleCtx);

        return new ClusteredMediaDriver(driver, archive, consensusModule);
    }
Launch a new {@link ClusteredMediaDriver} with provided contexts.

@param driverCtx          for configuring the {@link MediaDriver}.
@param archiveCtx         for configuring the {@link Archive}.
@param consensusModuleCtx for the configuration of the {@link ConsensusModule}.
@return a new {@link ClusteredMediaDriver} with the provided contexts.