Search in sources :

Example 1 with ProvisioningLayout

use of org.jboss.galleon.layout.ProvisioningLayout in project galleon by wildfly.

the class GetInfoCommand method runCommand.

@Override
protected void runCommand(PmCommandInvocation invoc) throws CommandExecutionException {
    try {
        Function<ProvisioningLayout<FeaturePackLayout>, FeatureContainer> supplier = new Function<ProvisioningLayout<FeaturePackLayout>, FeatureContainer>() {

            public FeatureContainer apply(ProvisioningLayout<FeaturePackLayout> layout) {
                try {
                    return getFeatureContainer(invoc.getPmSession(), layout);
                } catch (CommandExecutionException | ProvisioningException | IOException ex) {
                    throw new RuntimeException(ex);
                }
            }
        };
        ProvisioningManager mgr = getManager(invoc.getPmSession());
        StateInfoUtil.displayInfo(invoc, mgr.getInstallationHome(), mgr.getProvisioningConfig(), type, supplier);
    } catch (ProvisioningException | CommandExecutionException ex) {
        throw new CommandExecutionException(invoc.getPmSession(), CliErrors.infoFailed(), ex);
    }
}
Also used : Function(java.util.function.Function) FeaturePackLayout(org.jboss.galleon.layout.FeaturePackLayout) ProvisioningManager(org.jboss.galleon.ProvisioningManager) ProvisioningException(org.jboss.galleon.ProvisioningException) FeatureContainer(org.jboss.galleon.cli.model.FeatureContainer) CommandExecutionException(org.jboss.galleon.cli.CommandExecutionException) IOException(java.io.IOException) ProvisioningLayout(org.jboss.galleon.layout.ProvisioningLayout)

Example 2 with ProvisioningLayout

use of org.jboss.galleon.layout.ProvisioningLayout in project galleon by wildfly.

the class StateGetInfoCommand method runCommand.

@Override
protected void runCommand(PmCommandInvocation invoc) throws CommandExecutionException {
    try {
        ProvisioningConfig config = invoc.getPmSession().getContainer().getProvisioningConfig();
        Function<ProvisioningLayout<FeaturePackLayout>, FeatureContainer> supplier = new Function<ProvisioningLayout<FeaturePackLayout>, FeatureContainer>() {

            public FeatureContainer apply(ProvisioningLayout<FeaturePackLayout> layout) {
                return invoc.getPmSession().getState().getContainer();
            }
        };
        StateInfoUtil.displayInfo(invoc, null, config, type, supplier);
    } catch (Exception ex) {
        throw new CommandExecutionException(invoc.getPmSession(), CliErrors.infoFailed(), ex);
    }
}
Also used : ProvisioningConfig(org.jboss.galleon.config.ProvisioningConfig) Function(java.util.function.Function) FeaturePackLayout(org.jboss.galleon.layout.FeaturePackLayout) FeatureContainer(org.jboss.galleon.cli.model.FeatureContainer) CommandExecutionException(org.jboss.galleon.cli.CommandExecutionException) ProvisioningLayout(org.jboss.galleon.layout.ProvisioningLayout) CommandExecutionException(org.jboss.galleon.cli.CommandExecutionException)

Aggregations

Function (java.util.function.Function)2 CommandExecutionException (org.jboss.galleon.cli.CommandExecutionException)2 FeatureContainer (org.jboss.galleon.cli.model.FeatureContainer)2 FeaturePackLayout (org.jboss.galleon.layout.FeaturePackLayout)2 ProvisioningLayout (org.jboss.galleon.layout.ProvisioningLayout)2 IOException (java.io.IOException)1 ProvisioningException (org.jboss.galleon.ProvisioningException)1 ProvisioningManager (org.jboss.galleon.ProvisioningManager)1 ProvisioningConfig (org.jboss.galleon.config.ProvisioningConfig)1