/*
(non-Javadoc)

@see org.apache.solr.schema.PreAnalyzedField#init(org.apache.solr.schema.
IndexSchema, java.util.Map)
335679
@Override
  public void init(IndexSchema schema, Map<String, String> args) {
    args.put(PARSER_IMPL, MtasPreAnalyzedParser.class.getName());
    super.init(schema, args);
  }
1163478
private void initializeIndexer()
    {
        if (this.indexManager.getIndexer() != null
                && this.indexManager.getIndexer().getClass().getSimpleName().equals("RedisIndexer"))
        {
            ((RedisIndexer) this.indexManager.getIndexer()).assignConnection(getConnection());
        }
    }
388136
private synchronized void initQueryBuilder() throws IOException {
        if (queryBuilder == null) {
            indexReader = DirectoryReader.open(indexDirectory);
            indexSearcher = new IndexSearcher(indexReader);
            queryBuilder = new QueryBuilder(writer.getAnalyzer());
        }
    }
717238
@PostConstruct
	public void init() {
		findBeans();
		SAXBuilder builder = new SAXBuilder();
		Document doc = null;
		try {
			doc = builder.build(getSchema().getInputStream());
			SchemaParserImpl schemaParser = new SchemaParserImpl();
			schemaParser.parse(doc);
			ParserSource parserSource = new InputStreamParserSource(getProcesses());
			
			ProcessTextProvider textProvider = new ProcessTextProvider(parserSource,schemaParser,this);
			ParsePackage parsePackage = new ParsePackage();
			parsePackage.parse(textProvider);
		} catch (Exception e) {
			throw new WorkflowException(e);
		}
		HashIdLogger.log(this,"postconstruct");
	}
1365415
public void init() {
        surnameIndex.clear();

        final RootVisitor visitor = new RootVisitor();
        mRoot.accept(visitor);
        for (final Person person : visitor.getPersons()) {
            final String key = person.getString();
            // Surname for inclusion in the index.
            // This is the string by which the person will be indexed.
            final String indexName = person.getIndexName();

            if (!indexName.isEmpty()) {
                final SortedMap<String, SortedSet<String>> names =
                        findNamesPerSurname(person.getSurname());
                final SortedSet<String> ids = findIdsPerName(indexName, names);
                ids.add(key);
            }
        }
    }
134961
@Override
    public void internalInitialize(BeanDeployerEnvironment environment) {
        super.internalInitialize(environment);
        checkEJBTypeAllowed();
        checkConflictingRoles();
        checkObserverMethods();
        checkScopeAllowed();
    }
849905
@Override
    public void initialize(Map<String, Object> puProperties)
    {
        reader = new CouchbaseEntityReader(kunderaMetadata);
        setExternalProperties(puProperties);
        initializePropertyReader();
        PersistenceUnitMetadata pum = kunderaMetadata.getApplicationMetadata()
                .getPersistenceUnitMetadata(getPersistenceUnit());

        Properties pumProps = pum.getProperties();

        if (puProperties != null)
        {
            pumProps.putAll(puProperties);
        }

        String host = pumProps.getProperty("kundera.nodes");
        String keyspace = pumProps.getProperty("kundera.keyspace");

        if (host == null)
        {
            throw new KunderaException("Hostname/IP is null.");
        }

        if (keyspace == null)
        {
            throw new KunderaException("kundera.keyspace is null.");
        }
        cluster = CouchbaseCluster.create(splitHostNames(host));
        String password = ((CouchbasePropertyReader) propertyReader).csmd.getBucketProperty("bucket.password");
        bucket = CouchbaseBucketUtils.openBucket(cluster, keyspace, password);

    }
404093
public void init ()
    {
        if (_initers == null) {
            log.warning("Refusing repeat init() request.");
            return;
        }

        ObserverList<InitComponent> list = _initers.toObserverList();
        _initers = null;
        list.apply(new ObserverList.ObserverOp<InitComponent>() {
            public boolean apply (InitComponent comp) {
                log.debug("Initializing component", "comp", comp);
                comp.init();
                return true;
            }
        });
    }
263674
@Override
  public void init(final FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);

    configUrl = filterConfig.getInitParameter("xslt");

    if ((configUrl != null) && debug()) {
      debug("Filter " + filterConfig.getFilterName() +
                                        " using xslt " + configUrl);
    }

    String temp = filterConfig.getInitParameter("ignoreContentType");

    ignoreContentType = "true".equals(temp);
  }
653625
@PostConstruct
    private void initialize() {
        final MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters();
        final String offset = multiParam(queryParams, "offset");
        final String page = multiParam(queryParams, "page", "pageNumber");
        final String size = multiParam(queryParams, "size", "pageSize", "limit");
        final String filter = multiParam(queryParams, "filter", "searchText");
        final String sort = multiParam(queryParams, "sort", "sortOrder");
        final OrderDirection orderDirection;
        String orderBy = multiParam(queryParams, "orderBy", "sortName");

        if (StringUtils.isBlank(orderBy) || !RegexSequence.Pattern.ALPHA_NUMERIC.matcher(orderBy).matches()) {
            orderBy = null;
        }

        if ("asc".equalsIgnoreCase(sort)) {
            orderDirection = OrderDirection.ASCENDING;
        } else if ("desc".equalsIgnoreCase(sort)) {
            orderDirection = OrderDirection.DESCENDING;
        } else {
            orderDirection = OrderDirection.UNSPECIFIED;
        }

        final Pagination pagination;
        if (StringUtils.isNotBlank(offset)) {
            pagination = new Pagination(Pagination.Strategy.OFFSET, offset, size);
        } else if (StringUtils.isNotBlank(page) && StringUtils.isNotBlank(size)) {
            pagination = new Pagination(Pagination.Strategy.PAGES, page, size);
        } else {
            pagination = new Pagination(Pagination.Strategy.OFFSET, 0, 100); // Always paginate queries from resources
        }
        this.alpineRequest = new AlpineRequest(getPrincipal(), pagination, filter, orderBy, orderDirection);
    }
988315
@Override
    public void init() throws ServletException {
        super.init();

        // filter configuration
        nodeFilters.put(KEY_REFERENCEABLE, buildTreeFilter(nodesConfig.getReferenceableNodesFilter()));
        nodeFilters.put(KEY_UNFILTERD, ResourceFilter.ALL);
        nodeFilters.put(KEY_PAGE, buildTreeFilter(nodesConfig.getPageNodeFilter()));
        nodeFilters.put(KEY_DEFAULT, nodesConfig.getDefaultNodeFilter());

        // GET
        operations.setOperation(ServletOperationSet.Method.GET, Extension.json,
                Operation.map, new MapGetOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.json,
                Operation.tree, new TreeOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.json,
                Operation.reference, new ReferenceOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.json,
                Operation.mixins, new GetMixinsOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.json,
                Operation.filters, new ListFiltersAsJson());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.html,
                Operation.filters, new ListFiltersAsHtml());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.json,
                Operation.typeahead, new TypeaheadOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.json,
                Operation.resolve, new ResolveOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.json,
                Operation.query, new JsonQueryOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.html,
                Operation.query, new HtmlQueryOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.bin,
                Operation.load, new LoadBinaryOperation());
        operations.setOperation(ServletOperationSet.Method.GET, Extension.bin,
                Operation.download, new DownloadBinaryOperation());

        // POST
        operations.setOperation(ServletOperationSet.Method.POST, Extension.json,
                Operation.map, new MapPostOperation());
        operations.setOperation(ServletOperationSet.Method.POST, Extension.json,
                Operation.create, new CreateOperation());
        operations.setOperation(ServletOperationSet.Method.POST, Extension.bin,
                Operation.query, new ExportQueryOperation());
        operations.setOperation(ServletOperationSet.Method.POST, Extension.json,
                Operation.copy, new CopyOperation());
        operations.setOperation(ServletOperationSet.Method.POST, Extension.json,
                Operation.move, new MoveOperation());
        operations.setOperation(ServletOperationSet.Method.POST, Extension.lock,
                Operation.toggle, new ToggleLockOperation());
        operations.setOperation(ServletOperationSet.Method.POST, Extension.json,
                Operation.fileUpdate, new UpdateFileOperation());

        // PUT
        operations.setOperation(ServletOperationSet.Method.PUT, Extension.json,
                Operation.map, new MapPutOperation());
        operations.setOperation(ServletOperationSet.Method.PUT, Extension.json,
                Operation.create, new PutCreateOperation());
        operations.setOperation(ServletOperationSet.Method.PUT, Extension.json,
                Operation.copy, new PutCopyOperation());
        operations.setOperation(ServletOperationSet.Method.PUT, Extension.json,
                Operation.move, new PutMoveOperation());

        // DELETE
        operations.setOperation(ServletOperationSet.Method.DELETE, Extension.json,
                Operation.delete, new DeleteOperation());
    }
831313
@PostConstruct
    public void init() {
        JFXDepthManager.setDepth(content, 1);
        JFXNodeUtils.addDelayedEventHandler(searchField, Duration.millis(400),
            KeyEvent.KEY_PRESSED, event -> highlighter.highlight(content, searchField.getText()));
    }
1177479
private void init(final SecurityContext securityContext, final Class type, final Field field, final String path) throws FrameworkException {

		final QueryConfig config = getConfig(path);

		config.handleTypeArguments(securityContext, type, field.getArguments());

		final SelectionSet selectionSet = field.getSelectionSet();
		if (selectionSet != null) {

			for (final Selection selection : selectionSet.getSelections()) {

				if (selection instanceof Field) {

					final Field childField      = (Field)selection;
					final SelectionSet childSet = childField.getSelectionSet();
					final PropertyKey key       = StructrApp.key(type, childField.getName());
					final Class relatedType     = key.relatedType() != null ? key.relatedType() : type;

					// add field to property set
					config.addPropertyKey(key);
					config.handleFieldArguments(securityContext, relatedType, field, childField);

					// recurse
					if (childSet != null) {

						init(securityContext, relatedType, childField, path + "/" + childField.getName());
					}
				}
			}
		}
	}
554903
private void init() throws IOException {
    // move to begin
    IndexInput inField = indexInputList.get("field");
    inField.seek(indexInputOffsetList.get("field"));
    // store field references in memory
    fieldReferences = new HashMap<String, FieldReferences>();
    boolean doInit = true;
    while (doInit) {
      try {
        String field = inField.readString();
        long refIndexDoc = inField.readVLong();
        long refIndexDocId = inField.readVLong();
        int numberOfDocs = inField.readVInt();
        inField.readVLong(); // refTerm
        inField.readVInt(); // numberOfTerms
        long refPrefix = inField.readVLong();
        int numberOfPrefixes = inField.readVInt();
        fieldReferences.put(field, new FieldReferences(refIndexDoc,
            refIndexDocId, numberOfDocs, refPrefix, numberOfPrefixes));
      } catch (IOException e) {
        log.debug(e);
        doInit = false;
      }
    }
    // prefixReferences
    prefixReferences = new HashMap<String, LinkedHashMap<String, Long>>();
  }
97675
private void init() {
        // defaults for internal bookkeeping
        index = 0;              // internal index always starts at 0
        count = 1;              // internal count always starts at 1
        status = null;          // we clear status on release()
        item = null;            // item will be retrieved for each round
        last = false;           // last must be set explicitly
        beginSpecified = false; // not specified until it's specified :-)
        endSpecified = false;   // (as above)
        stepSpecified = false;  // (as above)
        deferredExpression = null;

        // defaults for interface with page author
        begin = 0;              // when not specified, 'begin' is 0 by spec.
        end = -1;               // when not specified, 'end' is not used
        step = 1;               // when not specified, 'step' is 1
        itemId = null;          // when not specified, no variable exported
        statusId = null;        // when not specified, no variable exported
    }
679552
private void initValues() throws VarExploderException
    {

        Class<?> c = source.getClass();
        if (c.isAnnotation() || c.isArray() || c.isEnum() || c.isPrimitive())
        {
            throw new IllegalArgumentException("The value must an object");
        }

        if(source instanceof Map )
        {
            this.pairs = (Map<String,Object>) source;
            return;
        }
        Method[] methods = c.getMethods();
        for (Method method : methods)
        {
            inspectGetters(method);
        }
        scanFields(c);
    }
300918
private void initSchema(final SchemaManager schemaManager, final CoreSession adminSession, final StructrPartition partition) throws Exception {

		final URL url            = SchemaEntityFactory.class.getProtectionDomain().getCodeSource().getLocation();
		final JarFile jarFile    = new JarFile(new File(url.toURI()));
		final List<String> names = new LinkedList<>();

		for (final Enumeration<JarEntry> e = jarFile.entries(); e.hasMoreElements();) {

			final ZipEntry zipEntry = e.nextElement();
			final String name = zipEntry.getName();

			if (name.startsWith("schema/") && name.endsWith(".ldif")) {

				names.add(name);
			}
		}

		Collections.sort(names, new Comparator<String>() {

			@Override
			public int compare(String o1, String o2) {

				// first sort key: number of slashes (level)
				Integer s1 = StringUtils.countMatches(o1, "/");
				Integer s2 = StringUtils.countMatches(o2, "/");

				if (s1.equals(s2)) {

					// secondary sort key: string length
					Integer l1 = o1.length();
					Integer l2 = o2.length();

					if (l1.equals(l2)) {

						// tertiary sort key: the string values
						return o1.compareTo(o2);
					}

					return l1.compareTo(l2);
				}

				return s1.compareTo(s2);
			}

		});

		for (final String name : names) {

			try (final LdifReader reader = new LdifReader(jarFile.getInputStream(jarFile.getEntry(name)))) {

				for (final LdifEntry entry : reader) {

					final Entry schemaEntry  = new DefaultEntry(schemaManager, entry.getEntry());
					final Dn dn              = schemaEntry.getDn();

					if (!partition.hasEntry(new HasEntryOperationContext(adminSession, dn))) {

						logger.info("Importing {}...", name);
						partition.add(new AddOperationContext(adminSession, schemaEntry));
					}
				}
			}
		}
	}