/* (non-Javadoc)
@see com.ibm.jaggr.service.transport.AbstractHttpTransport#initialize(com.ibm.jaggr.service.IAggregator, com.ibm.jaggr.service.IAggregatorExtension, com.ibm.jaggr.service.IExtensionInitializer.IExtensionRegistrar)
487025
@Override
	public void initialize(IAggregator aggregator, IAggregatorExtension extension, IExtensionRegistrar reg) {
		super.initialize(aggregator, extension, reg);

		// Get first resource factory extension so we can add to beginning of list
		Iterable<IAggregatorExtension> resourceFactoryExtensions = aggregator.getExtensions(IResourceFactoryExtensionPoint.ID);
		IAggregatorExtension first = resourceFactoryExtensions.iterator().next();

		// Register the loaderExt resource factory
		Properties attributes = new Properties();
		attributes.put("scheme", getComboUri().getScheme()); //$NON-NLS-1$
		reg.registerExtension(
				new LoaderExtensionResourceFactory(),
				attributes,
				new InitParams(Collections.<InitParam>emptyList()),
				IResourceFactoryExtensionPoint.ID,
				getTransportId(),
				first);

	}
389844
public static void init(LogConfiguration logConfiguration, Printer... printers) {
    if (sIsInitialized) {
      Platform.get().warn("XLog is already initialized, do not initialize again");
    }
    sIsInitialized = true;

    if (logConfiguration == null) {
      throw new IllegalArgumentException("Please specify a LogConfiguration");
    }
    sLogConfiguration = logConfiguration;

    sPrinter = new PrinterSet(printers);

    sLogger = new Logger(sLogConfiguration, sPrinter);
  }
651666
public static synchronized void initialize(int myHostId, CatalogContext catalogContext, HostMessenger messenger) throws BundleException, IOException {
        ImporterStatsCollector statsCollector = new ImporterStatsCollector(myHostId);
        ImportManager em = new ImportManager(myHostId, messenger, statsCollector);
        VoltDB.instance().getStatsAgent().registerStatsSource(
                StatsSelector.IMPORTER,
                myHostId,
                statsCollector);

        m_self = em;
        em.create(catalogContext);
    }
840490
@Override
    public void initialize(JsMessagingEngine engine) throws Exception {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "initialize", engine);

        // Get the admin factory class
        try {
            jsaf = JsAdminFactory.getInstance();
        } catch (Exception e) {
            // No FFDC code needed
        }

        // Synchronize on stateChangeLock to manage the startup of the engine with
        // potential addition of new engine components via dynamic config.
//        processor = _mainImpl.mpService.getService().getInstance();
        ListIterator<ComponentList> li = null;
        boolean initializationFailed = false;

        synchronized (stateChangeLock) {

            setState(STATE_INITIALIZING);
            for (int i = 0; i < NUM_STOP_PHASES; i++)
            {
                stopSequence[i] = new Vector<ComponentList>();
            }
            try
            {
                _messageStore = JsMainAdminComponentImpl.messageStoreRef.getService();

            } catch (Exception e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }

            _messageProcessor = loadClass(JsConstants.SIB_CLASS_MP, STOP_PHASE_1, true);

            // Initialize any engine components
            initializationFailed = false;

        } // synchronized(stateChangeLock)
        try {
            //Initialize the message store 
            _messageStore.initialize(this);
            //Initialize the message processor 
            _messageProcessor.initialize(this);
            setState(STATE_INITIALIZED);
        } catch (Exception e) {
            com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".<init>", "625", this);
            SibTr.error(tc, "ME_CANNOT_BE_INITIALIZED_SIAS0033", new Object[] { _name, "MessageProcessor.java", "initialize()" });
            SibTr.exception(tc, e);
            initializationFailed = true;

        }
        if (initializationFailed) {
            destroy();
            // Cleanup finished...
            // Change state to UNINITIALIZED
            setState(STATE_UNINITIALIZED);
        } else {
            setState(STATE_INITIALIZED);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "initialize");
    }
901553
private static void initIfNeeded()
   {
      if (!INITIALIZED)
      {
         synchronized (JCRAPIAspect.class)
         {
            if (!INITIALIZED)
            {
               ExoContainer container = ExoContainerContext.getTopContainer();
               JCRAPIAspectConfig config = null;
               if (container != null)
               {
                  config = (JCRAPIAspectConfig)container.getComponentInstanceOfType(JCRAPIAspectConfig.class);
               }
               if (config == null)
               {
                  TARGET_INTERFACES = new Class<?>[]{};
                  LOG.warn("No interface to monitor could be found");
               }
               else
               {
                  TARGET_INTERFACES = config.getTargetInterfaces();
                  for (Class<?> c : TARGET_INTERFACES)
                  {
                     Statistics global = new Statistics(null, "global");
                     Map<String, Statistics> statistics = new TreeMap<String, Statistics>();
                     Method[] methods = c.getMethods();
                     for (Method m : methods)
                     {
                        String name = getStatisticsName(m);
                        statistics.put(name, new Statistics(global, name));
                     }
                     JCRStatisticsManager.registerStatistics(c.getSimpleName(), global, statistics);
                     ALL_STATISTICS.put(c.getSimpleName(), statistics);
                  }
               }
               INITIALIZED = true;
            }
         }
      }
   }
65857
protected void initExtensions(IExtension[] extensions) {
		final String sourceMethod = "initExtension"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(sourceClass, sourceMethod, new Object[]{extensions});
		}
		for (IExtension extension : extensions) {
			for (IConfigurationElement member : extension.getConfigurationElements()) {
				try {
					// make sure the contributing bundle is started.
					Bundle contributingBundle = Platform.getBundle(member.getNamespaceIdentifier());
					if (contributingBundle != null && contributingBundle.getState() != Bundle.ACTIVE && contributingBundle.getState() != Bundle.STARTING) {
						contributingBundle.start();
					}
					// get class attribute so we can see if the class is a singleton that we
					// already have an instance for.
					String className = member.getAttribute("class"); //$NON-NLS-1$
					Object ext = singletonExtensions.get(className);
					if (ext == null) {
						ext = member.createExecutableExtension("class"); //$NON-NLS-1$
						if (ext instanceof IExtensionSingleton) {
							// Add it to the map of singleton extensions
							singletonExtensions.put(className, ext);
						}
					}
					Properties props = new Properties();
					for (String attributeName : member.getAttributeNames()) {
						props.put(attributeName, member.getAttribute(attributeName));
					}
					InitParams initParams = getConfigInitParams(member);
					registerExtension(
							new AggregatorExtension(ext, props, initParams,
									extension.getExtensionPointUniqueIdentifier(),
									extension.getUniqueIdentifier(),
									this), null
							);
				} catch (CoreException ex) {
					if (log.isLoggable(Level.WARNING)) {
						log.log(Level.WARNING, ex.getMessage(), ex);
					}
				} catch (BundleException ex) {
					if (log.isLoggable(Level.WARNING)) {
						log.log(Level.WARNING, ex.getMessage(), ex);
					}
				}
			}
		}
		if (isTraceLogging) {
			log.exiting(sourceClass, sourceMethod);
		}
	}
1261503
private void initialize()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "initialize");
        
    subsets = new ReliabilitySubset[maxReliabilityIndex + 1];
    subsetIDs = new long[maxReliabilityIndex + 1];
    for(int i=0;i<subsetIDs.length;i++)
    {
      subsetIDs[i] = NO_ID;             
    }
    
    createControlAdapter(); 
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "initialize");
  }
504702
public void initialize(final int appId, final String appSecret, final String bridgeId,
      final ServerInfo serverInfo, final CallStatsInitListener callStatsInitListener) {
    if (StringUtils.isBlank(appSecret)) {
      logger.error("intialize: Arguments cannot be null ");
      throw new IllegalArgumentException("intialize: Arguments cannot be null");
    }
    initialize(appId, new TokenGeneratorHs256(appSecret.toCharArray(), appId, bridgeId), bridgeId,
        serverInfo, callStatsInitListener);
  }
888589
public final void initialize(FaxClientSpi faxClientSpi,FaxClientSpiInterceptor[] interceptors)
    {
        if(this.initialized)
        {
            throw new FaxException("Fax client SPI proxy already initialized.");
        }
        
        //set flag
        this.initialized=true;
        
        //get configuration
        this.faxClientSpiInstance=faxClientSpi;
        
        if(interceptors==null)
        {
            this.faxClientSpiInterceptors=new FaxClientSpiInterceptor[0];
        }
        else
        {
            //get amount
            int amount=interceptors.length;
            
            //init array
            this.faxClientSpiInterceptors=new FaxClientSpiInterceptor[amount];
            
            //copy array
            System.arraycopy(interceptors,0,this.faxClientSpiInterceptors,0,amount);
        }
        
        //initialize
        this.initializeImpl();
    }
134961
@Override
    public void internalInitialize(BeanDeployerEnvironment environment) {
        super.internalInitialize(environment);
        checkEJBTypeAllowed();
        checkConflictingRoles();
        checkObserverMethods();
        checkScopeAllowed();
    }
557728
private function initTransports()
    {
        $this->transports = array();

        foreach ($this->loadTransports() as $transport) {
            if (!$transport instanceof TransportInterface) {
                throw new \InvalidArgumentException(sprintf('Transport %s should implements TransportInterface', get_class($transport)));
            }

            $this->transports[$transport->getName()] = $transport;
        }
    }
286874
@Override
    public final void initialize(JsRecoveryMessagingEngine recoveryME, String mode)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "initialize", new Object[] { recoveryME, mode });
        this._messagingEngine = recoveryME;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "initialize", "Assigned new recoverME to messages store");

    }
1263903
private void init(ResourceLoader resourceLoader) throws IOException {
    if (config == null && configs == null) {
      if (typeArgument == null && configArgument == null) {
        throw new IOException("no configuration");
      } else {
        if (typeArgument != null) {
          config = new MtasConfiguration();
          config.attributes.put(MtasConfiguration.CHARFILTER_CONFIGURATION_TYPE,
              typeArgument);
          config.attributes.put(
              MtasConfiguration.CHARFILTER_CONFIGURATION_PREFIX,
              prefixArgument);
          config.attributes.put(
              MtasConfiguration.CHARFILTER_CONFIGURATION_POSTFIX,
              postfixArgument);
        }
        if (configArgument != null) {
          if (resourceLoader != null) {
            try {
              configs = MtasConfiguration.readMtasCharFilterConfigurations(
                  resourceLoader, configArgument);
            } catch (IOException e) {
              throw new IOException(
                  "problem loading configurations from " + configArgument, e);
            }
          }
        }
      }
    }
  }
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;
    }
432783
@PostConstruct
    public void initialize() {
        final FwWebDirection direction = assistWebDirection();
        final ResponseHandlingProvider provider = direction.assistResponseHandlingProvider();
        if (provider != null) {
            responseWritePerformerCreator = provider.provideResponseWritePerformerCreator();
            responseDownloadPerformerCreator = provider.provideResponseDownloadPerformerCreator();
            downloadExtensionContentTypeMap = provider.provideDownloadExtensionContentTypeMap();
        }
        showBootLogging();
    }
512581
private void initialize(ComponentContext context,
                            Map<String, Object> properties, ConfigurationAdmin configAdmin)
                    throws InvalidFileStoreConfigurationException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, "initialize", new Object[] { context, properties });
        }
        this.properties = properties;
        this.bundleLocation = context.getBundleContext().getBundle().getLocation();
        
        // populate filestore
        SIBFileStore filestore = new SIBFileStoreImpl();
        populateFileStore(properties, filestore, configAdmin);

        // set bus properties
        // nothing to set for bus as only defaults are considered
        // uuid will be set by the processor
        SIBus bus = new SIBusImpl();

        // set the properties for mesagingengine object.first the queues or
        // topic is got from
        // Administration Config and list of SIBBestination is created
        // and then the localization list is created for those SIBdestination
        SIBMessagingEngine messagingEngine = new SIBMessagingEngineImpl();

        messagingEngine.setHighMessageThreshold((Long) properties
                        .get(JsAdminConstants.HIGHMESSAGETHRESHOLD));

        HashMap<String, BaseDestination> destinationList = new HashMap<String, BaseDestination>();
        HashMap<String, SIBLocalizationPoint> destinationLocalizationList = new HashMap<String, SIBLocalizationPoint>();

        // populate destinations of type QUEUE
        populateDestinations(properties, destinationList, destinationLocalizationList, messagingEngine.getName(), JsAdminConstants.QUEUE, configAdmin,
                             false);
        // populate destinations of type TOPICSPACE
        populateDestinations(properties, destinationList, destinationLocalizationList, messagingEngine.getName(), JsAdminConstants.TOPICSPACE, configAdmin,
                             false);
        //populate destinations of type ALIAS
        populateAliasDestinations(properties, destinationList, configAdmin);

        // processor will update the UUID via Admin.Since we dont get UUID info from server.xml
        messagingEngine.setDestinationList(destinationList);
        messagingEngine.setSibLocalizationPointList(destinationLocalizationList);

        // set all the constructed artifact to jsMEConfig
        jsMEConfig.setMessagingEngine(messagingEngine);
        jsMEConfig.setSIBFilestore(filestore);
        jsMEConfig.setSIBus(bus);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, "initialize");
        }

    }
1140032
private void initialize(JawrConfig config) {

		StopWatch stopWatch = new StopWatch("Initializing JS engine for Autoprefixer");
		stopWatch.start();

		// Load JavaScript Script Engine
		String script = config.getProperty(AUTOPREFIXER_SCRIPT_LOCATION, AUTOPREFIXER_SCRIPT_DEFAULT_LOCATION);
		String jsEngineName = config.getJavascriptEngineName(AUTOPREFIXER_JS_ENGINE);
		jsEngine = new JavascriptEngine(jsEngineName, true);
		jsEngine.getBindings().put("logger", LOGGER);
		try(InputStream inputStream = getResourceInputStream(config, script)){
			jsEngine.evaluate("autoprefixer.js", inputStream);
		} catch (IOException e) {
			throw new BundlingProcessException(e);
		}
		String strOptions = config.getProperty(AUTOPREFIXER_SCRIPT_OPTIONS, AUTOPREFIXER_DEFAULT_OPTIONS);
		this.options = jsEngine.execEval(strOptions);

		jsEngine.evaluate("initAutoPrefixer.js", String.format("if(logger.isDebugEnabled()){ logger.debug('Autoprefixer config : '+autoprefixer(%s).info());}", strOptions));
		jsEngine.evaluate("jawrAutoPrefixerProcess.js",
				"function process(cssSource, opts){\n"
				+ "var result = autoprefixer.process.apply(autoprefixer, [cssSource, opts]);\n"
				+ "if(result.warnings){\n" + "result.warnings().forEach(function(message){\n"
				+ "if(logger.isWarnEnabled()){\n" + "logger.warn(message.toString());\n" + "}\n" + "});}\n"
				+ "return result.css;\n" + "}");
        

		stopWatch.stop();
		if (PERF_LOGGER.isDebugEnabled()) {
			PERF_LOGGER.debug(stopWatch.shortSummary());
		}
	}