class OakMachine {

    final void processEmbeddedPackage(final @NotNull Session admin,
                                      final @NotNull JcrPackageManager manager,
                                      final @NotNull EmbeddedPackageInstallable installable,
                                      final boolean preInstall) throws RepositoryException {
        final Consumer<Exception> onError =
                error -> getErrorListener().onSlingEmbeddedPackageError(error, installable);
        Fun.ThrowingSupplier<JcrPackage> supplier = slingSimulator.open(installable);
        internalProcessSubpackage(admin, manager, installable.getEmbeddedId(), preInstall, supplier,
                check -> check.identifyEmbeddedPackage(
                        installable.getEmbeddedId(),
                        installable.getParentId(),
                        installable),
                onError);
    }

    private  OakMachine(final Packaging packagingService,
                       final List<ProgressCheck> progressChecks,
                       final ErrorListener errorListener,
                       final List<URL> preInstallUrls,
                       final List<InitStage> initStages,
                       final JcrCustomizer jcrCustomizer,
                       final InstallHookProcessorFactory installHookProcessorFactory,
                       final ClassLoader installHookClassLoader,
                       final boolean enablePreInstallHooks,
                       final InstallHookPolicy scanInstallHookPolicy,
                       final Supplier<NodeStore> nodeStoreSupplier,
                       final SubpackageSilencer subpackageSilencer,
                       final RepoInitProcessor repoInitProcessor,
                       final SlingSimulatorBackend slingSimulator,
                       final Set<String> runModes);

}