/** * Returns a bundle representing the system class loader. * * @param niFiProperties a NiFiProperties instance which will be used to obtain the default NAR library path, * which will become the working directory of the returned bundle * @return a bundle for the system class loader */ public static Bundle create(final NiFiProperties niFiProperties) { final ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); final String narLibraryDirectory = niFiProperties.getProperty(NiFiProperties.NAR_LIBRARY_DIRECTORY); if (StringUtils.isBlank(narLibraryDirectory)) { throw new IllegalStateException("Unable to create system bundle because " + NiFiProperties.NAR_LIBRARY_DIRECTORY + " was null or empty"); } final BundleDetails systemBundleDetails = new BundleDetails.Builder() .workingDir(new File(narLibraryDirectory)) .coordinate(SYSTEM_BUNDLE_COORDINATE) .build(); return new Bundle(systemBundleDetails, systemClassLoader); } }
final Bundle bundle = new Bundle(bundleDetail, bundleClassLoader); loadedBundles.add(bundle); additionalBundleDetailsIter.remove();
narDirectoryBundleLookup.put(narDetail.getWorkingDirectory().getCanonicalPath(), new Bundle(narDetail, jettyClassLoader)); narCoordinateClassLoaderLookup.put(narDetail.getCoordinate().getCoordinate(), jettyClassLoader); narDetailsIter.remove(); narDirectoryBundleLookup.put(narDetail.getWorkingDirectory().getCanonicalPath(), new Bundle(narDetail, bundleClassLoader)); narCoordinateClassLoaderLookup.put(narDetail.getCoordinate().getCoordinate(), narClassLoader); narDetailsIter.remove();
/** * Returns a bundle representing the system class loader. * * @param niFiProperties a NiFiProperties instance which will be used to obtain the default NAR library path, * which will become the working directory of the returned bundle * @return a bundle for the system class loader */ public static Bundle create(final NiFiProperties niFiProperties) { final ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); final String narLibraryDirectory = niFiProperties.getProperty(NiFiProperties.NAR_LIBRARY_DIRECTORY); if (StringUtils.isBlank(narLibraryDirectory)) { throw new IllegalStateException("Unable to create system bundle because " + NiFiProperties.NAR_LIBRARY_DIRECTORY + " was null or empty"); } final BundleDetails systemBundleDetails = new BundleDetails.Builder() .workingDir(new File(narLibraryDirectory)) .coordinate(SYSTEM_BUNDLE_COORDINATE) .build(); return new Bundle(systemBundleDetails, systemClassLoader); } }
/** * Returns a bundle representing the system class loader. * * @param niFiProperties a NiFiProperties instance which will be used to obtain the default NAR library path, * which will become the working directory of the returned bundle * @return a bundle for the system class loader */ public static Bundle create(final NiFiProperties niFiProperties) { final ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); final String narLibraryDirectory = niFiProperties.getProperty(NiFiProperties.NAR_LIBRARY_DIRECTORY); if (StringUtils.isBlank(narLibraryDirectory)) { throw new IllegalStateException("Unable to create system bundle because " + NiFiProperties.NAR_LIBRARY_DIRECTORY + " was null or empty"); } final BundleDetails systemBundleDetails = new BundleDetails.Builder() .workingDir(new File(narLibraryDirectory)) .coordinate(SYSTEM_BUNDLE_COORDINATE) .build(); return new Bundle(systemBundleDetails, systemClassLoader); } }
narDirectoryBundleLookup.put(narDetail.getWorkingDirectory().getCanonicalPath(), new Bundle(narDetail, bundleClassLoader)); narCoordinateClassLoaderLookup.put(narDetail.getCoordinate().getCoordinate(), narClassLoader); narDetailsIter.remove();
narDirectoryBundleLookup.put(narDetail.getWorkingDirectory().getCanonicalPath(), new Bundle(narDetail, bundleClassLoader)); narCoordinateClassLoaderLookup.put(narDetail.getCoordinate().getCoordinate(), narClassLoader); narDetailsIter.remove();