@Override public void deployPlugin(Classpath classpath, Set<Permission> permissions) throws LimbusException { checkState(); deploymentsLock.lock(); try { _deployPlugin(classpath, permissions); } finally { deploymentsLock.unlock(); } }
@Override public void undeployPlugin(Classpath classpath) throws UndeployVetoException { checkState(); deploymentsLock.lock(); try { _undeployPlugin(classpath); } finally { deploymentsLock.unlock(); } }
@Override public <T extends LimbusPlugin> T getPlugin(Classpath classpath, String classname, Class<T> expectedType) throws LimbusException, NoSuchDeploymentException { checkState(); return getPlugin(classpath, classname, expectedType, null); }
@Override public Classpath getSharedClasspath() { checkState(); return sharedClassPathProvider.getSharedClasspath(); }
@Override public <T extends LimbusPlugin> T getPlugin(Classpath classpath, String classname, Class<T> expectedType, LimbusLifecycleHook<T> lifecycleHook) throws LimbusException, NoSuchDeploymentException { checkState(); if (deploymentMap.containsKey(classpath)) { Deployment deployment = deploymentMap.get(classpath); return deployment.getPlugin(classname, expectedType, lifecycleHook); } else { throw new NoSuchDeploymentException("The specified classpath is not deployed on this container."); } }
@Override public LimbusContext getLimbusContext(Classpath classpath) throws NoSuchDeploymentException { checkState(); if (deploymentMap.containsKey(classpath)) { Deployment deployContext = deploymentMap.get(classpath); return deployContext.getLimbusContext(); } else { throw new NoSuchDeploymentException("The specified classpath is not deployed on this container."); } }
@Override public Set<Classpath> getPluginClasspaths() { checkState(); Set<Classpath> deployedClasspaths = new HashSet<>(); // Remove the shared classpath Iterator<Classpath> it = deploymentMap.keySet() .iterator(); while (it.hasNext()) { Classpath classpath = it.next(); if (classpath.equals(getSharedClasspath())) { continue; } else { deployedClasspaths.add(classpath.clone()); } } return deployedClasspaths; }