Refine search
if (opts.containsKey("help") || opts.containsKey("-help")) { return false; if (opts.containsKey("p")) opts.remove("p"); } else { for(String s : anchors ) { Options clonedOptions = (Options) opts.clone(); clonedOptions.setProperty("properties", s); ret &= launchRunnable(clonedOptions, runnable);
/** * Create enhancer flags from the given options. */ private static PCEnhancer.Flags toFlags(Options opts) { PCEnhancer.Flags flags = new PCEnhancer.Flags(); flags.addDefaultConstructor = opts.removeBooleanProperty ("addDefaultConstructor", "AddDefaultConstructor", flags.addDefaultConstructor); flags.enforcePropertyRestrictions = opts.removeBooleanProperty ("enforcePropertyRestrictions", "EnforcePropertyRestrictions", flags.enforcePropertyRestrictions); return flags; }
/** * Set a map of properties to pass to the {@link InitialContext} * constructor for JNDI lookups. Implementation of * {@link GenericConfigurable}. */ public void setInto(Options opts) { if (opts != null && !opts.isEmpty()) { _ctxProps = new Properties(); _ctxProps.putAll(opts); opts.clear(); } else _ctxProps = null; }
public static void authenticate(ServiceClient client) { Options option = client.getOptions(); HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator(); auth.setUsername("admin"); auth.setPassword("admin"); auth.setPreemptiveAuthentication(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, auth); option.setManageSession(true); }
String props = opts.removeProperty("properties", "p", null); ConfigurationProvider provider; if (!StringUtils.isEmpty(props)) { if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper .isFileAction(file))).booleanValue()) provider = ProductDerivations.load(file, anchor, null); else { file = new File("META-INF" + File.separatorChar + path); if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper .isFileAction(file))).booleanValue()) provider = ProductDerivations.load(file, anchor, null); provider.setInto(conf); opts.setInto(conf);
getFullyQualifiedAnchorsInPropertiesLocation(opts); for (String a : anchors) { Options clonedOptions = (Options) opts.clone(); clonedOptions.setProperty("properties", a); OpenJPAConfiguration conf = new OpenJPAConfigurationImpl(); Configurations.populateConfiguration(conf, clonedOptions); .doPrivileged(J2DoPrivHelper .newTemporaryClassLoaderAction(AccessController .doPrivileged(J2DoPrivHelper.getContextClassLoaderAction()) )); conf.setClassResolver(new ClassResolver() {
flags.packageName = opts.removeProperty ("package", "pkg", flags.packageName); flags.directory = Files.getFile (opts.removeProperty("directory", "d", null), null); flags.useSchemaName = opts.removeBooleanProperty ("useSchemaName", "sn", flags.useSchemaName); flags.useForeignKeyName = opts.removeBooleanProperty ("useForeignKeyName", "fkn", flags.useForeignKeyName); flags.nullableAsObject = opts.removeBooleanProperty ("nullableAsObject", "no", flags.nullableAsObject); flags.blobAsObject = opts.removeBooleanProperty ("blobAsObject", "bo", flags.blobAsObject); flags.useGenericCollections = opts.removeBooleanProperty ("useGenericCollections", "gc", flags.useGenericCollections); flags.primaryKeyOnJoin = opts.removeBooleanProperty ("primaryKeyOnJoin", "pkj", flags.primaryKeyOnJoin); flags.useDataStoreIdentity = opts.removeBooleanProperty ("useDatastoreIdentity", "ds", flags.useDataStoreIdentity); flags.useBuiltinIdentityClass = opts.removeBooleanProperty ("useBuiltinIdentityClass", "bic", flags.useBuiltinIdentityClass); flags.innerIdentityClasses = opts.removeBooleanProperty ("innerIdentityClasses", "inn", flags.innerIdentityClasses); flags.identityClassSuffix = opts.removeProperty ("identityClassSuffix", "is", flags.identityClassSuffix); flags.inverseRelations = opts.removeBooleanProperty ("inverseRelations", "ir", flags.inverseRelations); flags.detachable = opts.removeBooleanProperty ("detachable", "det", flags.detachable); flags.discriminatorStrategy = opts.removeProperty
throws ClassNotFoundException, IOException { File dir = Files.getClassFile(ProxyManagerImpl.class); dir = (dir == null) ? new File((String) AccessController.doPrivileged( J2DoPrivHelper.getPropertyAction("user.dir"))) : dir.getParentFile(); Options opts = new Options(); args = opts.setFromCmdLine(args); int utils = opts.removeIntProperty("utils", "u", 0); if (utils >= 4) { types.addAll(Arrays.asList(new String[] { final Class fCls = cls; bc = (BCClass) AccessController .doPrivileged(new PrivilegedAction() { public Object run() { return mgr.generateProxyBeanBytecode(fCls, false);
throws IOException, ClassNotFoundException { Flags flags = new Flags(); flags.ignoreErrors = opts.removeBooleanProperty ("ignoreErrors", "i", flags.ignoreErrors); flags.directory = Files.getFile(opts.removeProperty("directory", "d", null), null); flags.token = opts.removeProperty("token", "t", flags.token); flags.name = opts.removeProperty("name", "n", flags.name); flags.suffix = opts.removeProperty("suffix", "s", flags.suffix); Options formatOpts = new Options(); Map.Entry entry; String key; for (Iterator itr = opts.entrySet().iterator(); itr.hasNext();) { entry = (Map.Entry) itr.next(); key = (String) entry.getKey(); if (key.startsWith("codeFormat.")) { formatOpts.put(key.substring(11), entry.getValue()); itr.remove(); } else if (key.startsWith("cf.")) { formatOpts.put(key.substring(3), entry.getValue()); itr.remove(); if (!formatOpts.isEmpty()) { flags.format = new CodeFormat(); formatOpts.setInto(flags.format);
for (Iterator<?> itr = defaults.entrySet().iterator(); itr.hasNext();) { entry = (Map.Entry) itr.next(); if (!containsKey(entry.getKey())) setInto(obj, entry); for (Iterator<?> itr = entrySet().iterator(); itr.hasNext();) { e = (Map.Entry) itr.next(); if (!setInto(obj, e)) { if (invalidEntries == null) invalidEntries = new Options(); invalidEntries.put(e.getKey(), e.getValue());
public static void main(String[] args) { Options opts = new Options(); args = opts.setFromCmdLine(args); boolean devpath = opts.getBooleanProperty("scanDevPath", "ScanDevPath", true); ConfigurationProvider cp = new MapConfigurationProvider(opts); BrokerFactory factory = Bootstrap.newBrokerFactory(cp, null); try { MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance( factory, devpath); if (args.length != 1) { usage(); return; } if ("store".equals(args[0])) maint.store(); else if ("dump".equals(args[0])) maint.dump(); else usage(); } finally { factory.close(); } }
public static void premain(String args, Instrumentation inst) { Options opts = Configurations.parseProperties(args); if (opts.containsKey("ClassLoadEnhancement") || opts.containsKey("classLoadEnhancement")) { if (opts.getBooleanProperty( "ClassLoadEnhancement", "classLoadEnhancement", true)) registerClassLoadEnhancer(inst, opts); } else if (opts.containsKey("RuntimeEnhancement") || opts.containsKey("runtimeEnhancement")) { // Deprecated property setting if (opts.getBooleanProperty( "RuntimeEnhancement", "runtimeEnhancement", true)) registerClassLoadEnhancer(inst, opts); } else { // if neither is set, then we should be turning it on. We need this // logic instead of just a getBooleanProperty() because of the // backwards-compat logic flow. registerClassLoadEnhancer(inst, opts); } if (opts.getBooleanProperty( "RuntimeRedefinition", "runtimeRedefinition", true)) { InstrumentationFactory.setInstrumentation(inst); } else { InstrumentationFactory.setDynamicallyInstallAgent(false); } }
if (values.isEmpty()) throw new MetaDataException(_loc.get("no-external-values", this, _extString)); Map extValues = new HashMap((int) (values.size() * 1.33 + 1)); Map fieldValues = new HashMap((int) (values.size() * 1.33 + 1)); Map.Entry entry; Object extValue, fieldValue; for (Iterator itr = values.entrySet().iterator(); itr.hasNext();) { entry = (Map.Entry) itr.next(); fieldValue = transform((String) entry.getKey(),
public void setInto(Options opts) { if (!opts.isEmpty()) { Map.Entry<Object, Object> e; for (Iterator<Map.Entry<Object, Object>> iter = opts.entrySet().iterator(); iter.hasNext();) { e = iter.next(); _configuredLevels.put(shorten((String) e.getKey()), Short.valueOf(getLevel((String) e.getValue()))); } opts.clear(); } }
if (opts.containsKey("ThreadFactory")) { String fName = opts.getProperty("ThreadFactory"); try { factory = (ThreadFactory) Class.forName(fName).newInstance(); throw new UserException(_loc.get("bad-thread-factory", fName), t); } finally { opts.removeProperty("ThreadFactory"); } else if ("fixed".equals(cls)) { long keepAliveTime = 60L; if (opts.containsKey("KeepAliveTime")) { keepAliveTime = opts.getLongProperty("KeepAliveTime"); opts.removeLongProperty("KeepAliveTime");
@Override public void initialize() { Options opts = new Options(); if (getOptions() != null) { opts = Configurations.parseProperties(getOptions()); } String cacheName = opts.getProperty("name",null); OpenJPAConfiguration conf = (OpenJPAConfiguration)getProvider().getConfiguration(); DataCacheManager dcm = conf.getDataCacheManagerInstance(); DataCache dc = null; if (cacheName == null || cacheName.trim().length() == 0) { dc = dcm.getSystemDataCache(); } else { dc = dcm.getDataCache(cacheName); } if (dc == null) { throw new UserException(_loc.get("data-cache-not-found")); } setDataCache(dc); setDataCacheManager(dcm); setConfigId(conf.getId()); setContextRef(Integer.toString(System.identityHashCode(getContext()))); }
/** * Specialization of {@link Properties#removeProperty} to allow * a value to appear under either of two keys; useful for short and * long versions of command-line flags. */ public String removeProperty(String key, String key2, String def) { String val = removeProperty(key); return (val == null) ? removeProperty(key2, def) : val; }
// Turn off the Axsis Chunked feature, some service providers (like .Net) don't support chunked headers. Options options = serviceClient.getOptions(); options.setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE); serviceClient.setOptions(options);