@Override public void configure(ContainerClassLoader containerClassLoader, PipedOutputStream pipedOutputStream, PipedInputStream pipedInputStream, OptionsByType optionsByType) { ClassName className = optionsByType.getOrSetDefault(ClassName.class, ClassName.of(DEFAULT_CACHE_SERVER_CLASSNAME)); ContainerBasedJavaApplicationLauncher.configureRemoteChannel(containerClassLoader, pipedOutputStream, pipedInputStream, className.getName()); } }
/** * Obtains a {@link ClassName} for a specified name. * * @param name the name of the {@link ClassName} * * @return a {@link ClassName} for the specified name */ public static ClassName of(String name) { return new ClassName(name); }
@Override default DisplayName getDisplayName(OptionsByType optionsByType) { ClassName className = optionsByType.get(ClassName.class); if (className == null) { return optionsByType.get(DisplayName.class); } else { // determine the short class name of the class we're launching (as a possible default) String shortClassName = className.getName(); int lastDot = shortClassName.lastIndexOf("."); shortClassName = lastDot <= 0 ? shortClassName : shortClassName.substring(lastDot + 1); if (shortClassName.isEmpty()) { return optionsByType.get(DisplayName.class); } else { return optionsByType.getOrSetDefault(DisplayName.class, DisplayName.of(shortClassName)); } } } }
@Override public void onLaunching(Platform platform, OptionsByType optionsByType) { optionsByType.add(ClassName.of(JUnitTestRunner.class)); optionsByType.addIfAbsent(DisplayName.of("JUnit")); }
@Override default DisplayName getDisplayName(OptionsByType optionsByType) { ClassName className = optionsByType.get(ClassName.class); if (className == null) { return optionsByType.get(DisplayName.class); } else { // determine the short class name of the class we're launching (as a possible default) String shortClassName = className.getName(); int lastDot = shortClassName.lastIndexOf("."); shortClassName = lastDot <= 0 ? shortClassName : shortClassName.substring(lastDot + 1); if (shortClassName.isEmpty()) { return optionsByType.get(DisplayName.class); } else { return optionsByType.getOrSetDefault(DisplayName.class, DisplayName.of(shortClassName)); } } } }
@Override public void onLaunching(Platform platform, OptionsByType optionsByType) { optionsByType.add(ClassName.of(JUnitTestRunner.class)); optionsByType.addIfAbsent(DisplayName.of("JUnit")); }
@Override public void configure(ContainerClassLoader containerClassLoader, PipedOutputStream pipedOutputStream, PipedInputStream pipedInputStream, OptionsByType optionsByType) { ClassName className = optionsByType.getOrSetDefault(ClassName.class, ClassName.of(DEFAULT_CACHE_SERVER_CLASSNAME)); ContainerBasedJavaApplicationLauncher.configureRemoteChannel(containerClassLoader, pipedOutputStream, pipedInputStream, className.getName()); } }
String applicationClassName = className.getName();
optionsByType.addIfAbsent(ClassName.of(DEFAULT_CACHE_SERVER_CLASSNAME));
/** * Obtains a {@link ClassName} for a specified name. * * @param name the name of the {@link ClassName} * * @return a {@link ClassName} for the specified name */ public static ClassName of(String name) { return new ClassName(name); }
@Override public void configure(ContainerClassLoader containerClassLoader, PipedOutputStream pipedOutputStream, PipedInputStream pipedInputStream, OptionsByType optionsByType) { ClassName className = optionsByType.getOrSetDefault(ClassName.class, ClassName.of(DEFAULT_CACHE_SERVER_CLASSNAME)); ContainerBasedJavaApplicationLauncher.configureRemoteChannel(containerClassLoader, pipedOutputStream, pipedInputStream, className.getName()); } }
String applicationClassName = className.getName();
optionsByType.addIfAbsent(ClassName.of(DEFAULT_CACHE_SERVER_CLASSNAME));
/** * Obtains a {@link ClassName} for a specified {@link Class}. * * @param classToUse the {@link Class} to use for determining the {@link ClassName} * * @return a {@link ClassName} for the specified {@link Class} */ public static ClassName of(Class<?> classToUse) { if (classToUse == null) { throw new IllegalArgumentException("ClassName's can't be null"); } else { return new ClassName(classToUse.getName()); } }
String applicationClassName = className.getName();
optionsByType.addIfAbsent(ClassName.of(DEFAULT_CACHE_SERVER_CLASSNAME));
/** * Obtains a {@link ClassName} for a specified {@link Class}. * * @param classToUse the {@link Class} to use for determining the {@link ClassName} * * @return a {@link ClassName} for the specified {@link Class} */ public static ClassName of(Class<?> classToUse) { if (classToUse == null) { throw new IllegalArgumentException("ClassName's can't be null"); } else { return new ClassName(classToUse.getName()); } }
String applicationClassName = className.getName();
String applicationClassName = className.getName();