Adds a factory in the factory chain

@param FilterBagFactoryInterface $factory
@param int                       $priority
344277
public function addFactory(FilterBagFactoryInterface $factory, $priority = 0)
    {
        $this->factories[$priority][] = $factory;

        unset($this->sorted);
    }
229794
public function enqueue(AnObjectHandlable $object, $priority)
    {
        $this->getRepositoryEntities($object->getRepository())->insert($object);

        return parent::enqueue($object, $priority);
    }
1340359
public function setMigrationFactory(FactoryInterface $factory)
    {
        foreach ($this->getRepositories() as $repo) {
            $repo->setMigrationFactory($factory);
        }
    }
603545
public void removeFactory(FileSetProvider factory) {
		if (logger.isLoggable(Level.FINER)) {
			logger.finer("Removing factory: " + factory);
		}
		filters.remove(factory);
	}
783107
private function addFilterReq($f, $priority = FilterChain::DEFAULT_PRIORITY) {
		$this->_filtersReq->attach($f, $priority);
	}
1135812
public function removeFilterHandler($filterName, $filterHandlerName, $priority = 50)
    {
        $this->removeHandler(self::FILTER, $filterName, $filterHandlerName, $priority);
    }
263736
public void addMessageSelectorFactory(MessageSelectorFactory<?> factory) {
        if (factory instanceof BeanFactoryAware) {
            ((BeanFactoryAware) factory).setBeanFactory(beanFactory);
        }

        this.factories.add(factory);
    }
806587
public ThreadFactoryBuilder setPriority(int priority) {
		if (priority < Thread.MIN_PRIORITY) {
			throw new IllegalArgumentException(StrUtil.format("Thread priority ({}) must be >= {}", priority, Thread.MIN_PRIORITY));
		}
		if (priority > Thread.MAX_PRIORITY) {
			throw new IllegalArgumentException(StrUtil.format("Thread priority ({}) must be <= {}", priority, Thread.MAX_PRIORITY));
		}
		this.priority = priority;
		return this;
	}
1311977
private function addFilterResAV($f, $priority = FilterChain::DEFAULT_PRIORITY) {
		$this->_filtersResAV->attach($f, $priority);
	}
11094
protected function injectContextToViewExtensionFactory(IViewExtensionFactory $factory)
    {
        if ($factory instanceof IContextAware) {
            $factory->clearContext();

            if ($this->hasContext()) {
                $factory->setContext($this->getContext());
            }
        }

        if ($factory instanceof IModelAware && $this->modelFactory) {
            $factory->setModelFactory($this->modelFactory);
        }
    }
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;
    }
510667
public function addFilter(FilterInterface $filter, $priority = 0)
	{
		if ( ! $filter instanceof FrameFilterInterface && ! $filter instanceof AudioFilterInterface)
		{
			throw new InvalidFilterException('Filter type is not supported.');
		}
		
		if ($priority > 99)
		{
			throw new \RangeException('Priority should be in the range from 0 to 99.');
		}
		
		$this->filters->insert($filter, $priority);
		
		return $this;
	}
803932
public function setFactory($factory)
    {
        if(is_string($factory))
            $factory = new $factory($this->factory->getLookupPath());

        if(!($factory instanceof Factory))
            throw new InvalidArgumentException('The map factory must be the the type of [\Exedra\Routing\Factory].');

        $this->factory = $factory;
    }
806718
public function insert($filter, $priority)
	{
		if ( ! $filter instanceof FilterInterface)
		{
			throw new \InvalidArgumentException('The filter must be an instance of FilterInterface.');
		}
		
		if ($filter instanceof FilterChainInterface)
		{
			parent::insert($filter, [-$priority, $this->serial--]);
		}
		else
		{
			if ($this->isEmpty())
			{
				parent::insert(new FilterChain(), [0, $this->serial--]);
			}
			
			$this->top()->addFilter($filter, $priority);
		}
		
		return $this;
	}
77132
public function add(FactoryInterface $factory, $before = null)
    {
        $pos = null;

        if ($before) {
            foreach ($this->factories as $i => $f) {
                if ($before instanceof FactoryInterface) {
                    if ($f === $before) {
                        $pos = $i;
                        break;
                    }
                } elseif (is_string($before)) {
                    if ($f instanceof $before) {
                        $pos = $i;
                        break;
                    }
                }
            }
        }

        if ($pos === null) {
            $this->factories[] = $factory;
        } else {
            array_splice($this->factories, $i, 0, array($factory));
        }

        return $this;
    }
472498
public function add($entry, $priority = self::DEFAULT_PRIORITY)
    {
        if (isset($this->entryClass) && !($entry instanceof $this->entryClass)) {
            throw new InvalidObjectClassException($this->entryClass, get_class($entry));
        }
        $this->entries[] = ['data' => $entry, 'priority' => $priority];
        $this->sorted = false;
        return $this;
    }
285621
public function setRecordFactory(\Plop\RecordFactoryInterface $factory)
    {
        $logger = $this->getIndirectLogger();
        $logger->setRecordFactory($factory);
        return $this;
    }