public function setLoader(LoaderInterface $loader)
    {
        $this->loader = $loader;

        if ($this->collector && ($loader instanceof ResourceAwareInterface)) {
            $loader->setResourceCollector($this->collector);
        }

        if ($loader instanceof WiseAwareInterface) {
            $loader->setWise($this);
        }

        if ($loader instanceof DelegatingLoader) {
            $resolver = $loader->getResolver();

            if ($this->collector && ($resolver instanceof ResourceAwareInterface)) {
                $resolver->setResourceCollector($this->collector);
            }

            if ($resolver instanceof WiseAwareInterface) {
                $resolver->setWise($this);
            }

        }
    }