Adds a new factory for processing.

@param cacheStoreFactory Factory to be added.
176302
public void addCacheStoreFactory(CacheStoreFactory cacheStoreFactory) {
      if(cacheStoreFactory == null) {
         throw log.unableToAddNullCustomStore();
      }
      factories.add(0, cacheStoreFactory);
   }
1285151
public void addHandlerFactory(ManagementRequestHandlerFactory factory) {
        for (;;) {
            final ManagementRequestHandlerFactory[] snapshot = updater.get(this);
            final int length = snapshot.length;
            final ManagementRequestHandlerFactory[] newVal = new ManagementRequestHandlerFactory[length + 1];
            System.arraycopy(snapshot, 0, newVal, 0, length);
            newVal[length] = factory;
            if (updater.compareAndSet(this, snapshot, newVal)) {
                return;
            }
        }
    }
1217600
@Override
    protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
        beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(servletContext));
        beanFactory.ignoreDependencyInterface(ServletContextAware.class);
        beanFactory.registerResolvableDependency(ServletContext.class, servletContext);

        WebApplicationContextUtils.registerWebApplicationScopes(beanFactory);
    }
810452
public function addStorageFactory(StorageFactoryInterface $factory)
    {
        $factoryName = $factory->getName();
        if (empty($factoryName)) {
            throw new InvalidArgumentException(sprintf('The storage factory %s has empty name', get_class($factory)));
        }
        if (array_key_exists($factoryName, $this->storagesFactories)) {
            throw new InvalidArgumentException(sprintf('The storage factory with such name %s already registered', $factoryName));
        }

        $this->storagesFactories[$factoryName] = $factory;
    }
1223796
private static void speedUpDcoumentBuilderFactory() {
        if (System.getProperty(DOCUMENT_BUILDER_FACTORY_PROP_NAME) == null) {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            if (DOCUMENT_BUILDER_FACTORY_IMPL_CLASS_NAME.equals(factory.getClass().getName())) {
                // This would avoid the file system to be accessed every time
                // the internal DocumentBuilderFactory is instantiated.
                System.setProperty(DOCUMENT_BUILDER_FACTORY_PROP_NAME,
                        DOCUMENT_BUILDER_FACTORY_IMPL_CLASS_NAME);
            }
        }
    }
894695
@Reference(cardinality=ReferenceCardinality.MULTIPLE, policy=ReferencePolicy.DYNAMIC)
	public void addFactory(ConfigurationsProvider factory) {
		if (logger.isLoggable(Level.FINER)) {
			logger.finer("Adding factory: " + factory);
		}
		providers.add(factory);
	}
1231174
public final Cache2kBuilder<K,V> addAsyncListener(CacheEntryOperationListener<K,V> listener) {
    config().getAsyncListeners().add(wrapCustomizationInstance(listener));
    return this;
  }
951740
public <T extends StoreConfigurationBuilder<?, ?>> T addStore(Class<T> klass) {
      try {
         Constructor<T> constructor = klass.getDeclaredConstructor(PersistenceConfigurationBuilder.class);
         T builder = constructor.newInstance(this);
         this.stores.add(builder);
         return builder;
      } catch (Exception e) {
         throw new CacheConfigurationException("Could not instantiate loader configuration builder '" + klass.getName()
               + "'", e);
      }
   }
1128666
public CacheSimpleConfig setCacheWriterFactory(String cacheWriterFactory) {
        if (cacheWriter != null && cacheWriterFactory != null) {
            throw new IllegalStateException("Cannot set cacheWriterFactory to '" + cacheWriterFactory
                    + "', because cacheWriter is already set to '" + cacheWriter + "'.");
        }
        this.cacheWriterFactory = cacheWriterFactory;
        return this;
    }
1251004
public function getCacheFactory(): ?Factory
    {
        if (!$this->hasCacheFactory()) {
            $this->setCacheFactory($this->getDefaultCacheFactory());
        }
        return $this->cacheFactory;
    }
37252
@Override
  public WriteLockedOffHeapClockCache<K, V> newInstance() {
    StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance();
    try {
      if (evictionListener == null) {
        return new WriteLockedOffHeapClockCache<>(tableSource, storageEngine, tableSize);
      } else {
        return new EvictionListeningWriteLockedOffHeapClockCache<>(evictionListener, tableSource, storageEngine, tableSize);
      }
    } catch (RuntimeException e) {
      storageEngine.destroy();
      throw e;
    }
  }
211828
@Override
    public void registerFactories(ChannelFactoryProvider provider) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Register factory provider; " + provider.getClass().getName());
        }
        synchronized (this.factories) {
            for (Entry<String, Class<? extends ChannelFactory>> entry : provider.getTypes().entrySet()) {
                this.providers.put(entry.getKey(), provider);
                Class<? extends ChannelFactory> newFactory = entry.getValue();
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Class<? extends ChannelFactory> prevFactory = this.factories.get(entry.getKey());
                    if (null != prevFactory && newFactory != prevFactory) {
                        Tr.event(tc, "WARNING: overlaying existing factory: " + prevFactory);
                    }
                }
                this.factories.put(entry.getKey(), newFactory);
            }
        } // end-sync

        // now that we have a new factory type, tell ChannelUtils to process
        // any delayed config that might be waiting for it
        ChannelUtils.loadConfig(null);
    }
645331
protected EmbeddedCacheManager createCacheManager(Properties properties, ServiceRegistry serviceRegistry) {
      for (EmbeddedCacheManagerProvider provider : ServiceLoader.load(EmbeddedCacheManagerProvider.class, EmbeddedCacheManagerProvider.class.getClassLoader())) {
         EmbeddedCacheManager cacheManager = provider.getEmbeddedCacheManager(properties);
         if (cacheManager != null) {
            return cacheManager;
         }
      }
      return new DefaultCacheManagerProvider(serviceRegistry).getEmbeddedCacheManager(properties);
   }
1030289
@Reference(service = ChannelFactoryProvider.class,
               cardinality = ReferenceCardinality.MULTIPLE,
               policy = ReferencePolicy.DYNAMIC,
               policyOption = ReferencePolicyOption.GREEDY)
    protected void setFactoryProvider(ChannelFactoryProvider provider) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "Add factory provider; " + provider);
        }

        this.chfw.registerFactories(provider);
    }
903324
private void injectCache(LongConsumer cacheAware) {
      if (cacheAware instanceof CacheAware) {
         ((CacheAware) cacheAware).injectCache(registry.getComponent(Cache.class));
      }
   }
1099374
public void configureWebAppHelperFactory(WebAppConfiguratorHelperFactory webAppConfiguratorHelperFactory, ResourceRefConfigFactory resourceRefConfigFactory) {
        webAppHelper = webAppConfiguratorHelperFactory.createWebAppConfiguratorHelper(this, resourceRefConfigFactory, getListenerInterfaces());        
        this.configHelpers.add(webAppHelper);
    }
631016
public static void addToCache(AdvancedCache cache, PutFromLoadValidator validator) {
      AsyncInterceptorChain chain = cache.getAsyncInterceptorChain();
      List<AsyncInterceptor> interceptors = chain.getInterceptors();
      log.debugf("Interceptor chain was: ", interceptors);
      int position = 0;
		// add interceptor before uses exact match, not instanceof match
		int entryWrappingPosition = 0;
      for (AsyncInterceptor ci : interceptors) {
			if (ci instanceof EntryWrappingInterceptor) {
				entryWrappingPosition = position;
			}
			position++;
		}
		boolean transactional = cache.getCacheConfiguration().transaction().transactionMode().isTransactional();
      BasicComponentRegistry componentRegistry =
         cache.getComponentRegistry().getComponent(BasicComponentRegistry.class);
      if (transactional) {
			TxInvalidationInterceptor txInvalidationInterceptor = new TxInvalidationInterceptor();
			// We have to use replaceComponent because tests call addToCache more than once
         componentRegistry.replaceComponent(TxInvalidationInterceptor.class.getName(), txInvalidationInterceptor, true);
         componentRegistry.getComponent(TxInvalidationInterceptor.class).running();
			chain.replaceInterceptor(txInvalidationInterceptor, InvalidationInterceptor.class);

			// Note that invalidation does *NOT* acquire locks; therefore, we have to start invalidating before
			// wrapping the entry, since if putFromLoad was invoked between wrap and beginInvalidatingKey, the invalidation
			// would not commit the entry removal (as during wrap the entry was not in cache)
         TxPutFromLoadInterceptor txPutFromLoadInterceptor = new TxPutFromLoadInterceptor(validator, ByteString.fromString(cache.getName()));
         componentRegistry.replaceComponent(TxPutFromLoadInterceptor.class.getName(), txPutFromLoadInterceptor, true);
         componentRegistry.getComponent(TxPutFromLoadInterceptor.class).running();
         chain.addInterceptor(txPutFromLoadInterceptor, entryWrappingPosition);
		}
		else {
			NonTxPutFromLoadInterceptor nonTxPutFromLoadInterceptor = new NonTxPutFromLoadInterceptor(validator, ByteString.fromString(cache.getName()));
         componentRegistry.replaceComponent(NonTxPutFromLoadInterceptor.class.getName(), nonTxPutFromLoadInterceptor, true);
         componentRegistry.getComponent(NonTxPutFromLoadInterceptor.class).running();
         chain.addInterceptor(nonTxPutFromLoadInterceptor, entryWrappingPosition);

			NonTxInvalidationInterceptor nonTxInvalidationInterceptor = new NonTxInvalidationInterceptor();
         componentRegistry.replaceComponent(NonTxInvalidationInterceptor.class.getName(), nonTxInvalidationInterceptor, true);
         componentRegistry.getComponent(NonTxInvalidationInterceptor.class).running();
			chain.replaceInterceptor(nonTxInvalidationInterceptor, InvalidationInterceptor.class);

			LockingInterceptor lockingInterceptor = new LockingInterceptor();
         componentRegistry.replaceComponent(LockingInterceptor.class.getName(), lockingInterceptor, true);
         componentRegistry.getComponent(LockingInterceptor.class).running();
			chain.replaceInterceptor(lockingInterceptor, NonTransactionalLockingInterceptor.class);
		}
		log.debugf("New interceptor chain is: ", cache.getAsyncInterceptorChain());

      CacheCommandInitializer cacheCommandInitializer =
         componentRegistry.getComponent(CacheCommandInitializer.class).running();
		cacheCommandInitializer.addPutFromLoadValidator(cache.getName(), validator);
	}