/*
(non-Javadoc)

@see
org.apache.cxf.feature.AbstractFeature#initialize(org.apache.cxf.endpoint
.Client, org.apache.cxf.Bus)
177617
public void initialize(Client client, Bus bus) {
		if (LOG.isLoggable(Level.FINE)) {
			LOG.log(Level.FINE, "Initializing Compression feature for bus "
					+ bus + " and client " + client);
		}
		initializeProvider(client, bus);

	}
618681
public AbstractEndpointBuilder<T> initialize() {
        if (getEndpoint() instanceof InitializingBean) {
            try {
                ((InitializingBean) getEndpoint()).afterPropertiesSet();
            } catch (Exception e) {
                throw new CitrusRuntimeException("Failed to initialize endpoint", e);
            }
        }

        return this;
    }
1087063
public void contextInitialized(ServletContextEvent sce) {
    	LogLog.debug("Start to initialize log4j");

    	LogLog.debug("Confige CXF to use log4j!");

    	ServletContext sc = sce.getServletContext();
        if (Log4jWebUtils.isWatchDisabled(sc)) {
            Log4jWebUtils.reload(sc);
        } else {
            Log4jWebUtils.reloadAndWatch(sc, Log4jWebUtils.getWatchDelay(sc));
        }
        logger.info("Log4j initialized...");
    }
686024
@Override
  public void initialize(HttpRequest httpRequest) throws IOException {
    // Do not throw if execute fails, since Axis will handle unmarshalling the
    // fault.
    httpRequest.setThrowExceptionOnExecuteError(false);

    // For consistency with the default Axis HTTPSender and CommonsHTTPSender, do not
    // follow redirects.
    httpRequest.setFollowRedirects(false);

    // Retry should be handled by the client.
    httpRequest.setNumberOfRetries(0);
  }
419191
@SuppressWarnings("unchecked")
    protected final void initSession(IoSession session,
            IoFuture future, IoSessionInitializer sessionInitializer) {
        // Update lastIoTime if needed.
        if (stats.getLastReadTime() == 0) {
            stats.setLastReadTime(getActivationTime());
        }
        
        if (stats.getLastWriteTime() == 0) {
            stats.setLastWriteTime(getActivationTime());
        }

        // Every property but attributeMap should be set now.
        // Now initialize the attributeMap.  The reason why we initialize
        // the attributeMap at last is to make sure all session properties
        // such as remoteAddress are provided to IoSessionDataStructureFactory.
        try {
            ((AbstractIoSession) session).setAttributeMap(session.getService()
                    .getSessionDataStructureFactory().getAttributeMap(session));
        } catch (IoSessionInitializationException e) {
            throw e;
        } catch (Exception e) {
            throw new IoSessionInitializationException(
                    "Failed to initialize an attributeMap.", e);
        }

        try {
            ((AbstractIoSession) session).setWriteRequestQueue(session
                    .getService().getSessionDataStructureFactory()
                    .getWriteRequestQueue(session));
        } catch (IoSessionInitializationException e) {
            throw e;
        } catch (Exception e) {
            throw new IoSessionInitializationException(
                    "Failed to initialize a writeRequestQueue.", e);
        }

        if ((future != null) && (future instanceof ConnectFuture)) {
            // DefaultIoFilterChain will notify the future. (We support ConnectFuture only for now).
            session.setAttribute(DefaultIoFilterChain.SESSION_CREATED_FUTURE,
                    future);
        }

        if (sessionInitializer != null) {
            sessionInitializer.initializeSession(session, future);
        }

        finishSessionInitialization0(session, future);
    }
1217192
public void initialize(@Observes @Initialized(ApplicationScoped.class) Object ignore) {
        log.debugf("Initializing [%s]", this.getClass().getName());
        try {
            feedSessionListenerProducer = new BiFunction<String, Session, WsSessionListener>() {
                @Override
                public WsSessionListener apply(String key, Session session) {
                    // In the future, if we need other queues/topics that need to be listened to, we add them here.
                    final Endpoint endpoint = Constants.FEED_COMMAND_QUEUE;
                    BasicMessageListener<BasicMessage> busEndpointListener = new FeedBusEndpointListener(session, key,
                            endpoint);
                    return new BusWsSessionListener(Constants.HEADER_FEEDID, key, endpoint, busEndpointListener);
                }
            };
            wsEndpoints.getFeedSessions().addWsSessionListenerProducer(feedSessionListenerProducer);

            uiClientSessionListenerProducer = new BiFunction<String, Session, WsSessionListener>() {
                @Override
                public WsSessionListener apply(String key, Session session) {
                    // In the future, if we need other queues/topics that need to be listened to, we add them here.
                    final Endpoint endpoint = Constants.UI_COMMAND_QUEUE;
                    BasicMessageListener<BasicMessage> busEndpointListener = new UiClientBusEndpointListener(
                            commandContextFactory, busCommands, endpoint);
                    return new BusWsSessionListener(Constants.HEADER_UICLIENTID, key, endpoint, busEndpointListener);
                }
            };
            wsEndpoints.getUiClientSessions().addWsSessionListenerProducer(uiClientSessionListenerProducer);
        } catch (Exception e) {
            log.errorCouldNotInitialize(e, this.getClass().getName());
        }

    }
539931
@Override
    protected void initializeImpl()
    {
        //get port name
        this.portName=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.PORT_NAME_PROPERTY_KEY);
        if(this.portName==null)
        {
            throw new FaxException("Port name not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.PORT_NAME_PROPERTY_KEY);
        }

        //get timeout
        String valueStr=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.TIMEOUT_PROPERTY_KEY);
        this.timeout=CommFaxClientSpi.TIMEOUT_DEFAULT_VALUE;
        if((valueStr!=null)&&(valueStr.length()>0))
        {
            try
            {
                this.timeout=Integer.parseInt(valueStr);
            }
            catch(Exception exception)
            {
                this.timeout=CommFaxClientSpi.TIMEOUT_DEFAULT_VALUE;
            }
        }
        if(this.timeout<=0)
        {
            this.timeout=CommFaxClientSpi.TIMEOUT_DEFAULT_VALUE;
        }
    }
807139
@Override
    public final void initialize(BackendInstanceSpec config)
            throws BackendInitializationException {
        super.initialize(config);
        try {
            IOUtil.readPropertiesFromResource(algorithmClasses, getClass(),
                    getAlgorithmsPropertiesResourceName());
        } catch (IOException e) {
            throw new AlgorithmSourceBackendInitializationException(
                    "Could not initialize " + getClass(), e);
        }
    }
773614
public static void initialize(SingletonProvider instance) {
        synchronized (SingletonProvider.class) {
            if (INSTANCE == null) {
                INSTANCE = instance;
            } else {
                throw new RuntimeException("SingletonProvider is already initialized with " + INSTANCE);
            }
        }
    }
841740
public void initialize(){
    thread = new Thread(collectorProcessor);
    thread.start();
    for (DriverNode dn : this.children){
      dn.initialize();
    }
  }
67396
public void init(ClientContext clientContext) {
        this.clientContext = clientContext;
        this.clientConnectionStrategyConfig = clientContext.getClientConfig().getConnectionStrategyConfig();
        this.logger = clientContext.getLoggingService().getLogger(ClientConnectionStrategy.class);
    }
187735
public void init() {
        if (FacesContext.getCurrentInstance().getPartialViewContext().isAjaxRequest()) {
            return;
        }

        if (id != null && !"".equals(id)) {
            entity = crudService.findById(id);
            if (entity == null) {
                log.info(String.format("Entity not found with id %s, a new one will be initialized.", id));
                id = null;
                entity = initEntity();
            }
        }
    }
57723
public void initialize(IClient client) {
        if (log.isDebugEnabled()) {
            log.debug("initialize - client: {}", client);
        }
        if (this.client != null && this.client instanceof Client && !this.client.equals(client)) {
            // unregister old client
            if (log.isTraceEnabled()) {
                log.trace("Unregistering previous client: {}", this.client);
            }
            ((Client) this.client).unregister(this, false);
        }
        this.client = client;
        if (this.client instanceof Client && !((Client) this.client).isRegistered(this)) {
            // register new client
            if (log.isTraceEnabled()) {
                log.trace("Registering client: {}", this.client);
            }
            ((Client) this.client).register(this);
        }
    }
10326
public void initialize()
    {
        super.initialize();

        //
        // Register the ServletService classes associated with the ServletServiceProvider
        //
        ServletServiceProvider ssp = ServletServiceProvider.getProvider();
        addService(ServletContext.class, ssp);
        addService(ServletRequest.class, ssp);
        addService(ServletResponse.class, ssp);
        addService(HttpServletRequest.class, ssp);
        addService(HttpServletResponse.class, ssp);

        //
        // Register an *internal* service that is used to create ControlBeanContext objects for
        // children of this control container
        //
        _bcsp = WebContextFactoryProvider.getProvider();
        addService(ControlBeanContextFactory.class, _bcsp);
    }
846576
private synchronized void initialize() {
        Iterator types = EntityTypesLocator.getEntityTypes().getAllEntityTypes();
        String factoryName = null;

        while (types.hasNext()) {
            Class type = (Class) types.next();
            if (type != Object.class) {
                String factoryKey =
                        "org.apereo.portal.services.EntityNameFinderService.NameFinderFactory.implementation_"
                                + type.getName();
                try {
                    factoryName = PropertiesManager.getProperty(factoryKey);
                } catch (Exception runtime) {
                    String dMsg =
                            "EntityNameFinderService.initialize(): "
                                    + "could not find property for "
                                    + type.getName()
                                    + " factory.";
                    log.debug(dMsg);
                }
                if (factoryName != null) {
                    try {
                        IEntityNameFinderFactory factory =
                                (IEntityNameFinderFactory) Class.forName(factoryName).newInstance();
                        getNameFinders().put(type, factory.newFinder());
                    } catch (Exception e) {
                        String eMsg =
                                "EntityNameFinderService.initialize(): "
                                        + "Could not instantiate finder for "
                                        + type.getName()
                                        + ": ";
                        log.error(eMsg, e);
                    }
                }
            }
        }
        setInitialized(true);
    }
1332616
@Override
    protected void initializeImpl()
    {
        //create properties from configuration (all javax mail properties will be defined in the fax4j properties)
        this.mailConnectionProperties=new Properties();
        Map<String,String> configuration=this.factoryConfigurationHolder.getConfiguration();
        Iterator<Entry<String,String>> iterator=configuration.entrySet().iterator();
        Entry<String,String> entry=null;
        String key=null;
        String value=null;
        while(iterator.hasNext())
        {
            //get next entry
            entry=iterator.next();

            //get next key
            key=entry.getKey();
            if((key!=null)&&(key.indexOf("org.fax4j.")==-1))    //filter out fax4j properties
            {
                //get next value
                value=entry.getValue();
                
                //put in properties
                this.mailConnectionProperties.setProperty(key,value);
            }
        }
        
        //get user/password values
        this.userName=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.USER_NAME_PROPERTY_KEY);
        this.password=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.PASSWORD_PROPERTY_KEY);

        //get transport protocol
        this.transportProtocol=this.factoryConfigurationHolder.getConfigurationValue("mail.transport.protocol");
        if(this.transportProtocol==null)
        {
            this.transportProtocol="smtp";
        }

        //get transport host
        this.transportHost=this.factoryConfigurationHolder.getConfigurationValue("mail.smtp.host");
        
        //get transport port
        String transportPortStr=this.factoryConfigurationHolder.getConfigurationValue("mail.smtp.port");
        this.transportPort=-1;
        if(transportPortStr!=null)
        {
            this.transportPort=Integer.parseInt(transportPortStr);
        }
    }
1100054
@SuppressWarnings("unchecked")
	@Override
	public void initialize() {
		// grab a handle to the hash table from the iteration broker
		if (taskContext instanceof AbstractIterativePactTask) {
			AbstractIterativePactTask<?, ?> iterativeTaskContext = (AbstractIterativePactTask<?, ?>) taskContext;
			String identifier = iterativeTaskContext.brokerKey();
			this.hashTable = (CompactingHashTable<IT1>) SolutionSetBroker.instance().get(identifier);
		} else {
			throw new RuntimeException("The task context of this driver is no iterative task context.");
		}
		
		TypeSerializer<IT1> buildSideSerializer = hashTable.getBuildSideSerializer();
		TypeComparator<IT1> buildSideComparator = hashTable.getBuildSideComparator().duplicate();
		
		probeSideSerializer = taskContext.<IT2>getInputSerializer(0).getSerializer();
		probeSideComparator = taskContext.getInputComparator(0);
		
		solutionSideRecord = buildSideSerializer.createInstance();
		
		TypePairComparatorFactory<IT1, IT2> pairCompFactory = taskContext.getTaskConfig().getPairComparatorFactory(taskContext.getUserCodeClassLoader());
		pairComparator = pairCompFactory.createComparator21(buildSideComparator, probeSideComparator);
	}