/**
  * Attach one or more listeners
  *
  * @param EventCollection $events
  * @return void
  */
 public function attach(EventCollection $events)
 {
     $options = $this->getOptions();
     $configListener = $this->getConfigListener();
     $locatorRegistrationListener = new LocatorRegistrationListener($options);
     $moduleAutoloader = new ModuleAutoloader($options->getModulePaths());
     $this->listeners[] = $events->attach('loadModules.pre', array($moduleAutoloader, 'register'), 1000);
     $this->listeners[] = $events->attach('loadModule.resolve', new ModuleResolverListener(), 1000);
     $this->listeners[] = $events->attach('loadModule', new AutoloaderListener($options), 2000);
     $this->listeners[] = $events->attach('loadModule', new InitTrigger($options), 1000);
     $this->listeners[] = $events->attachAggregate($locatorRegistrationListener);
     $this->listeners[] = $events->attachAggregate($configListener);
     return $this;
 }