/* (non-Javadoc)
@see tuwien.auto.calimero.buffer.Configuration.NetworkFilter#init
(tuwien.auto.calimero.buffer.Configuration)
185033
@Override
	public void init(final Configuration c)
	{
		// check if we have a current model which emits change notifications
		if (model instanceof ChangeNotifier) {
			final ChangeNotifier notifier = (ChangeNotifier) model;
			notifier.removeChangeListener(cl);
		}
		final DatapointModel<?> m = c.getDatapointModel();
		if (m instanceof ChangeNotifier) {
			model = m;
			final ChangeNotifier notifier = (ChangeNotifier) m;
			notifier.addChangeListener(cl);
		}
		if (m != null)
			createReferences(m);
	}
442317
@SuppressWarnings("unchecked")
	public void init(FilterConfig c) throws ServletException {

		Properties p = new Properties();
		ServletContext sc = c.getServletContext();
		for (Enumeration e = sc.getInitParameterNames(); e.hasMoreElements();) {
			String key = (String) e.nextElement();
			p.put(key, sc.getInitParameter(key));
		}
		for (Enumeration e = c.getInitParameterNames(); e.hasMoreElements();) {
			String key = (String) e.nextElement();
			p.put(key, c.getInitParameter(key));
		}
		
		String cfgName = INCOMING_PATH;
		String incomingPath = p.getProperty(cfgName);
		if((incomingPath == null) || incomingPath.length() == 0) {
			throw new ServletException("Invalid or missing " + cfgName +
					" configuration");
		}
		incoming = new File(incomingPath);
		tmpIncoming = new File(incoming,"tmp");
		try {
			ensureDir(incoming);
			ensureDir(tmpIncoming);
		} catch (IOException e) {
			throw new ServletException(e);
		}
	}
1215143
@Override
    public void init(final Scope scope) throws InitializationException, InterruptedException {
        init(scope, RSBSharedConnectionConfig.getParticipantConfig());
    }
1051095
@PostConstruct
	protected void init() throws IOException {
		// base configuration from XML file
		if (null != configurationFile) {
			log.debug("Get base configuration from {}", configurationFile);
			manager = new DefaultCacheManager(configurationFile);
		} else {
			GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
			builder.globalJmxStatistics().allowDuplicateDomains(true);
			manager = new DefaultCacheManager(builder.build());
		}

		if (listener == null) {
			listener = new InfinispanCacheListener();
		}
		manager.addListener(listener);

		// cache for caching the cache configurations (hmmm, sounds a bit strange)
		Map<String, Map<CacheCategory, CacheService>> cacheCache = 
				new HashMap<String, Map<CacheCategory, CacheService>>();

		// build default configuration
		if (null != defaultConfiguration) {
			setCaches(cacheCache, null, defaultConfiguration);
		}

		// build layer specific configurations
		for (Layer layer : layerMap.values()) {
			CacheInfo ci = configurationService.getLayerExtraInfo(layer.getLayerInfo(), CacheInfo.class);
			if (null != ci) {
				setCaches(cacheCache, layer, ci);
			}
		}
	}
934133
public void init(String url, String user, String pass) {
		init(url, user, pass, null);
	}
1018566
@Override
	public void init(String jsonString) throws IndexerException {
		try {
			config = new JsonSimpleConfig(jsonString);
			init();
		} catch (IOException e) {
			throw new IndexerException(e);
		}
	}
1035833
public void init(Configuration configuration)
			throws Exception
	{
		LOGGER.debug("Initializing AbstractBundleInterceptor");

		localizationBundleFactory = configuration.getLocalizationBundleFactory();

		findResourceBundleFactory(configuration);
	}
283754
@Override
    public void init(final FilterConfig filterConfig) throws ServletException {

        // verify there are no init parameters configured that are not recognized
        // since an unrecognized init param might be the adopter trying to configure this filter in
        // an important way
        // and accidentally ignoring that intent might have security implications.
        final Enumeration initParamNames = filterConfig.getInitParameterNames();
        throwIfUnrecognizedParamName(initParamNames);

        final String initParamAllowMultiValuedParameters =
                filterConfig.getInitParameter(ALLOW_MULTI_VALUED_PARAMETERS);
        final String initParamParametersToCheck =
                filterConfig.getInitParameter(PARAMETERS_TO_CHECK);
        final String initParamCharactersToForbid =
                filterConfig.getInitParameter(CHARACTERS_TO_FORBID);

        try {
            this.allowMultiValueParameters =
                    parseStringToBooleanDefaultingToFalse(initParamAllowMultiValuedParameters);
        } catch (final Exception e) {
            throw new ServletException(
                    "Error parsing request parameter ["
                            + ALLOW_MULTI_VALUED_PARAMETERS
                            + "] with value ["
                            + initParamAllowMultiValuedParameters
                            + "]",
                    e);
        }

        try {
            this.parametersToCheck = parseParametersToCheck(initParamParametersToCheck);
        } catch (final Exception e) {
            throw new ServletException(
                    "Error parsing request parameter "
                            + PARAMETERS_TO_CHECK
                            + " with value ["
                            + initParamParametersToCheck
                            + "]",
                    e);
        }

        try {
            this.charactersToForbid = parseCharactersToForbid(initParamCharactersToForbid);
        } catch (final Exception e) {
            throw new ServletException(
                    "Error parsing request parameter "
                            + CHARACTERS_TO_FORBID
                            + " with value ["
                            + initParamCharactersToForbid
                            + "]",
                    e);
        }

        if (this.allowMultiValueParameters && this.charactersToForbid.isEmpty()) {
            throw new ServletException(
                    "Configuration to allow multi-value parameters and forbid no characters makes "
                            + getClass().getSimpleName()
                            + " a no-op, which is probably not what you want, "
                            + "so failing Filter init.");
        }
    }
768382
public void init(FilterConfig filterConfig) throws ServletException {
    ctx = filterConfig.getServletContext();
    String temp = filterConfig.getInitParameter("debug");
    debug = (String.valueOf(temp).equals("true"));
  }
495305
@Override
    public void init(FilterConfig filterConfig) throws ServletException {
        super.init(filterConfig);

        int compressionMinSize = readInt(filterConfig.getInitParameter(INIT_PARAM_COMPRESSION_THRESHOLD), this.compressionThreshold);
        long decompressMaxBytesPerSecond = readLong(filterConfig.getInitParameter(INIT_PARAM_DECOMPRESS_MAX_BYTES_PER_SECOND),
                this.decompressionRate);

        long maxDecompressedRequestSize = readLong(filterConfig.getInitParameter(INIT_PARAM_MAX_DECOMPRESSED_REQUEST_SIZE_IN_BYTES),
                this.maxDecompressedRequestSizeInBytes);

        if (compressionMinSize > 0) { // priority given to configured value
            this.compressionThreshold = compressionMinSize;
        }
        if (decompressMaxBytesPerSecond > 0) { // priority given to configured value
            this.decompressionRate = decompressMaxBytesPerSecond;
        }
        if (maxDecompressedRequestSize > 0) { // priority given to configured value
            this.maxDecompressedRequestSizeInBytes = maxDecompressedRequestSize;
        }
        LOGGER.trace("Filter initialized with: {}:{},\n{}:{}\n{}:{}", INIT_PARAM_COMPRESSION_THRESHOLD, String.valueOf(this.compressionThreshold),
                INIT_PARAM_DECOMPRESS_MAX_BYTES_PER_SECOND, String.valueOf(this.decompressionRate),
                INIT_PARAM_MAX_DECOMPRESSED_REQUEST_SIZE_IN_BYTES, String.valueOf(this.maxDecompressedRequestSizeInBytes));
    }
227481
@Override
    public void init(final Scope scope, final ParticipantConfig participantConfig) throws InitializationException, InterruptedException {
        internalInit(scope, participantConfig);
    }
642798
public synchronized void init() {
		for (SocketBinding binding : socketBindings) {
			socketBindingsMap.put(binding.getName(), binding);
		}
		for (SecurityRealm realm : securityRealms) {
			securityRealmsMap.put(realm.getName(), realm);
		}
		for (Interface iface : interfaces) {
			interfacesMap.put(iface.getName(), iface);
		}
		if (subsystem != null) {
			for (UndertowSubsystem.FileHandler handler : subsystem.getFileHandlers()) {
				handlersMap.put(handler.getName(), handler);
			}
			if (subsystem.getFilters() != null) {
				for (UndertowSubsystem.ResponseHeaderFilter filter : subsystem.getFilters().getResponseHeaders()) {
					filtersMap.put(filter.getName(), filter);
				}
				for (UndertowSubsystem.ErrorPageFilter filter : subsystem.getFilters().getErrorPages()) {
					filtersMap.put(filter.getName(), filter);
				}
				for (UndertowSubsystem.CustomFilter filter : subsystem.getFilters().getCustomFilters()) {
					filtersMap.put(filter.getName(), filter);
				}
			}
		}
	}
142089
@Override
	public void init(Configuration configuration)
	        throws Exception
	{
	    super.init(configuration);

        if (!(getLocalizationBundleFactory() instanceof JstlLocalizationBundleFactory))
        {
            BootstrapPropertyResolver propertyResolver = configuration.getBootstrapPropertyResolver();

            errorBundleName = propertyResolver.getProperty(ERROR_BUNDLE_NAME_CONFIG);
            LOGGER.debug("errorBundleName = ", errorBundleName == null ? "null" : '"' + errorBundleName + '"');

            fieldBundleName = propertyResolver.getProperty(FIELD_BUNDLE_NAME_CONFIG);
            LOGGER.debug("fieldBundleName = ", fieldBundleName == null ? "null" : '"' + fieldBundleName + '"');
        }
	}
163973
public synchronized void init(int serverPort)
    {
        if (this.initialized)
        {
            return;
        }

        String hostname = null;

        try
        {
            hostname = InetAddress.getLocalHost().getHostName();
        }
        catch (UnknownHostException ex)
        {
            logger.warn("Get host failed. Use localhost.", ex);
        }

        logger.info("WebSocket server initialize. : HostName={}, Port={}, Path={}, Object={}",
                hostname, serverPort, "/", this.toString());
        this.server = new Server(hostname, serverPort, "/", null, AmLogServerEndPoint.class);
        try
        {
            this.server.start();
        }
        catch (DeploymentException ex)
        {
            logger.warn("WebSocket server initialize failed. Skip initialize.", ex);
        }

        this.initialized = true;
    }
1322761
@Override
    public void init(String jsonString) throws TransformerException {
        try {
            setConfig(new JsonSimpleConfig(jsonString));
        } catch (IOException e) {
            throw new TransformerException(e);
        }
    }
220953
@Override
    public void init(FilterConfig filterConfig) throws ServletException {
        LOG.info("AtlasAuthenticationFilter initialization started");
        final FilterConfig globalConf = filterConfig;
        final Map<String, String> params = new HashMap<>();
        try {
            configuration = ApplicationProperties.get();
        } catch (Exception e) {
            throw new ServletException(e);
        }

        if (configuration != null) {
            headerProperties = ConfigurationConverter.getProperties(configuration.subset("atlas.headers"));
        }

        FilterConfig filterConfig1 = new FilterConfig() {
            @Override
            public ServletContext getServletContext() {
                if (globalConf != null) {
                    return globalConf.getServletContext();
                } else {
                    return nullContext;
                }
            }

            @SuppressWarnings("unchecked")
            @Override
            public Enumeration<String> getInitParameterNames() {
                return new IteratorEnumeration(params.keySet().iterator());
            }

            @Override
            public String getInitParameter(String param) {
                return params.get(param);
            }

            @Override
            public String getFilterName() {
                return "AtlasAuthenticationFilter";
            }
        };

        super.init(filterConfig1);

        optionsServlet = new HttpServlet() {
        };
        optionsServlet.init();
    }
1175127
public void init(Socket s)
  {
    _s = s;
    
    _is = null;
    _os = null;
    _needsFlush = false;
  }