enterInitState will initialize the chaincode if entering init from established.
422339
public void enterInitState(Event event) {
		logger.debug(String.format("Entered state %s", fsm.current()));
		ChaincodeMessage message = messageHelper(event);
		logger.debug(String.format("[%s]Received %s, initializing chaincode",
				shortID(message), message.getType().toString()));
		if (message.getType() == INIT) {
			// Call the chaincode's Run function to initialize
            try {
                handleInit(message);
            } catch (InvalidTransactionException e) {
                e.printStackTrace();
            }
        }
	}
1064271
def init!
      @defaults = {
        :@refresh_token => ShakeTheCounter::Config.refresh_token,
        :@id            => ShakeTheCounter::Config.client_id,
        :@secret        => ShakeTheCounter::Config.client_secret,
        :@language_code => ShakeTheCounter::Config.language_code,
      }
    end
727140
public void initAtStartup() {
        //final String appsToInit = ConfigurationManager.getConfigInstance().getString("evcache.appsToInit");
        final String appsToInit = EVCacheConfig.getInstance().getDynamicStringProperty("evcache.appsToInit", "").get();
        if (appsToInit != null && appsToInit.length() > 0) {
            final StringTokenizer apps = new StringTokenizer(appsToInit, ",");
            while (apps.hasMoreTokens()) {
                final String app = getAppName(apps.nextToken());
                if (log.isDebugEnabled()) log.debug("Initializing EVCache - " + app);
                initEVCache(app);
            }
        }
    }
977852
@Override
    public void init(final Class<? extends State> stateClass) throws InitializationException {
        try {
            currentState = getState(stateClass);
            change.firePropertyChange(STATE_CHANGE, null, currentState.getClass());
        } catch (NotAvailableException ex) {
            throw new InitializationException(this, ex);
        }
    }
8333
private void tryInit() {
    try {
      Configuration conf = getSnapshotConfiguration();
      if (conf != null) {
        // Since this is only used for background loading of transaction snapshots, we use the no-op metrics collector,
        // as there are no relevant metrics to report
        this.storage = new HDFSTransactionStateStorage(conf, new SnapshotCodecProvider(conf),
                                                       new TxMetricsCollector());
        this.storage.startAndWait();
        this.snapshotRefreshFrequency = conf.getLong(TxConstants.Manager.CFG_TX_SNAPSHOT_INTERVAL,
                                                     TxConstants.Manager.DEFAULT_TX_SNAPSHOT_INTERVAL) * 1000;
        this.initialized = true;
      } else {
        LOG.info("Could not load configuration");
      }
    } catch (Exception e) {
      LOG.info("Failed to initialize TransactionStateCache due to: " + e.getMessage());
    }
  }
584761
def _initialize(self, chain, length):
        """"""
        # If this db was loaded from the disk, it may not have its
        # tallied step methods' getfuncs yet.
        if self._getfunc is None:
            self._getfunc = self.db.model._funs_to_tally[self.name]
131144
function init(endPoint, accessKeyId, accessKeySecret, securityToken = null, project) {
  return AliyunLog && AliyunLog.initAliyunLog && AliyunLog.initAliyunLog(endPoint, accessKeyId, accessKeySecret, securityToken, project);
}
751231
function init(ctx) {
        var server = ctx.server;

        if (!privateKey) {
            throw new Error('Please set config.security.token.privateKey');
        }

        server.ext('onPreAuth', validateToken);

        return new Q(ctx);
    }
126459
void initInputsByIdMap() {
    inputsById.clear();
    for (CompilerInput input : externs) {
      InputId id = input.getInputId();
      CompilerInput previous = putCompilerInput(id, input);
      if (previous != null) {
        report(JSError.make(DUPLICATE_EXTERN_INPUT, input.getName()));
      }
    }
    for (CompilerInput input : moduleGraph.getAllInputs()) {
      InputId id = input.getInputId();
      CompilerInput previous = putCompilerInput(id, input);
      if (previous != null) {
        report(JSError.make(DUPLICATE_INPUT, input.getName()));
      }
    }
  }
529268
public static void init(InputStream keyStoreStream, String keyStorePass, String entryName, String entryProtectionParam) {
		if (bypassSecurity) {
			return;
		}

		try {
			KeyStore ks = KeyStore.getInstance("JCEKS");
			ks.load(keyStoreStream, keyStorePass.toCharArray());

			KeyStore.SecretKeyEntry entry = (KeyStore.SecretKeyEntry) ks.getEntry(entryName,
				new KeyStore.PasswordProtection(entryProtectionParam.toCharArray()));
			SecretKey key = entry.getSecretKey();

			enCipher = Cipher.getInstance(key.getAlgorithm());
			enCipher.init(Cipher.ENCRYPT_MODE, key);

			deCipher = Cipher.getInstance(key.getAlgorithm());
			deCipher.init(Cipher.DECRYPT_MODE, key);

			keyStoreStream.close();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
247282
public void setInitialized() {

    boolean okay = (this.state == STATE_INITIALIZING);
    this.state = STATE_INITIALIZED;
    if (!okay) {
      if (isInitialized()) {
        throw new IllegalStateException("Already initialized.");
      } else {
        throw new IllegalStateException("You need to call setInitializing() before!");
      }
    }
  }
316822
def init_app(self, app, entry_point_group='invenio_oauth2server.scopes',
                 **kwargs):
        
        self.init_config(app)

        state = _OAuth2ServerState(app, entry_point_group=entry_point_group)

        app.extensions['invenio-oauth2server'] = state
        return state
359785
private void init() {
        this.currentState = CallState.START;
        this.callTransitions = new ArrayList<CallState>();
        this.messages = new TreeSet<SipPacket>(new PacketComparator());
    }
417515
def init_app(self, app):
        """"""
        self.init_config(app)
        state = _OAuthClientState(app)
        app.extensions['invenio-oauthclient'] = state
        return state
341063
@Override
    public void initialize() throws InitializationException
    {
        ListenerChain chain = new ListenerChain();
        setListenerChain(chain);

        // Construct the listener chain in the right order. Listeners early in the chain are called before listeners
        // placed later in the chain.
        chain.addListener(this);
        chain.addListener(new HTMLMacroBlockStateChainingListener(chain));
        chain.addListener(new EmptyBlockChainingListener(chain));
        chain.addListener(new MetaDataStateChainingListener(chain));
        chain.addListener(new HTMLMacroXHTMLChainingRenderer(this.linkRenderer, this.imageRenderer, chain));
    }
280962
def initializing(self):
        """"""
        self.subid = self._transport.subscribe(
            "transient.transaction", self.receive_message, acknowledgement=True
        )
844010
@Override
    public synchronized void initChain(String chainName) throws ChannelException, ChainException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "initChain: " + chainName);
        }
        if (null == chainName) {
            throw new InvalidChainNameException("Null chain name");
        }

        // Find the chain in the framework configuration.
        ChainData chainData = chainDataMap.get(chainName);
        if (null == chainData) {
            InvalidChainNameException e = new InvalidChainNameException("Unable to init unknown chain, " + chainName);
            FFDCFilter.processException(e, getClass().getName() + ".initChain", "2142", this, new Object[] { chainName });
            throw e;

        }

        // Ensure we have an inbound chain.
        if (FlowType.OUTBOUND.equals(chainData.getType())) {
            throw new InvalidChainNameException("Outbound chain cannot use this interface.");
        }

        // Verify the chain isn't already in the runtime.
        Chain chain = getRunningChain(chainName);
        if (null != chain) {
            InvalidRuntimeStateException e = new InvalidRuntimeStateException("Chain cannot be initialized, its already in the runtime.");
            FFDCFilter.processException(e, getClass().getName() + ".initChain", "2158", this, new Object[] { chain });
            throw e;
        }

        initChainInternal(chainData);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "initChain");
        }
    }