AddFactory
@param IEnumerable<ValueProxyFactory> $factories
@return void
163002
public static function AddFactory( &$factories)
	{
		foreach ( $factories as /** @var ValueProxyFactory $curr */ $curr )
		{
			if ( count( ValueProxy::$valueFactory ) == ValueProxy::TYPES_MAX )
				throw new InvalidOperationException();

			ValueProxy::$valueFactory[ $curr->GetValueType()->getTypeName() ] = $curr;
		}
		ValueProxy::Bind();
	}
74971
public static void addDependencyFactory(Object... dependencyFactories) {
        for (Object dependencyFactory : dependencyFactories) {
            if (!dependencyFactory.getClass().isAnnotationPresent(DependencyFactory.class)) {
                throw new AvicennaRuntimeException(
                        dependencyFactory.getClass() + " should be annotated with DependencyFactory.");
            }
            if (Avicenna.dependencyFactories.contains(dependencyFactory.getClass())) {
                throw new AvicennaRuntimeException(
                        dependencyFactory.getClass() + " has already been added to container.");
            }
            addDependencyFactoryToContainer(dependencyFactory);
            Avicenna.dependencyFactories.add(dependencyFactory.getClass());
        }
    }
263360
public final Factory registerFactory(Factory factory) {
        if (factory == null) {
            throw new NullPointerException();
        }
        try {
            factoryLock.acquireWrite();
            factories.add(0, factory);
            clearCaches();
        }
        finally {
            factoryLock.releaseWrite();
        }
        notifyChanged();
        return factory;
    }
1077090
public function build(JobFactory $factory, DictionaryDefinition $definition): DictionaryInterface
    {
        $dictionary = new CompoundDictionary($definition->getSourceLanguage(), $definition->getTargetLanguage());
        $overrides  = [
            'source_language' => $definition->getSourceLanguage(),
            'target_language' => $definition->getTargetLanguage()
        ];
        foreach ($definition->get('dictionaries') as $child) {
            /** @var DictionaryDefinition $child */
            $dictionary->addDictionary(
                $child->get('prefix'),
                $factory->createDictionary(new DecoratedDictionaryDefinition($child, $overrides))
            );
        }

        return $dictionary;
    }
1281837
@SuppressWarnings("unchecked")
    public void removeExtensionFactory(ExtensionFactory factory) {
        synchronized (lock) {
            if (initialized && !destroyed) {
                if (null == extensionFactories) {
                    extensionFactories = new ArrayList();
                }
                extensionFactories.remove(factory);
                initializeExtensionProcessors(extensionFactories);
            } else {
                if (extensionFactories!=null) {
                    extensionFactories.remove(factory);
                }
            }
        }
    }
539238
public ProductFactoryCascade<T> addFactoryBefore(ProductFactory<? extends T> factory) {
		ArrayList<ProductFactory<? extends T>> factories = new ArrayList<ProductFactory<? extends T>>(this.factories.size()+1);
		factories.addAll(this.factories);
		factories.add(0, factory);
		return new ProductFactoryCascade<>(factories);
	}
1119140
public void registerFactory(String name, String groupName, Factory factory) {
        getProxyBuilder().factories.put(name, factory);
        getRegistrationGroup(groupName).add(name);
        factory.onFactoryRegistration(this, name, groupName);
    }
1348553
@Override
    public void registerFactory(String name, Class<? extends ChannelFactory> factory) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "registerFactory: " + name + "; " + factory);
        }
        synchronized (this.factories) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Class<? extends ChannelFactory> prevFactory = this.factories.get(name);
                if (null != prevFactory && factory != prevFactory) {
                    Tr.event(tc, "WARNING: overlaying existing factory: " + prevFactory);
                }
            }
            this.factories.put(name, factory);
        } // 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);
    }
784555
public function addFactory(PaginatedCollectionRequestFactoryInterface $factory, $priority = 0)
    {
        $this->factories[$priority][] = $factory;

        unset($this->sorted);
    }
184054
public function addStaticFactory(string $key, string $factory): StaticFactoryResolver
    {
        if (is_subclass_of($factory, StaticFactoryInterface::class, true) === false) {
            throw new InvalidStaticFactory($factory);
        }

        $this->factories[$key] = $factory;

        return $this;
    }
973378
public function setEntityFactory(EntityFactory $factory = null)
    {
        if ($factory === null) {
            $factory = new Entity();
        }
        $this->factory = $factory;
        return $this;
    }
1280668
public function addTermsFactory( $factory_name, $taxonomy ) {
		// do nothing if factory name is already taken
		if ( ! empty( $this->_factories[ $factory_name ] ) ) {
			return false;
		}

		// do nothing if a taxonomy doesn't exist
		if ( ! taxonomy_exists( $taxonomy ) ) {
			return false;
		}

		$this->_factories[ $factory_name ] = new TermsFactory( $taxonomy );
		
		return true;
	}
1218045
public function registerFactory($factory, $class)
    {
        $this[$factory] = $this->factory(function ($app) use ($class) {
            $obj = new $class;
            if ($obj instanceof FactoryInterface) {
                return $obj->create($app);
            } else {
                return $obj;
            }
        });
    }
1373486
@Bind(aggregate = true)
    public void bindFactory(Factory factory) {

        // Only support primitive component
        if (!(factory instanceof ComponentFactory)) {
            return;
        }

        String cn = factory.getClassName();
        if (cn == null) {
            return;
        }

        // Has the factory the annotation
        try {
            Class clazz = ((ComponentFactory) factory).loadClass(cn);
            InstantiatedBy annotation = (InstantiatedBy) clazz.getAnnotation(InstantiatedBy.class);

            if (annotation != null) {
                // Match !
                LOGGER.info("Factory annotated with `@InstantiatedBy` found : {}, configuration : {}",
                        factory.getName(),
                        annotation.value());

                addInstanceDeclaration(factory, annotation.value());
            }
        } catch (ClassNotFoundException e) {
            LOGGER.error("Cannot load the component class {}", cn, e);
        }
    }
539598
public function addFactory($name, $factory, $shared = null)
    {
        return $this->add($name, $factory, self::ENTRY_TYPE_FACTORY, $shared);
    }
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);
	}
341254
final public function factory($factory)
    {
        if (\is_string($factory) && 1 === substr_count($factory, ':')) {
            $factoryParts = explode(':', $factory);

            throw new InvalidArgumentException(sprintf('Invalid factory "%s": the "service:method" notation is not available when using PHP-based DI configuration. Use "[ref(\'%s\'), \'%s\']" instead.', $factory, $factoryParts[0], $factoryParts[1]));
        }

        $this->definition->setFactory(static::processValue($factory, true));

        return $this;
    }