public InputStreamWrapper(InputStream delegate) { super(); Lang.denyNull("delegate", delegate); this.delegate = delegate; }
public ThreadSensitiveRecorderStream(OutputStream delegate) { Lang.denyNull("delegate", delegate); this.delegate = delegate; this.recordSubscriber = new ConcurrentHashMap<ClassloaderThreadID, ByteArrayOutputStream>(); }
@Override public boolean hasClasspath(String deployName) { Lang.denyNull("deployName", deployName); return deploynames.containsKey(deployName); }
protected void setDelegate(OutputStream delegate) { Lang.denyNull("delegate", delegate); delegateLock.lock(); try { this.delegate = delegate; } finally { delegateLock.unlock(); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) static void addThreadLocals(Set<ThreadLocal> threadLocalsSet) { Lang.denyNull("ThreadLocals", threadLocalsSet); for (ThreadLocal threadLocal : threadLocalsSet) { // Stores a new thread local in the current thread threadLocal.set(threadLocal.get()); } }
public SharedClassLoader(LimbusFileService filesystem, ClassLoader parent, List<String> accessiblePackages, URLStreamHandlerFactory factory, URL... urls) { super(filesystem, parent, factory, urls); Lang.denyNull("accessiblePackages", accessiblePackages); Lang.denyNull("urls", urls); deactivateCleaning(); allowedPackagePrefixes = new ArrayList<String>(accessiblePackages); }
public SharedClassLoader(LimbusFileService filesystem, ClassLoader parent, List<String> accessiblePackages, Set<URL> urls) { super(filesystem, parent, urls); Lang.denyNull("accessiblePackages", accessiblePackages); Lang.denyNull("urls", urls); deactivateCleaning(); allowedPackagePrefixes = new ArrayList<String>(accessiblePackages); }
public SharedClassLoader(LimbusFileService filesystem, ClassLoader parent, List<String> accessiblePackages, URL... urls) { super(filesystem, parent, urls); Lang.denyNull("accessiblePackages", accessiblePackages); Lang.denyNull("urls", urls); deactivateCleaning(); allowedPackagePrefixes = new ArrayList<String>(accessiblePackages); }
@Override public void unschedulePeriodicTask(Task task) { Lang.denyNull("task", task); if (tasks.containsKey(task)) { TaskExecution taskExecution = tasks.get(task); tasks.remove(task); taskExecution.cancel(); } else { throw new NoSuchElementException("Attempt to unschedule an unknown task."); } }
Deployment(Classpath classpath, PluginClassLoader classloader) { Lang.denyNull("Classpath", classpath); Lang.denyNull("Classloader", classloader); this.classpath = classpath; this.pluginRegistry = new ConcurrentHashMap<String, LimbusPlugin>(); this.limbusContext = new LimbusContextInternal(classloader); this.lifecycleMulticaster = EventMulticasterFactory.create(LimbusPlugin.class); this.strongReferences = new LinkedList<>(); }
@Override public Classpath getClasspath(String deployName) throws NoSuchDeploymentException { // buschmann - 04.05.2017 : No blocking synchronization to improve performance. Note: This section is threadsafe // because a ConcurrentHashMap is used. This results in returning the last seen state. Lang.denyNull("deployName", deployName); if (deploynames.containsKey(deployName)) { return deploynames.get(deployName); } else { throw new NoSuchDeploymentException(String.format("A deployment with the name %s does not exist.", deployName)); } }
public <T extends Enum<T>> T getEnum(String key, Class<T> enumType) { Lang.denyNull("key", key); Lang.denyNull("enumType", enumType); _checkKey(key); try { return Enum.valueOf(enumType, getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public float getFloat(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Float.parseFloat(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public long getLong(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Long.parseLong(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public boolean getBoolean(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Boolean.parseBoolean(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public double getDouble(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Double.parseDouble(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public int getInt(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Integer.parseInt(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
@Override public void schedulePeriodicTask(Task task, Function<Boolean, Long> scheduleRateFunction) { Lang.denyNull("task", task); Lang.denyNull("scheduleRateFunction", scheduleRateFunction); checkState(); TaskExecution execution = new TaskExecution(this, task, scheduleRateFunction); Long initialRate = getInitialRate(scheduleRateFunction); execution.setCurrentRate(initialRate); ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(execution, 0, initialRate, TimeUnit.MILLISECONDS); execution.setFuture(future); tasks.put(task, execution); }
public LimbusSecurityManager(LimbusFileService filesystem) { Lang.denyNull("filesystem", filesystem); try { this.properties = new LimbusProperties(filesystem, LimbusSecurityManager.class, true, false); } catch (Exception e) { throw new LimbusSecurityException( "Cannot initialize Limbus Security Manager due to missing default configuration."); } init(); }