/** * Constructor that creates a new Configuration based on an args object. * (which can be a Map or a String array). * Does not parse the args - no public use! * @param args */ protected AbstractPlatformConfiguration(String[] args) { starterconfig = new StarterConfiguration(); rootconfig = new RootComponentConfiguration(); rootconfig.setProgramArguments(args); }
/** * Checks this configuration for consistency errors. */ protected void checkConsistency() { starterconfig.checkConsistency(); rootconfig.checkConsistency(); }
@Override public boolean getAddress() { return getRootConfig().getAddress(); }
rootConfig.setComponentFactory(cfac); rootConfig.setPlatformAccess(component); PlatformConfiguration.putPlatformValue(cid, PlatformConfiguration.DATA_DEFAULT_REMOTE_TIMEOUT, config.getRemoteDefaultTimeout()); ComponentCreationInfo cci = new ComponentCreationInfo(model, null, rootConfig.getArgs(), desc, null, null); Collection<IComponentFeatureFactory> features = cfac.getComponentFeatures(model).get(); component.create(cci, features);
public AbstractPlatformConfiguration() { starterconfig = new StarterConfiguration(); rootconfig = new RootComponentConfiguration(); }
@Override public Map<String, Object> getArgs() { return getRootConfig().getArgs(); }
@Override public String getAwaExcludes() { return getRootConfig().getAwaExcludes(); }
@Override public String getAwaIncludes() { return getRootConfig().getAwaIncludes(); }
@Override public boolean getAsyncExecution() { return getRootConfig().getAsyncExecution(); }
@Override public RootComponentConfiguration.AWAMECHANISM[] getAwaMechanisms() { return getRootConfig().getAwaMechanisms(); }
@Override public long getAwaDelay() { return getRootConfig().getAwaDelay(); }
/** * Enhance this config with given other config. * Will overwrite all values that are set in the other config. * @param other */ public void enhanceWith(PlatformConfiguration other) { starterconfig.enhanceWith(other.getStarterConfig()); rootconfig.enhanceWith(other.getRootConfig()); }
/** * Copy constructor. * @param config AbstractPlatformConfiguration */ public AbstractPlatformConfiguration(AbstractPlatformConfiguration config) { this.starterconfig = new StarterConfiguration(config.getStarterConfig()); this.rootconfig = new RootComponentConfiguration(config.getRootConfig()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(""); Set<Map.Entry<String, Object>> entries = starterconfig.cmdargs.entrySet(); for (Map.Entry<String, Object> arg: entries) { if (!(arg.getValue() == null || arg.getValue().equals(false))) { sb.append(arg.getKey()); sb.append(": "); sb.append(arg.getValue()); sb.append("\n"); } } entries = rootconfig.getArgs().entrySet(); for (Map.Entry<String, Object> arg: entries) { if (!(arg.getValue() == null || arg.getValue().equals(false))) { sb.append(arg.getKey()); sb.append(": "); sb.append(arg.getValue()); sb.append("\n"); } } sb.append(rootconfig.toString()); return sb.toString(); }