/** * Grants a set of default permission for the classpath of the deployment. * * @return Returns this object for method chainging. */ public LimbusStaging grantDefaultPermissions() { stage.addAllPermission(getDefaultPermissions()); return this; }
/** * @return Returns a new {@link ThreadSnapshot} containing the currently active threads. JVM system threads are * filtered and not part of the thread snapshot. * @see #snapshot(boolean) */ public static ThreadSnapshot snapshot() { return snapshot(true); }
/** * Bootstraps a Limbus System engine that utilizes {@link LimbusSystem} to create a * runtime environment of components. * * @param system * The uninitialized configured {@link LimbusSystem} * @throws Exception * Thrown on any error while bootstrapping. */ public static void bootstrapLimbusSystem(LimbusSystem system) throws Exception { SystemEngine engine = new SystemEngine(system); bootstrap(engine); }
public static PrintStream getOriginalSystemErr() { redirectOnDemand(); return new PrintStream(new WrappedOutputStream(originalSystemErr), true); }
public static void resetSystemOut() { if (originalSystemOut != null) { redirectSystemOut(originalSystemOut); } }
@Override public final void startEngine() throws Exception { // Start engine observer startEngineObserver(); // Initialize engine initialize(); }
public static void resetSystemError() { if (originalSystemErr != null) { redirectSystemError(originalSystemErr); } }
private LimbusStaging(String deployName) { this.stage = new LimbusStage(); this.stage.setDeployName(deployName); }
@Override protected OutputStream getDefaultTargetStdOut() { return EngineLauncher.getOriginalSystemOut(); }
@Override protected OutputStream createStdErrTarget(String deployName) { return EngineLauncher.getOriginalSystemErr(); }
/** * Grants a permission for the classpath of the deployment. * * @param permission * The permission to grant for the classpath. * @return Returns this object for method chainging. */ public LimbusStaging grantPermission(Permission permission) { stage.addPermission(permission); return this; }
private static void redirectOnDemand() { if (originalSystemOut == null || originalSystemErr == null) { redirectSystemOuts(); } }
/** * @return Returns the {@link LimbusSystem} represented by {@link MockLimbusSystem} that allows to add mocked system * components as well as real system components. */ public LimbusSystemStaging withComponents() { return new LimbusSystemStaging(stage); }
/** * @param deployName * An optional deploy name. * @return Creates and returns a new {@link LimbusStaging} object. */ public static LimbusStaging create(String deployName) { return new LimbusStaging(deployName); }
protected WrappedOutputStream(OutputStream delegate) { setDelegate(delegate); }
/** * Bootstraps a Limbus System engine that utilizes {@link LimbusSystem} and a valid system description to create a * runtime environment of components. The system descriptor is specified via {@link InputStream}. * * @param systemDescriptor * The input stream representing the XML system descriptor. * * @throws SerializeException * Thrown if the {@link LimbusSystem} cannot be created from the specified system descriptor. * @throws Exception * Thrown on any error while bootstrapping. */ public static void bootstrapLimbusSystem(InputStream systemDescriptor) throws SerializeException, Exception { SystemEngine engine = new SystemEngine(systemDescriptor); bootstrap(engine); }
public static PrintStream getOriginalSystemOut() { redirectOnDemand(); return new PrintStream(new WrappedOutputStream(originalSystemOut), true); }
/** * @param filterJVMThreads * If <code>true</code> the JVM system threads are not part of the created snapshot. If <code>false</code> * also JVM system threads will be recorded by the thread snapshot. * @return Returns a new {@link ThreadSnapshot} containing the currently active threads. */ public static ThreadSnapshot snapshot(boolean filterJVMThreads) { return snapshot(filterJVMThreads, null); }
@Override protected OutputStream createStdOutTarget(final String deployName) { return EngineLauncher.getOriginalSystemOut(); }
@Override protected OutputStream getDefaultTargetStdErr() { return EngineLauncher.getOriginalSystemErr(); }