Initializes the invocation target.

@throws Exception if the initialization was a failure
321620
final void initInvocationTarget() throws Exception {
        Member previousTargetMember = targetMember;
        T target = getInvocationTarget();
        if (target == null) {
            remote = false;
            throw newTargetNullException();
        }

        targetMember = toTargetMember(target);
        if (targetMember != null) {
            targetAddress = targetMember.getAddress();
        } else {
            targetAddress = toTargetAddress(target);
        }
        memberListVersion = context.clusterService.getMemberListVersion();

        if (targetMember == null) {
            if (previousTargetMember != null) {
                // If a target member was found earlier but current target member is null
                // then it means a member left.
                throw new MemberLeftException(previousTargetMember);
            }
            if (!(isJoinOperation(op) || isWanReplicationOperation(op))) {
                throw new TargetNotMemberException(target, op.getPartitionId(), op.getClass().getName(), op.getServiceName());
            }
        }

        if (op instanceof TargetAware) {
            ((TargetAware) op).setTarget(targetAddress);
        }

        remote = !context.thisAddress.equals(targetAddress);
    }
421872
public void init() throws Exception {
        userDir = new File(System.getProperty("user.dir")).getAbsolutePath();
        System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath());

        if (!cfg.exists()) {

            ConfigurationManager manager = new ConfigurationManager(cfg, false, locateConfigurationProvider());

            try {

                manager.runProjectConfigurationInitializers();

                if (options.isVerbose()) {
                    log.info("CONFIGURATION FILE [" + cfg.getAbsolutePath() + "] CREATION COMPLETE");
                }

            } catch (IOException aux) {
                if (options.isVerbose()) {
                    log.error("The system can't create the file [ " + cfg.getAbsolutePath() + "]");
                }
                if (options.isThrowException()) {
                    System.setProperty("user.dir", userDir);
                    throw aux;
                }
            }

        } else {
            if (options.isVerbose()) {
                log.error("The configuration file [" + cfg.getAbsolutePath() + "] already exists");
            }
        }
        System.setProperty("user.dir", userDir);
    }
414895
protected void initialize() throws Exception
    {
        functionMap = new Hashtable<>();
        registerFunction("if", FuncIf.class);
        registerFunction("rate", FuncFlatRate.class);
        registerFunction("bandedrate", FuncBandedRate.class);
        registerFunction("tieredrate", FuncTieredRate.class);
        registerFunction("round", FuncRound.class);
        registerFunction("alpha", FuncAlpha.class);
        registerFunction("max", FuncMax.class);
        registerFunction("min", FuncMin.class);
        registerFunction("sin", FuncSin.class);
        registerFunction("tan", FuncTan.class);
        registerFunction("abs", FuncAbs.class);
        registerFunction("acos", FuncAcos.class);
        registerFunction("acotan", FuncAcotan.class);
        registerFunction("asin", FuncAsin.class);
        registerFunction("atan", FuncAtan.class);
        registerFunction("cos", FuncCos.class);
        registerFunction("deg", FuncRadsToDegrees.class);
        registerFunction("rad", FuncDegreesToRads.class);
        registerFunction("root", FuncRoot.class);
        registerFunction("sqrt", FuncSqrt.class);
        registerFunction("cbrt", FuncCubeRoot.class);
        registerFunction("log", FuncLog.class);
        registerFunction("log10", FuncLog10.class);
        registerFunction("trunc", FuncTrunc.class);
        registerFunction("not", FuncNot.class);
        registerFunction("match", FuncStringMatch.class);
        registerFunction("matches", FuncStringMatch.class);
        registerFunction("empty", FuncStringEmpty.class);
        registerFunction("isempty", FuncStringEmpty.class);
        registerFunction("cat", FuncStringCat.class);
        registerFunction("length", FuncStringLength.class);
        registerFunction("substr", FuncStringSubstr.class);
        registerFunction("rtrim", FuncStringRTrim.class);
        registerFunction("ltrim", FuncStringLTrim.class);
        registerFunction("trim", FuncStringTrim.class);
        registerFunction("indexOf", FuncStringIndexOf.class);
        registerFunction("date", FuncDate.class);
        registerFunction("time", FuncTime.class);
        registerFunction("datetime", FuncDateTime.class);
        registerFunction("dateTimefmt", FuncDateTimeFmt.class);
        registerFunction("datefmt", FuncDateFmt.class);
        registerFunction("timefmt", FuncTimeFmt.class);
        registerFunction("toString", FuncToString.class);
        registerFunction("ucase", FuncStringUpCase.class);
        registerFunction("lcase", FuncStringLowerCase.class);
        registerFunction("metaphone", FuncStringMetaphone.class);
        registerFunction("toInt", FuncStringToInt.class);
        registerFunction("toFloat", FuncStringToFloat.class);
        registerFunction("toHex", FuncBytesToHex.class);
        registerFunction("replace", FuncStringReplace.class);

        operatorMap = new Hashtable<>();
        registerOperator("^", OpPower.class);
        registerOperator(",", OpComma.class);
        registerOperator(";", OpChain.class);
        registerOperator("*", OpMultiply.class);
        registerOperator("/", OpDivide.class);
        registerOperator("+", OpAdd.class);
        registerOperator("-", OpSubtract.class);
        registerOperator("(", OpLeftParen.class);
        registerOperator(")", OpRightParen.class);
        registerOperator("=", OpCompareEqual.class);
        registerOperator("!=", OpCompareNotEqual.class);
        registerOperator(">", OpCompareGreater.class);
        registerOperator("<=", OpCompareNotGreater.class);
        registerOperator("<", OpCompareLess.class);
        registerOperator(">=", OpCompareNotLess.class);
        registerOperator(":=", OpAssignment.class);
        registerOperator("&&", OpAnd.class);
        registerOperator("!&", OpNand.class);
        registerOperator("||", OpOr.class);
        registerOperator("!|", OpNor.class);
        registerOperator("~|", OpXor.class);
        registerOperator("!~|", OpXnor.class);
        registerOperator("%", OpMod.class);
        registerOperator("!", OpFactorial.class);
    }
30717
public void init() throws Exception {

        // If the status file exists, make sure it doesn't indicate
        // that the server is running!
        if (_statusFile.exists()) {
            ServerStatusMessage[] messages = getAllMessages();
            ServerStatusMessage lastMessage = messages[messages.length - 1];
            if (lastMessage.getState() == ServerState.STARTED) {
                throw new Exception("The server is already running or was shut down unexpectedly.\n"
                        + "If the server has shut down unexpectedly, you must manually delete\n"
                        + "the following file: "
                        + _statusFile.getPath()
                        + "\n"
                        + "then try again.");
            }
        }

        _statusFile.clear();
        _statusFile.append(ServerState.NOT_STARTING,
                           "Waiting for startup to begin");
    }
236584
protected void initialize() throws Exception {
		// create the operator
		try {
			this.driver.setup(this);
		}
		catch (Throwable t) {
			throw new Exception("The driver setup for '" + this.getEnvironment().getTaskName() +
				"' , caused an error: " + t.getMessage(), t);
		}
		
		this.runtimeUdfContext = createRuntimeContext(getEnvironment().getTaskName());
		
		// instantiate the UDF
		try {
			final Class<? super S> userCodeFunctionType = this.driver.getStubType();
			// if the class is null, the driver has no user code
			if (userCodeFunctionType != null) {
				this.stub = initStub(userCodeFunctionType);
			}
		} catch (Exception e) {
			throw new RuntimeException("Initializing the UDF" +
				e.getMessage() == null ? "." : ": " + e.getMessage(), e);
		}
	}
712745
public final void intialize() throws IllegalStateException {
        synchronized (this) {
            if (tracker != null) {
                throw new IllegalStateException(
                        "DelegatingComponentInstanciationListener [" + this + "] had been initialized.");
            }
            tracker = new ComponentInstanciationListenerTracker(context, applicationName);
            tracker.open();
        }
    }
1182271
private void initTemplates() throws Exception {
        if (templates != null && templates.length > 0) {
            for (String template : templates) {
                Assert.hasText(template, "Can not read template in ["
                        + template
                        + "]. Check that templates is not empty.");
                createTemplate(client.getLowLevelClient(), classpathRoot, template, forceTemplate);
            }
        }
    }
717278
@Override
    public void init (Injector injector)
        throws Exception
    {
        super.init(injector);

        // configure the client manager to use our bits
        _clmgr.setDefaultSessionFactory(new SessionFactory() {
            @Override
            public Class<? extends PresentsSession> getSessionClass (AuthRequest areq) {
                return CrowdSession.class;
            }
            @Override
            public Class<? extends ClientResolver> getClientResolverClass (Name username) {
                return CrowdClientResolver.class;
            }
        });
    }
602005
private Object initiateByMethodName(Class<?> targetClass, String initMethodName, List<Object> objects)
        throws Exception {
        Method method = targetClass.getMethod(initMethodName, getClassList(objects));
        if (Modifier.isStatic(method.getModifiers())) {
            return method.invoke(null, objects.toArray());
        } else {
            return method.invoke(targetClass.newInstance(), objects.toArray());
        }
    }
358567
private void initIndex() throws Exception {

        // 0. Add the tasklog template
        GetIndexTemplatesResponse result = elasticSearchClient.admin()
            .indices()
            .prepareGetTemplates("tasklog_template")
            .execute()
            .actionGet();

        if (result.getIndexTemplates().isEmpty()) {
            logger.info("Creating the index template 'tasklog_template'");
            InputStream stream = ElasticSearchDAOV5.class
                .getResourceAsStream("/template_tasklog.json");
            byte[] templateSource = IOUtils.toByteArray(stream);

            try {
                elasticSearchClient.admin()
                    .indices()
                    .preparePutTemplate("tasklog_template")
                    .setSource(templateSource, XContentType.JSON)
                    .execute()
                    .actionGet();
            } catch (Exception e) {
                logger.error("Failed to init tasklog_template", e);
            }
        }
    }
1128599
protected final void load()throws Exception
	{
		synchronized (this) {
			Set<Class<?>> classes=classProvider.getLoadedClasses();
			initScriptClasses(classes);
			onScriptLoaded(classes);
		}
	}
1271649
private void initIndex() throws Exception {

        //0. Add the tasklog template
        if (doesResourceNotExist("/_template/tasklog_template")) {
            logger.info("Creating the index template 'tasklog_template'");
            InputStream stream = ElasticSearchDAOV5.class.getResourceAsStream("/template_tasklog.json");
            byte[] templateSource = IOUtils.toByteArray(stream);

            HttpEntity entity = new NByteArrayEntity(templateSource, ContentType.APPLICATION_JSON);
            try {
                elasticSearchAdminClient.performRequest(HttpMethod.PUT, "/_template/tasklog_template", Collections.emptyMap(), entity);
            } catch (IOException e) {
                logger.error("Failed to initialize tasklog_template", e);
            }
        }
    }
669360
protected void initOutputs() throws Exception {
		this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
		this.eventualOutputs = new ArrayList<BufferWriter>();
		this.output = initOutputs(this, this.userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs);
	}
241928
public function initialize()
    {
        if ($this->initialized === true) {
            return;
        }
        if ($this->canBeInitialized() === false) {
            throw new Exception('The security Context cannot be initialized yet. Please check if it can be initialized with $securityContext->canBeInitialized() before trying to do so.', 1358513802);
        }

        $sessionDataContainer = $this->objectManager->get(SessionDataContainer::class);
        $factoryTokens = $this->tokenAndProviderFactory->getTokens();
        $tokens = $this->mergeTokens($factoryTokens, $sessionDataContainer->getSecurityTokens());
        $this->separateActiveAndInactiveTokens($tokens);
        $this->updateTokens($this->activeTokens);

        $this->initialized = true;
    }
1063123
public void init() throws Exception {
    // configure the SSLContext with a TrustManager
    SSLContext ctx = SSLContext.getInstance("TLS");
    if (ignoreCertificates) {
      ctx.init(new KeyManager[0],
          new TrustManager[] { new DefaultTrustManager() }, new SecureRandom());
      SSLContext.setDefault(ctx);
    }
    HostnameVerifier hv = new IgnoreHostName();
    HttpsURLConnection.setDefaultHostnameVerifier(hv);
  }
944799
@Override
    protected void doInitialize() throws ComponentInitializationException {
        log.debug("Initialized {}", this.getClass().getSimpleName());
        if (getMessageContext() == null) {
            throw new ComponentInitializationException("Message context cannot be null");
        }
        if (getVelocityEngine() == null) {
            throw new ComponentInitializationException("VelocityEngine must be supplied");
        }
        if (getVelocityTemplateId() == null) {
            throw new ComponentInitializationException("Velocity template id must be supplied");
        }
    }
560411
private final void init() throws ServletException
	{
		ServletConfig conf;
		ServletContext ctx;

		logger.debug("servlet={}", servlet);

		// If the api user doesn't init a HttpServlet right
		// the conf may be null. Let's double check it all with
		// useful exception messages.
		if(servlet == null)
			throw new IllegalStateException("Servlet was null in. Initialization issue?");
		if((conf = servlet.getServletConfig()) == null)
			throw new IllegalStateException("ServletConfig was null in. Initialization issue?");
		if((ctx = conf.getServletContext()) == null)
			throw new IllegalStateException("ServletContext was null in. Initialization issue?");

		// get the actual dispatcher
		if(isName)
			dispatcher = ctx.getNamedDispatcher(nameOrPath);
		else
			dispatcher = ctx.getRequestDispatcher(nameOrPath);
		if(dispatcher == null)
			throw new ServletException("Unable to get dispatcher for \"" + nameOrPath + "\".");
	}