Create non-blocking parser

@param configuration
@return
779567
public NonBlockingParser createNonBlockingParser(SurfingConfiguration configuration) {
        ensureSetting(configuration);
        return jsonParserAdapter.createNonBlockingParser(new SurfingContext(configuration));
    }
230025
public CacheConfigurationBuilder<K, V> add(ServiceConfiguration<?> configuration) {
    CacheConfigurationBuilder<K, V> otherBuilder = new CacheConfigurationBuilder<>(this);

    if (getExistingServiceConfiguration(configuration.getClass()) != null) {
      if (configuration instanceof DefaultCopierConfiguration) {
        DefaultCopierConfiguration<?> copierConfiguration = (DefaultCopierConfiguration<?>) configuration;
        otherBuilder.removeExistingCopierConfigFor(copierConfiguration.getType());
      } else if (configuration instanceof DefaultSerializerConfiguration) {
        DefaultSerializerConfiguration<?> serializerConfiguration = (DefaultSerializerConfiguration<?>) configuration;
        otherBuilder.removeExistingSerializerConfigFor(serializerConfiguration.getType());
      } else if (!(configuration instanceof DefaultCacheEventListenerConfiguration)) {
        throw new IllegalStateException("Cannot add a generic service configuration when another one already exists. " +
                                        "Rely on specific with* methods or make sure your remove other configuration first.");
      }
    }
    otherBuilder.serviceConfigurations.add(configuration);
    return otherBuilder;
  }
1361178
@Nonnull
	@Override
	public JmxTransConfiguration parseOptions(@Nonnull String[] args) throws OptionsException, org.apache.commons.cli.ParseException {
		CommandLineParser parser = new GnuParser();
		CommandLine cl = parser.parse(getOptions(), args);
		Option[] options = cl.getOptions();

		JmxTransConfiguration configuration = new JmxTransConfiguration();

		for (Option option : options) {
			if (option.getOpt().equals("c")) {
				configuration.setContinueOnJsonError(Boolean.parseBoolean(option.getValue()));
			} else if (option.getOpt().equals("j")) {
				File jsonDir = new File(option.getValue());
				if (jsonDir.exists() && jsonDir.isDirectory()) {
					configuration.setProcessConfigDir(jsonDir);
				} else {
					throw new OptionsException("Path to json directory is invalid: " + jsonDir);
				}
			} else if (option.getOpt().equals("f")) {
				File jsonFile = new File(option.getValue());
				if (jsonFile.exists() && jsonFile.isFile()) {
					configuration.setProcessConfigFile(jsonFile);
				} else {
					throw new OptionsException("Path to json file is invalid: " + jsonFile);
				}
			} else if (option.getOpt().equals("e")) {
				configuration.setRunEndlessly(true);
			} else if (option.getOpt().equals("s")) {
				try {
					configuration.setRunPeriod(Integer.parseInt(option.getValue()));
				} catch (NumberFormatException nfe) {
					throw new OptionsException("Seconds between server job runs must be an integer");
				}
			} else if (option.getOpt().equals("a")) {
				configuration.setAdditionalJars(option.getValuesList());
			} else if (option.getOpt().equals("h")) {
				HelpFormatter formatter = new HelpFormatter();
				formatter.printHelp("java -jar jmxtrans-all.jar", getOptions());
				configuration.setHelp(true);
			}
		}
		if ((!configuration.isHelp()) && (configuration.getProcessConfigDirOrFile() == null)) {
			throw new OptionsException("Please specify either the -f or -j option.");
		}
		return configuration;
	}
465872
public final synchronized void initialize(Map<String,String> configuration)
    {
        if(this.initialized)
        {
            throw new FaxException("Request parser already initialized.");
        }
        
        //set flag
        this.initialized=true;
        
        //initialize
        this.initializeImpl(configuration);
    }
579525
@Override
	public JacksonWrapperParser createParser(String content) {
		try {
			return new JacksonWrapperParser(innerFactory.createParser(content), getSupportedFormat());
		} catch (IOException e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
169803
public Map<String, List<? extends SipApplicationRouterInfo>> parse(String configuration) throws ParseException {
        Properties tempProperties = new Properties();
        // tempProperties.load(new StringReader(configuration)); // This needs Java 1.6
        ByteArrayInputStream stringStream = new ByteArrayInputStream(configuration.getBytes());
        try {
            tempProperties.load(stringStream);
        } catch (IOException e) {
            log.warn("Failed to update AR configuration. Will use the old properties.");
            return null;
        }
        this.properties = tempProperties;
        return parse();
    }
246218
public static DocumentContext parse(File json, Configuration configuration) throws IOException {
        return new ParseContextImpl(configuration).parse(json);
    }
587280
public <K, V> CacheProxy<K, V> createCache(String cacheName, Configuration<K, V> configuration) {
    CaffeineConfiguration<K, V> config = resolveConfigurationFor(configuration);
    return new Builder<>(cacheName, config).build();
  }
23754
@Override
  public ConfigurationParser get() {
    try {
      ConfigurationParser parser = parserConstructor.newInstance();
      parser.setConfigurationClasses(configurationClasses);
      parser.setEnvironment(System.getProperty("com.meltmedia.cadmium.environment"));
      return parser;
    } catch (Exception e) {
      logger.error("Failed to create a new ConfigurationParser Instance.", e);
      throw new RuntimeException("Failed to create a new ConfigurationParser Instance.");
    }
  }
1149021
public Configuration create(File file) {
        try {
            Configuration configuration;
            InputStream stream = new BufferedInputStream(new FileInputStream(file));
            try {
                configuration = create(stream);
            } finally {
                stream.close();
            }
            return configuration;
        } catch (IOException e) {
            throw new TextProcessorFactoryException(e);
        }
    }
193320
public void expand(Configuration configuration) {
        OperationIterator it = this.problem.getOperationIterator(configuration);
        while (it.hasNext()) {
            Configuration c = it.next().execute(configuration);
            if (!this.queue.testPresence(c)) this.queue.add(c);
        }
    }
415715
@Override
    public void applyConfiguration(@NonNull Configuration configuration) {
        if (!wasInitialised.get()) {
            globalLock.writeLock().lock();

            this.configuration = configuration;

            globalLock.writeLock().unlock();
        }
    }
114966
public Reader create(Reader input, String configuration, String defaultConfiguration) throws IOException {
    if(defaultConfiguration==null) {
      defaultConfiguration = defaultArgument;
    }
    if (configs != null && configs.size() > 0) {
      if (configuration == null && defaultConfiguration == null) {
        throw new IOException("no (default)configuration");
      } else if (configuration == null) {
        if (configs.get(defaultConfiguration) != null) {
          return create(input, configs.get(defaultConfiguration));
        } else {
          throw new IOException(
              "default configuration " + defaultConfiguration + " not available");
        }
      } else {
        MtasConfiguration config = configs.get(configuration);
        if (config == null) {
          if (defaultConfiguration != null) {
            if (configs.get(defaultConfiguration) != null) {
              return create(input, configs.get(defaultConfiguration));
            } else {
              throw new IOException("configuration " + configuration
                  + " not found and default configuration " + defaultConfiguration
                  + " not available");
            }
          } else {
            throw new IOException("configuration " + configuration
                + " not available and no default configuration");
          }
        } else {
          return create(input, config);
        }
      }
    } else if (config != null) {
      return create(input, config);
    } else {
      throw new IOException("no configuration");
    }

  }
544671
public static LambdaFactory get(LambdaFactoryConfiguration configuration) {
        JavaCompiler compiler = Optional.ofNullable(configuration.getJavaCompiler()).orElseThrow(JavaCompilerNotFoundException::new);
        return new LambdaFactory(
                configuration.getDefaultHelperClassSourceProvider(),
                configuration.getClassFactory(),
                compiler,
                configuration.getImports(),
                configuration.getStaticImports(),
                configuration.getCompilationClassPath(),
                configuration.getParentClassLoader());
    }
1305652
public static StandaloneServer createStandaloneServer(final Configuration configuration) {
        final ChainedContext context = new ChainedContext();
        context.add(new StandaloneSystemPropertyContext(configuration.getJBossHome()));
        context.add(new LoggerContext(configuration.getModuleLoader()));
        final ModuleLoader moduleLoader = configuration.getModuleLoader();

        setupVfsModule(moduleLoader);

        // Load the Embedded Server Module
        final Module embeddedModule;
        try {
            embeddedModule = moduleLoader.loadModule(MODULE_ID_EMBEDDED);
        } catch (final ModuleLoadException mle) {
            throw EmbeddedLogger.ROOT_LOGGER.moduleLoaderError(mle, MODULE_ID_EMBEDDED, moduleLoader);
        }

        // Load the Embedded Server Factory via the modular environment
        final ModuleClassLoader embeddedModuleCL = embeddedModule.getClassLoader();
        final Class<?> embeddedServerFactoryClass;
        final Class<?> standaloneServerClass;
        try {
            embeddedServerFactoryClass = embeddedModuleCL.loadClass(SERVER_FACTORY);
            standaloneServerClass = embeddedModuleCL.loadClass(StandaloneServer.class.getName());
        } catch (final ClassNotFoundException cnfe) {
            throw EmbeddedLogger.ROOT_LOGGER.cannotLoadEmbeddedServerFactory(cnfe, SERVER_FACTORY);
        }

        // Get a handle to the method which will create the server
        boolean useClMethod = true;
        Method createServerMethod;
        try {
            createServerMethod = embeddedServerFactoryClass.getMethod("create", File.class, ModuleLoader.class, Properties.class, Map.class, String[].class, ClassLoader.class);
        } catch (final NoSuchMethodException nsme) {
            useClMethod = false;
            try {
                // Check if we're using a version of WildFly Core before 6.0 which did not include the create method that accepts a class loader
                createServerMethod = embeddedServerFactoryClass.getMethod("create", File.class, ModuleLoader.class, Properties.class, Map.class, String[].class);
            } catch (final NoSuchMethodException e) {
                throw EmbeddedLogger.ROOT_LOGGER.cannotGetReflectiveMethod(e, "create", embeddedServerFactoryClass.getName());
            }
        }
        // Create the server
        Object standaloneServerImpl = createManagedProcess(ProcessType.STANDALONE_SERVER, createServerMethod, configuration, useClMethod ? embeddedModuleCL : null);
        return new EmbeddedManagedProcessImpl(standaloneServerClass, standaloneServerImpl, context);
    }
148488
public static KieServicesConfiguration newJMSConfiguration( ConnectionFactory connectionFactory, Queue requestQueue, Queue responseQueue) {
        return new KieServicesConfigurationImpl( connectionFactory, requestQueue, responseQueue );
    }
101168
public void configure(CompilerConfiguration configuration) {
        super.configure(configuration);
        this.debug = configuration.getDebug();

        if (!this.configured && this.classLoader instanceof GroovyClassLoader) {
            appendCompilerConfigurationClasspathToClassLoader(configuration, (GroovyClassLoader) this.classLoader);
        }

        this.configured = true;
    }