/*
(non-Javadoc)
@see net.roboconf.target.api.TargetHandler#configureMachine(
net.roboconf.target.api.TargetHandlerParameters, java.lang.String)
541967
@Override
	public void configureMachine( TargetHandlerParameters parameters, String machineId )
	throws TargetException {

		// It may require to be configured from the DM => add the right marker
		parameters.getScopedInstance().data.put( Instance.READY_FOR_CFG_MARKER, "true" );
		this.logger.fine( "Configuring machine '" + machineId + "'..." );
	}
1290592
@Override
	public void configure(Configuration parameters) {
		super.configure(parameters);
		
		if (charsetName == null || !Charset.isSupported(charsetName)) {
			throw new RuntimeException("Unsupported charset: " + charsetName);
		}
		
		this.decoder = Charset.forName(charsetName).newDecoder();
		this.byteWrapper = ByteBuffer.allocate(1);
	}
436102
@Override
	public boolean isMachineRunning( TargetHandlerParameters parameters, String machineId )
	throws TargetException {

		boolean result;
		try {
			final ServiceInstance vmwareServiceInstance = getServiceInstance( parameters.getTargetProperties());
			VirtualMachine vm = getVirtualMachine( vmwareServiceInstance, machineId );
			result = vm != null;

		} catch( Exception e ) {
			throw new TargetException( e );
		}

		return result;
	}
644594
@Override
    protected void configure()
    {
        final ExportBuilder builder = MBeanModule.newExporter(binder());
        builder.export(ScribeSender.class).as("eventtracker:name=ScribeSender");
        install(new CollectorControllerMBeanModule());
    }
746471
public void configure(CmsObject cms) {

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_TOOLMANAGER_CREATED_0));
        }
        if (m_roots.getObject(ROOTKEY_DEFAULT) == null) {
            CmsToolRootHandler defToolRoot = new CmsToolRootHandler();
            defToolRoot.setKey(ROOTKEY_DEFAULT);
            defToolRoot.setUri(CmsWorkplace.PATH_WORKPLACE + "admin/");
            defToolRoot.setName("${key." + Messages.GUI_ADMIN_VIEW_ROOT_NAME_0 + "}");
            defToolRoot.setHelpText("${key." + Messages.GUI_ADMIN_VIEW_ROOT_HELP_0 + "}");
            addToolRoot(defToolRoot);
        }
        m_tools.clear();
        m_urls.clear();
        Iterator<CmsToolRootHandler> it = getToolRoots().iterator();
        while (it.hasNext()) {
            CmsToolRootHandler toolRoot = it.next();
            if (!cms.existsResource(toolRoot.getUri())) {
                if (CmsLog.INIT.isInfoEnabled()) {
                    CmsLog.INIT.info(
                        Messages.get().getBundle().key(
                            Messages.INIT_TOOLMANAGER_ROOT_SKIPPED_2,
                            toolRoot.getKey(),
                            toolRoot.getUri()));
                }
                continue;
            }
            try {
                toolRoot.setup(cms, null, toolRoot.getUri());
                configureToolRoot(cms, toolRoot);
                // log info
                if (CmsLog.INIT.isInfoEnabled()) {
                    CmsLog.INIT.info(
                        Messages.get().getBundle().key(Messages.INIT_TOOLMANAGER_SETUP_1, toolRoot.getKey()));
                }
            } catch (CmsException e) {
                // log failure
                if (CmsLog.INIT.isWarnEnabled()) {
                    CmsLog.INIT.warn(
                        Messages.get().getBundle().key(Messages.INIT_TOOLMANAGER_SETUP_ERROR_1, toolRoot.getKey()),
                        e);
                }
            }
        }
    }
39501
private void configure(Map<String, Object> configuration) throws IOException {
        List<TaskConfig> configList = new ArrayList<TaskConfig>();
        configList.addAll(parseConfig(configuration));
        for (TaskConfig taskConfig : configList) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Task config " + this, taskConfig);
            }
            if (taskConfig.getEnabled()) {
                //Create the task, set the configuration and add it to the map if it's not already present.
                Task task = new TaskImpl();
                if (task != null) {
                    //Check if task already exist (by check if the source id is already in the taskMap)
                    //if not, we set the task with the new config and get appropriate handler based on the type of source
                    //else, we simply replace the config in the original task with the modified config
                    if (!taskMap.containsKey(taskConfig.sourceId())) {
                        task.setHandlerName(getHandlerName());
                        task.setConfig(taskConfig);
                        taskMap.putIfAbsent(taskConfig.sourceId(), task);
                    } else {
                        taskMap.get(taskConfig.sourceId()).setConfig(taskConfig);
                    }
                }
            }
        }
    }
297517
@Override
    public void configure(String parameters) {
        if (parameters.isEmpty()) {
            return;
        }
        setValue(Op.toDouble(parameters));
    }
137097
private void configure(){
		addDecorator(ServiceStats.class, new ServiceStatsDecorator());
		addDecorator(ActionStats.class, new ActionStatsDecorator());
		addDecorator(ServletStats.class, new ServletStatsDecorator());
		addDecorator(FilterStats.class, new FilterStatsDecorator());
		addDecorator(CacheStats.class, new CacheStatsDecorator());
		addDecorator(StorageStats.class, new StorageStatsDecorator());
		addDecorator(MemoryStats.class, new MemoryStatsDecorator());
		addDecorator(MemoryPoolStats.class, new MemoryPoolStatsDecorator());
		addDecorator(VirtualMemoryPoolStats.class, new MemoryPoolStatsDecorator("VirtualMemoryPool"));
		addDecorator(ThreadCountStats.class, new ThreadCountDecorator());
		addDecorator(ThreadStateStats.class, new ThreadStatesDecorator());
		addDecorator(OSStats.class, new OSStatsDecorator());
		addDecorator(RuntimeStats.class, new RuntimeStatsDecorator());
		addDecorator(PageInBrowserStats.class, new PageInBrowserStatsDecorator());
		addDecorator(ErrorStats.class, new ErrorStatsDecorator());
		addDecorator(GCStats.class, new GCStatsDecorator());

		//counters
		addDecorator(CounterStats.class, new CounterStatsDecorator());
		addDecorator(MaleFemaleStats.class, new MaleFemaleStatsDecorator());
		addDecorator(GuestBasicPremiumStats.class, new GuestBasicPremiumStatsDecorator());

		//session
		addDecorator(SessionCountStats.class, new SessionCountDecorator());
	}
675255
@Override
	public void configure(ConfigParams config) throws ConfigException {
		ConfigParams dependencies = config.getSection("dependencies");
		for (String name : dependencies.keySet()) {
			String locator = dependencies.get(name);
			if (locator == null)
				continue;

			try {
				Descriptor descriptor = Descriptor.fromString(locator);
				if (descriptor != null)
					_dependencies.put(name, descriptor);
				else
					_dependencies.put(name, locator);
			} catch (Exception ex) {
				_dependencies.put(name, locator);
			}
		}
	}
982202
@Override
	public void configure(Configuration parameters) {
		super.configure(parameters);

		if (charsetName == null || !Charset.isSupported(charsetName)) {
			throw new RuntimeException("Unsupported charset: " + charsetName);
		}
	}
174601
@Override
    protected void configure() {

        // Create HK2 service locator and bind jersey injections
        ServiceLocator locator = ServiceLocatorFactory.getInstance().create(null);
        bind(ServiceLocator.class).toInstance(locator);

        bind(VertxContainer.class).to(DefaultVertxContainer.class);
        bind(JerseyServer.class).to(GuiceJerseyServer.class);
        bind(JerseyHandler.class).to(DefaultJerseyHandler.class);
        bind(JerseyOptions.class).to(DefaultJerseyOptions.class);
        bind(JerseyServerOptions.class).to(DefaultJerseyOptions.class);
        bind(ContainerResponseWriterProvider.class).to(VertxResponseWriterProvider.class);
        bind(MessageBodyWriter.class).to(WriteStreamBodyWriter.class).in(Singleton.class);
        bind(ApplicationConfigurator.class).toProvider(Providers.of(null));

        Multibinder.newSetBinder(binder(), VertxRequestProcessor.class);
        Multibinder.newSetBinder(binder(), VertxResponseProcessor.class);
        Multibinder.newSetBinder(binder(), VertxPostResponseProcessor.class);

        Multibinder.newSetBinder(binder(), ContainerRequestFilter.class);
        Multibinder.newSetBinder(binder(), ContainerResponseFilter.class);
        Multibinder.newSetBinder(binder(), ReaderInterceptor.class);
        Multibinder.newSetBinder(binder(), WriterInterceptor.class);
        Multibinder.newSetBinder(binder(), ModelProcessor.class);
        Multibinder.newSetBinder(binder(), ContainerLifecycleListener.class);
        Multibinder.newSetBinder(binder(), ApplicationEventListener.class);
        Multibinder.newSetBinder(binder(), ExceptionMapper.class);

    }
1147842
static void setConfig(String configName) throws Exception {
		Handler.configName = configName;
		config = (HandlerConfig) Config.getInstance().getJsonObjectConfig(configName, HandlerConfig.class);
		initHandlers();
		initPaths();
	}
1245390
@Deprecated
    public static void configure (TextBoxBase target, String defaultText)
    {
        DefaultTextListener listener = new DefaultTextListener(target, defaultText);
        target.addFocusHandler(listener);
        target.addBlurHandler(listener);
    }
12045
@Override
    protected void configure() {

        // Bind the vertx and container instances
        bind(vertx).to(Vertx.class);

        // Request and read stream
        bindFactory(VertxRequestReferencingFactory.class).to(HttpServerRequest.class).in(PerLookup.class);
        bindFactory(VertxRequestReferencingFactory.class).to(new TypeLiteral<ReadStream<HttpServerRequest>>() {
        }).in(PerLookup.class);
        bindFactory(ReferencingFactory.<HttpServerRequest>referenceFactory()).to(new TypeLiteral<Ref<HttpServerRequest>>() {
        }).in(RequestScoped.class);

        // Response
        bindFactory(VertxResponseReferencingFactory.class).to(HttpServerResponse.class).in(PerLookup.class);
        bindFactory(ReferencingFactory.<HttpServerResponse>referenceFactory()).to(new TypeLiteral<Ref<HttpServerResponse>>() {
        }).in(RequestScoped.class);

    }
271484
@Override
	public void configure(Configuration parameters) {
		super.configure(parameters);
		
		String delimString = parameters.getString(RECORD_DELIMITER, null);
		if (delimString != null) {
			String charsetName = parameters.getString(RECORD_DELIMITER_ENCODING, null);

			if (charsetName == null) {
				setDelimiter(delimString);
			} else {
				try {
					setDelimiter(delimString, charsetName);
				}
				catch (UnsupportedCharsetException e) {
					throw new IllegalArgumentException("The charset with the name '" + charsetName + 
							"' is not supported on this TaskManager instance.", e);
				}
			}
		}
		
		// set the number of samples
		String samplesString = parameters.getString(NUM_STATISTICS_SAMPLES, null);
		if (samplesString != null) {
			try {
				setNumLineSamples(Integer.parseInt(samplesString));
			}
			catch (NumberFormatException e) {
				if (LOG.isWarnEnabled()) {
					LOG.warn("Invalid value for number of samples to take: " + samplesString + ". Skipping sampling.");
				}
				setNumLineSamples(0);
			}
		}
	}
1127011
public void setTargetResolver( ITargetHandlerResolver targetHandlerResolver ) {

		if( targetHandlerResolver == null ) {
			this.targetConfigurator.setTargetHandlerResolver( this.defaultTargetHandlerResolver );
			this.instancesMngr.setTargetHandlerResolver( this.defaultTargetHandlerResolver );
		} else {
			this.targetConfigurator.setTargetHandlerResolver( targetHandlerResolver );
			this.instancesMngr.setTargetHandlerResolver( targetHandlerResolver );
		}
	}
437773
protected void config() {
		objectMapper.configure(com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);
		objectMapper.configure(com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER, true);
	}