/** * Get the scaled local default timeout. */ public static synchronized long getScaledLocalDefaultTimeout(IComponentIdentifier platform, double scale) { long ret = getLocalDefaultTimeout(platform); return ret==-1 ? -1 : (long)(ret*scale); }
/** * Get the local default timeout. */ public static synchronized long getLocalDefaultTimeout(IComponentIdentifier platform) { if(platform==null) return StarterConfiguration.DEFAULT_LOCAL_TIMEOUT; platform = platform.getRoot(); return hasPlatformValue(platform, DATA_DEFAULT_LOCAL_TIMEOUT)? ((Long)getPlatformValue(platform, DATA_DEFAULT_LOCAL_TIMEOUT)).longValue(): StarterConfiguration.DEFAULT_LOCAL_TIMEOUT; }
/** * Get the scaled remote default timeout. */ public static synchronized long getScaledRemoteDefaultTimeout(IComponentIdentifier platform, double scale) { long ret = getRemoteDefaultTimeout(platform); return ret==-1 ? -1 : (long)(ret*scale); }
/** * Copy constructor. * @param config AbstractPlatformConfiguration */ public AbstractPlatformConfiguration(AbstractPlatformConfiguration config) { this.starterconfig = new StarterConfiguration(config.getStarterConfig()); this.rootconfig = new RootComponentConfiguration(config.getRootConfig()); }
public static void parseArgs(String[] args, AbstractPlatformConfiguration config) { for(int i=0; args!=null && i<args.length; i+=2) { parseArg(args[i], args[i+1], config); } }
/** * Returns a PlatformConfiguration with the default parameters but without gui. * @return */ public static PlatformConfiguration getDefaultNoGui() { PlatformConfiguration config = getDefault(); config.getRootConfig().setGui(false); return config; }
/** * Check if the real time timeout flag is set for a platform. */ public static synchronized boolean isRealtimeTimeout(IComponentIdentifier platform) { // Hack!!! Should default to false? return !Boolean.FALSE.equals(getPlatformValue(platform, StarterConfiguration.DATA_REALTIMETIMEOUT)); }
public void parseArgs(String[] args) { parseArgs(args, this); }
/** * Returns a minimal platform configuration that communicates via relay. * @return */ public static PlatformConfiguration getMinimalRelayAwareness() { PlatformConfiguration config = getMinimal(); RootComponentConfiguration rootConfig = config.getRootConfig(); rootConfig.setAwareness(true); rootConfig.setAwaMechanisms(RootComponentConfiguration.AWAMECHANISM.relay); rootConfig.setAwaFast(true); // Make sure awareness finds other platforms quickly rootConfig.setRelayTransport(true); rootConfig.setSecurity(true); // enable security when remote comm. return config; }
public static void parseArg(String okey, String val, AbstractPlatformConfiguration config) { String key = okey.startsWith("-")? okey.substring(1): okey; Object value = val; if(!StarterConfiguration.RESERVED.contains(key)) { // if not reserved, value is parsed and written to root config. try { value = SJavaParser.evaluateExpression(val, null); } catch(Exception e) { System.out.println("Argument parse exception using as string: "+key+" \""+val+"\""); } config.getRootConfig().setValue(key, value); } config.getStarterConfig().parseArg(key, val, value); }
public void parseArg(String key, String val) { parseArg(key, val, this); }
/** * Returns a PlatformConfiguration with the default parameters. * @return */ public static PlatformConfiguration getAndroidDefault() { PlatformConfiguration config = getDefault(); RootComponentConfiguration rootConfig = config.getRootConfig(); rootConfig.setGui(false); rootConfig.setChat(false); rootConfig.setKernels(RootComponentConfiguration.KERNEL.component, RootComponentConfiguration.KERNEL.micro, RootComponentConfiguration.KERNEL.bpmn, RootComponentConfiguration.KERNEL.v3); rootConfig.setLoggingLevel(Level.INFO); // config.setDebugFutures(true); return config; }
/** * Check if the parameter copy flag is set for a platform. */ public static synchronized boolean isParameterCopy(IComponentIdentifier platform) { // not equals false to make true the default. return !Boolean.FALSE.equals(getPlatformValue(platform, StarterConfiguration.DATA_PARAMETERCOPY)); }
/** * Get the remote default timeout. */ public static synchronized long getRemoteDefaultTimeout(IComponentIdentifier platform) { if(platform==null) return StarterConfiguration.DEFAULT_REMOTE_TIMEOUT; platform = platform.getRoot(); return hasPlatformValue(platform, DATA_DEFAULT_REMOTE_TIMEOUT)? ((Long)getPlatformValue(platform, DATA_DEFAULT_REMOTE_TIMEOUT)).longValue(): StarterConfiguration.DEFAULT_REMOTE_TIMEOUT; }
/** * Create a platform configuration. * @param args The command line arguments. * @return StarterConfiguration * @deprecated since 3.0.7. Use other processArgs methods instead. */ @Deprecated public static PlatformConfiguration processArgs(Map<String, String> args) { PlatformConfiguration config = new PlatformConfiguration(); // ?! hmm needs to be passed as parameter also? if(args!=null) { for(Map.Entry<String, String> arg: args.entrySet()) { parseArg(arg.getKey(), arg.getValue(), config); } } return config; }
PlatformConfiguration config = getDefault(); RootComponentConfiguration rootConfig = config.getRootConfig(); rootConfig.setWelcome(false);
/** * Create a platform configuration. * @param args The command line arguments. * @return StarterConfiguration */ public static PlatformConfiguration processArgs(String[] args) { PlatformConfiguration config = new PlatformConfiguration(args); if(args!=null) { for(int i=0; args!=null && i<args.length; i+=2) { parseArg(args[i], args[i+1], config); } } config.getRootConfig().setProgramArguments(args); return config; }