/** * Creates a {@link org.ops4j.pax.exam.options.BootClasspathLibraryOption}. * * @param libraryUrl * boot classpath library url * * @return boot classpath option */ public static BootClasspathLibraryOption bootClasspathLibrary(final String libraryUrl) { return new BootClasspathLibraryOption(libraryUrl); }
/** * To be used to specify that this library should be in the classpath after framework library. * * @return itself, for fluent api usage */ public BootClasspathLibraryOption afterFramework() { append = true; return itself(); }
/** * Converts boot classpath library options into corresponding arguments (--bcp/a, --bcp/p). * * @param libraries boot classpath libraries * * @return converted Pax Runner collection of arguments */ private Collection<String> extractArguments( final BootClasspathLibraryOption[] libraries ) { final List<String> arguments = new ArrayList<String>(); for( BootClasspathLibraryOption library : libraries ) { if( library.isBeforeFramework() ) { arguments.add( "--bcp/p=" + library.getLibraryUrl().getURL() ); } else { arguments.add( "--bcp/a=" + library.getLibraryUrl().getURL() ); } } return arguments; }
private void copyBootClasspathLibraries(File karafHome, ExamSystem subsystem) throws MalformedURLException, IOException { BootClasspathLibraryOption[] bootClasspathLibraryOptions = subsystem.getOptions(BootClasspathLibraryOption.class); for (BootClasspathLibraryOption bootClasspathLibraryOption : bootClasspathLibraryOptions) { UrlReference libraryUrl = bootClasspathLibraryOption.getLibraryUrl(); FileUtils.copyURLToFile( new URL(libraryUrl.getURL()), createFileNameWithRandomPrefixFromUrlAtTarget(libraryUrl.getURL(), new File(karafHome + "/lib"), new String[]{"jar"})); } }
UrlReference libraryUrl = bootClasspathLibraryOption.getLibraryUrl(); String library = localize(libraryUrl.getURL()); if (bootClasspathLibraryOption.isAfterFramework()) { afterFrameworkClasspath.add(library);
options.add(bootClasspathLibrary(mavenBundle("org.apache.felix.karaf.jaas", "org.apache.felix.karaf.jaas.boot")).afterFramework()); options.add(bootClasspathLibrary(mavenBundle("org.apache.felix.karaf", "org.apache.felix.karaf.main")).afterFramework()); for (Enumeration e = startupProps.propertyNames(); e.hasMoreElements();) { String name = (String) e.nextElement();
/** * Converts boot classpath library options into corresponding arguments (--bcp/a, --bcp/p). * * @param libraries boot classpath libraries * * @return converted Pax Runner collection of arguments */ private Collection<String> extractArguments( final BootClasspathLibraryOption[] libraries ) { final List<String> arguments = new ArrayList<String>(); for( BootClasspathLibraryOption library : libraries ) { if( library.isBeforeFramework() ) { arguments.add( "--bcp/p=" + library.getLibraryUrl().getURL() ); } else { arguments.add( "--bcp/a=" + library.getLibraryUrl().getURL() ); } } return arguments; }
/** * Copy jars specified as BootClasspathLibraryOption in system * to the karaf lib path to make them available in the boot classpath * * @throws IOException if copy fails */ public void copyBootClasspathLibraries() throws IOException { BootClasspathLibraryOption[] bootClasspathLibraryOptions = subsystem .getOptions(BootClasspathLibraryOption.class); for (BootClasspathLibraryOption bootClasspathLibraryOption : bootClasspathLibraryOptions) { UrlReference libraryUrl = bootClasspathLibraryOption.getLibraryUrl(); FileUtils.copyURLToFile( new URL(libraryUrl.getURL()), createUnique(libraryUrl.getURL(), new File( karafHome + "/lib"), new String[] { "jar" })); } }
options.add(bootClasspathLibrary(mavenBundle("org.apache.karaf.jaas", "org.apache.karaf.jaas.boot")).afterFramework()); options.add(bootClasspathLibrary(mavenBundle("org.apache.karaf", "org.apache.karaf.main")).afterFramework()); for (Enumeration e = startupProps.propertyNames(); e.hasMoreElements();) { String name = (String) e.nextElement();
/** * Copy jars specified as BootClasspathLibraryOption in system * to the karaf lib path to make them available in the boot classpath * * @throws IOException if copy fails */ public void copyBootClasspathLibraries() throws IOException { BootClasspathLibraryOption[] bootClasspathLibraryOptions = subsystem .getOptions(BootClasspathLibraryOption.class); for (BootClasspathLibraryOption bootClasspathLibraryOption : bootClasspathLibraryOptions) { UrlReference libraryUrl = bootClasspathLibraryOption.getLibraryUrl(); FileUtils.copyURLToFile( new URL(libraryUrl.getURL()), createUnique(libraryUrl.getURL(), new File( karafHome + "/lib"), new String[] { "jar" })); } }
/** * Creates a {@link org.ops4j.pax.exam.options.BootClasspathLibraryOption}. * * @param libraryUrl * boot classpath library url * * @return boot classpath option */ public static BootClasspathLibraryOption bootClasspathLibrary(final String libraryUrl) { return new BootClasspathLibraryOption(libraryUrl); }
/** * To be used to specify that this library should be in the classpath before framework library. * * @return itself, for fluent api usage */ public BootClasspathLibraryOption beforeFramework() { append = false; return itself(); }
/** * Creates a {@link org.ops4j.pax.exam.options.BootClasspathLibraryOption}. * * @param libraryUrl * boot classpath library url * * @return boot classpath option */ public static BootClasspathLibraryOption bootClasspathLibrary(final UrlReference libraryUrl) { return new BootClasspathLibraryOption(libraryUrl); }
/** * To be used to specify that this library should be in the classpath after framework library. * * @return itself, for fluent api usage */ public BootClasspathLibraryOption afterFramework() { append = true; return itself(); }
/** * Creates a {@link org.ops4j.pax.exam.options.BootClasspathLibraryOption}. * * @param libraryUrl * boot classpath library url * * @return boot classpath option */ public static BootClasspathLibraryOption bootClasspathLibrary(final UrlReference libraryUrl) { return new BootClasspathLibraryOption(libraryUrl); }
/** * To be used to specify that this library should be in the classpath before framework library. * * @return itself, for fluent api usage */ public BootClasspathLibraryOption beforeFramework() { append = false; return itself(); }