Search in sources :

Example 1 with ClientLaunchType

use of org.glassfish.appclient.client.acc.CommandLaunchInfo.ClientLaunchType in project Payara by payara.

the class AppClientFacade method createContainer.

private static AppClientContainer createContainer(final Builder builder, final CommandLaunchInfo launchInfo, final AppclientCommandArguments appClientArgs) throws Exception, UserError {
    /*
         * The launchInfo already knows something about how to conduct the
         * launch.
         */
    ClientLaunchType launchType = launchInfo.getClientLaunchType();
    AppClientContainer container;
    switch(launchType) {
        case JAR:
        case DIR:
            /*
                 * The client name in the launch info is a file path for the
                 * directory or JAR to launch.
                 */
            container = createContainerForAppClientArchiveOrDir(builder, launchInfo.getClientName(), appClientArgs.getMainclass(), appClientArgs.getName());
            break;
        case URL:
            container = createContainerForJWSLaunch(builder, launchInfo.getClientName(), appClientArgs.getMainclass(), appClientArgs.getName());
            break;
        case CLASS:
            container = createContainerForClassName(builder, launchInfo.getClientName());
            break;
        case CLASSFILE:
            container = createContainerForClassFile(builder, launchInfo.getClientName());
            break;
        default:
            container = null;
    }
    if (container == null) {
        throw new IllegalArgumentException("cannot choose app client launch type");
    }
    return container;
}
Also used : AppClientContainer(org.glassfish.appclient.client.acc.AppClientContainer) ClientLaunchType(org.glassfish.appclient.client.acc.CommandLaunchInfo.ClientLaunchType)

Aggregations

AppClientContainer (org.glassfish.appclient.client.acc.AppClientContainer)1 ClientLaunchType (org.glassfish.appclient.client.acc.CommandLaunchInfo.ClientLaunchType)1