Initialize related portlets. This must be called lazily so that MarketplacePortletDefinitions
instantiated as related portlets off of a MarketplacePortletDefinition do not always
instantiate their related MarketplacePortletDefinitions, ad infinitem.
348702
private void initRelatedPortlets() {
        final Set<MarketplacePortletDefinition> allRelatedPortlets = new HashSet<>();

        for (PortletCategory parentCategory :
                this.portletCategoryRegistry.getParentCategories(this)) {

            final Set<IPortletDefinition> portletsInCategory =
                    this.portletCategoryRegistry.getAllChildPortlets(parentCategory);

            for (IPortletDefinition portletDefinition : portletsInCategory) {
                allRelatedPortlets.add(
                        new MarketplacePortletDefinition(
                                portletDefinition,
                                this.marketplaceService,
                                this.portletCategoryRegistry));
            }
        }

        allRelatedPortlets.remove(this);
        this.relatedPortlets = allRelatedPortlets;
    }
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
    }
191245
private void initialize() {
        if(this.initialized) {
            return;
        }
        if (LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.INFO)) {
            if (this.sessionStoreService==null) {
                LoggingUtil.SESSION_LOGGER_CORE.logp(Level.INFO, methodClassName, "initialize", "SessionMgrComponentImpl.noPersistence");
            } else {
                String modeName = "sessionPersistenceMode";
                Object modeValue = this.mergedConfiguration.get(modeName);
                LoggingUtil.SESSION_LOGGER_CORE.logp(Level.INFO, methodClassName, "initialize", "SessionMgrComponentImpl.persistenceMode", new Object[] { modeValue });
            }
        }
        SessionProperties.setPropertiesInSMC(this.serverLevelSessionManagerConfig, this.mergedConfiguration);
        String cloneId = SessionManagerConfig.getCloneId();
        if (cloneId == null) {
            if (this.sessionStoreService==null && SessionManagerConfig.isTurnOffCloneId()) {
                /*-
                 * In tWAS, WsSessionAffinityManager sets the CloneID to -1 when two conditions are both met:
                 * A) Running in a standalone server (com.ibm.ws.runtime.service.WLM#getMemberUID()==null)
                 * B) The HttpSessionCloneId custom property is not explicitly set
                 * 
                 * In addition, tWAS will set the CloneID to "" (the empty String) if a third condition is also met:
                 * C) The NoAdditionalSessionInfo custom property is set to "true"
                 * 
                 * In lWAS, there's no notion of a "standalone" server, because potentially any lWAS server 
                 * could require a CloneID for session affinity. As a result, our logic for using an
                 * empty Clone ID on lWAS needs to be different than our logic on tWAS.
                 * 
                 * Since most customers who specify a session store will be interested in session affinity,
                 * we'll assume that these customers are always interested in a non-empty Clone ID.
                 * 
                 * We'll also assume that customers who do not specify a session store who also explicitly
                 * set the noAdditionalInfo property to "true" would prefer an empty Clone ID.
                 * 
                 * All customers can always explicitly set the cloneId property to override these assumptions.
                 */
                cloneId = "";
            } else {
                String serverId = getServerId(); // never returns null
                if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
                    LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "initialize", "serverId=" + serverId);
                }
                SessionManagerConfig.setServerId(serverId);
                cloneId = EncodeCloneID.encodeString(serverId); // never returns null
            }
            SessionManagerConfig.setCloneId(cloneId);
        }
        this.initialized=true;
    }
446651
@Override
  public void initialize() {
    if(databaseConnection == null) {
      return; // Supposedly we initialized already.
    }
    if(LOG.isDebugging()) {
      LOG.debugFine("Loading data from database connection.");
    }
    MultipleObjectsBundle bundle = databaseConnection.loadData();
    // Run at most once.
    databaseConnection = null;

    // Find DBIDs for bundle
    {
      DBIDs bids = bundle.getDBIDs();
      if(bids instanceof ArrayStaticDBIDs) {
        this.ids = (ArrayStaticDBIDs) bids;
      }
      else if(bids == null) {
        this.ids = DBIDUtil.generateStaticDBIDRange(bundle.dataLength());
      }
      else {
        this.ids = (ArrayStaticDBIDs) DBIDUtil.makeUnmodifiable(DBIDUtil.ensureArray(bids));
      }
    }
    // Replace id representation (it would be nicer if we would not need
    // DBIDView at all)
    this.idrep = new DBIDView(this.ids);
    relations.add(this.idrep);
    getHierarchy().add(this, idrep);

    DBIDArrayIter it = this.ids.iter();

    int numrel = bundle.metaLength();
    for(int i = 0; i < numrel; i++) {
      SimpleTypeInformation<?> meta = bundle.meta(i);
      @SuppressWarnings("unchecked")
      SimpleTypeInformation<Object> ometa = (SimpleTypeInformation<Object>) meta;
      WritableDataStore<Object> store = DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_DB, ometa.getRestrictionClass());
      for(it.seek(0); it.valid(); it.advance()) {
        store.put(it, bundle.data(it.getOffset(), i));
      }
      Relation<?> relation = new MaterializedRelation<>(ometa, ids, null, store);
      relations.add(relation);
      getHierarchy().add(this, relation);

      // Try to add indexes where appropriate
      for(IndexFactory<?> factory : indexFactories) {
        if(factory.getInputTypeRestriction().isAssignableFromType(ometa)) {
          @SuppressWarnings("unchecked")
          final IndexFactory<Object> ofact = (IndexFactory<Object>) factory;
          @SuppressWarnings("unchecked")
          final Relation<Object> orep = (Relation<Object>) relation;
          final Index index = ofact.instantiate(orep);
          Duration duration = LOG.isStatistics() ? LOG.newDuration(index.getClass().getName() + ".construction").begin() : null;
          index.initialize();
          if(duration != null) {
            LOG.statistics(duration.end());
          }
          getHierarchy().add(relation, index);
        }
      }
    }

    // fire insertion event
    eventManager.fireObjectsInserted(ids);
  }
1317429
public void initAllLoadedPlugins() throws PluginException {
		LOGGER.debug("Initializig all loaded plugins");
		for (Class<? extends Plugin> pluginClass : implementations.keySet()) {
			Set<PluginContext> set = implementations.get(pluginClass);
			for (PluginContext pluginContext : set) {
				try {
					pluginContext.initialize(pluginContext.getSystemSettings());
				} catch (Throwable e) {
					LOGGER.error("", e);
					pluginContext.setEnabled(false, false);
				}
			}
		}
	}
1182736
protected void init(T[] ancestorDefinition, T[] recipientDefinition, List<T> sameDefinitionData,
      List<RelatedDefinition<T>> changedDefinitionData, List<T> newDefinitionData, List<T> removedDefinitionData)
   {
      for (int i = 0; i < recipientDefinition.length; i++)
      {
         boolean isNew = true;
         for (int j = 0; j < ancestorDefinition.length; j++)
         {
            if (recipientDefinition[i].getName().equals(ancestorDefinition[j].getName()))
            {
               isNew = false;
               if (recipientDefinition[i].equals(ancestorDefinition[j]))
                  sameDefinitionData.add(recipientDefinition[i]);
               else
               {
                  RelatedDefinition<T> relatedDefinition =
                     new RelatedDefinition<T>(ancestorDefinition[j], recipientDefinition[i]);
                  changedDefinitionData.add(relatedDefinition);
               }
            }
         }
         if (isNew)
            newDefinitionData.add(recipientDefinition[i]);
      }
      for (int i = 0; i < ancestorDefinition.length; i++)
      {
         boolean isRemoved = true;
         for (int j = 0; j < recipientDefinition.length && isRemoved; j++)
         {
            if (recipientDefinition[j].getName().equals(ancestorDefinition[i].getName()))
            {
               isRemoved = false;
               break;
            }
         }
         if (isRemoved)
            removedDefinitionData.add(ancestorDefinition[i]);
      }
   }
1233262
void setInitializationData(Bundle contributingBundle, ServiceReference<?> urlConverterSR) {
		if (this.contributingBundle != null || this.urlConverterSR != null) {
			throw new IllegalStateException();
		}
		this.contributingBundle = contributingBundle;
		this.urlConverterSR = urlConverterSR;
	}
818900
private void initialise() {
    try {
      addTrafficSource();
      addTrafficLayers();
    } catch (Exception exception) {
      Timber.e(exception, "Unable to attach Traffic to current style: ");
    } catch (UnsatisfiedLinkError error) {
      Timber.e(error, "Unable to load native libraries: ");
    }
  }
8849
@RenderMapping
    public String initializeView(
            WebRequest webRequest,
            PortletRequest portletRequest,
            Model model,
            @RequestParam(required = false) String initialFilter) {
        this.setUpInitialView(webRequest, portletRequest, model, initialFilter);
        return "jsp/Marketplace/portlet/view";
    }
524295
protected void initialize()
	{
		// init transient fields
		bcmListeners = new ArrayList<BeanContextMembershipListener>();
		children = new HashMap();
		serializing = false;
		inNeedsGui = false;
		nonSerPCL = new PropertyChangeListener() {
			public void propertyChange(PropertyChangeEvent event)
			{
				BeanContextSupport.this.propertyChange(event);
			}
		};
	}
820005
private void initialize() {
		this.setOrder(EXTENSION_ORDER);
		this.customParsers = new LinkedList<>();
		this.customFetchFilters = new LinkedList<>();
		this.customParseFilters = new LinkedList<>();
		this.scanController = new SpiderScanController(this);
	}
122403
protected void initializePortletWindowData(
            HttpServletRequest request, PortletWindowData portletWindowData) {
        final IStylesheetDescriptor stylesheetDescriptor = getThemeStylesheetDescriptor(request);
        final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId();
        final IPortletEntity portletEntity =
                this.portletEntityRegistry.getPortletEntity(request, portletEntityId);
        final WindowState entityWindowState = portletEntity.getWindowState(stylesheetDescriptor);
        if (persistentWindowStates.contains(entityWindowState)) {
            portletWindowData.setWindowState(entityWindowState);
        } else if (entityWindowState != null) {
            // Set of persistent window states must have changed, nuke the old value
            this.logger.warn(
                    "PortletEntity.windowState="
                            + entityWindowState
                            + " but that state is not in the set of persistent WindowStates. PortletEntity.windowState will be set to null");
            portletEntity.setWindowState(stylesheetDescriptor, null);
            this.portletEntityRegistry.storePortletEntity(request, portletEntity);
        }
    }
1202683
public Set<MarketplacePortletDefinition> getRandomSamplingRelatedPortlets(final IPerson user) {

        Validate.notNull(user, "Cannot filter to BROWSEable by a null user");

        final IAuthorizationPrincipal principal =
                AuthorizationPrincipalHelper.principalFromUser(user);

        // lazy init is essential to avoid infinite recursion in graphing related portlets.
        if (this.relatedPortlets == null) {
            this.initRelatedPortlets();
        }
        if (this.relatedPortlets.isEmpty()) {
            return this.relatedPortlets;
        }

        List<MarketplacePortletDefinition> tempList =
                new ArrayList<MarketplacePortletDefinition>(this.relatedPortlets);
        Collections.shuffle(tempList);
        final int count = Math.min(QUANTITY_RELATED_PORTLETS_TO_SHOW, tempList.size());

        final Set<MarketplacePortletDefinition> rslt = new HashSet<MarketplacePortletDefinition>();

        for (final MarketplacePortletDefinition relatedPortlet : tempList) {

            if (marketplaceService.mayBrowsePortlet(principal, relatedPortlet)) {
                rslt.add(relatedPortlet);
            }

            if (rslt.size() >= count) break; // escape the loop if we've hit our target quantity
            // of related portlets
        }

        return rslt;
    }
1269906
def setupViewletByName(self, name):
        
        context = aq_inner(self.context)
        request = self.request

        # Perform viewlet regisration look-up
        # from adapters registry
        reg = self.getViewletByName(name)
        if reg is None:
            return None

        # factory method is responsible for creating the viewlet instance
        factory = reg.factory

        # Create viewlet and put it to the acquisition chain
        # Viewlet need initialization parameters: context, request, view
        try:
            viewlet = factory(context, request, self, None).__of__(context)
        except TypeError:
            # Bad constructor call parameters
            raise RuntimeError(
                "Unable to initialize viewlet {}. "
                "Factory method {} call failed."
                .format(name, str(factory)))

        return viewlet
680393
def initialize_ports(self) -> None:
        """"""
        if not self.params:
            self.initialize_params(preload_data=False)
            self.params.update_ports()

        self.ports = Ports(self.params, self.request)
462553
protected void initDefinitionsMapping() throws ServletException
    {
        definitionsFactory = null;
        TilesUtilImpl tilesUtil = TilesUtil.getTilesUtil();

        if ( tilesUtil instanceof TilesUtilStrutsImpl )
        {
            // Retrieve and set factory for this modules
            definitionsFactory =
                    ( ( TilesUtilStrutsImpl ) tilesUtil ).getDefinitionsFactory( getServletContext(), moduleConfig );

            if ( definitionsFactory == null && log.isDebugEnabled() )
            {
                log.debug( "Definition Factory not found for module: '"
                           + moduleConfig.getPrefix() );
            }
        }
    }
92872
@Override
   protected void initialize() throws ServletException {
      /*
       * The servlet defines any number of resource providers, and
       * configures itself to use them by calling
       * setResourceProviders()
       */
      List<IResourceProvider> resourceProviders = new ArrayList<IResourceProvider>();
      resourceProviders.add(new RestfulPatientResourceProvider());
      resourceProviders.add(new RestfulObservationResourceProvider());
      setResourceProviders(resourceProviders);
   }