private void _deployPlugin(Classpath classpath, Set<Permission> permissions) throws LimbusException { if (deploymentMap.containsKey(classpath)) { return; } log.info("Deploy process started for plugin classpath."); LimbusUtil.logClasspath("plugin", classpath, log); LimbusUtil.logPermissions("plugin", permissions, log); PluginClassLoader pluginClassLoader = new PluginClassLoader(filesystem, sharedClassLoader, classpath.getClasspath()); pluginClassLoader.setPermissions(permissions); Deployment deployment = new Deployment(classpath, pluginClassLoader); deploymentMap.put(classpath, deployment); _deployClasspath(deployment); log.info("Deploy process finished successfully."); if (classpath.hasDeployName()) { deploynames.put(classpath.getDeployName(), classpath); } // Notify deployment subscribers deploymentListeners.multicastSilently() .classpathDeployed(classpath); }
@Override protected void performInitialize() throws Exception { // schuettec - 05.04.2017 : In earlier versions this was done in Engine Launcher. Workarounds.executePreventiveWorkarounds(); this.deploymentListeners = EventMulticasterFactory.create(DeploymentListener.class); this.referenceObserver = new LimbusReferenceObserver<ClassLoader>(); this.referenceObserver.initialize(); this.deploymentMap = new ConcurrentHashMap<Classpath, Deployment>(); this.deploynames = new ConcurrentHashMap<String, Classpath>(); // Deploy all components from shared classpath sharedClassPathProvider.checkClasspath(); Classpath sharedClasspath = sharedClassPathProvider.getSharedClasspath(); this.sharedClassLoader = new SharedClassLoader(filesystem, LimbusEngine.class.getClassLoader(), getAllowedPackagePrefixes(), sharedClasspath.getClasspath()); Deployment sharedDeployment = new Deployment(sharedClasspath, sharedClassLoader); deploymentMap.put(sharedClasspath, sharedDeployment); try { _deployClasspath(sharedDeployment); } catch (Exception e) { // If plugins from shared classpath fail to deploy we are not forced to shutdown the whole engine. log.warn("Error while deploying plugins from shared classpath.", e); } }