protected function configureOperation(AnnotationCollection $annotations, 
                                          MethodReflection $method, ArrayObject $serviceSpec)
    {
        // Skip if no annotations are present and operations
        // has previously been configured
        if (!$annotations->count() && isset($serviceSpec['operations'][$method->getName()])) {
            return;
        }
        
        $operationSpec = new ArrayObject(array(
            'events' => array(), 
            'contexts' => $serviceSpec['contexts'],
            'aliases' => array(),
            'inherit' => false,
            'exclude' => null)
        );
        
        $events = $this->getEventManager();
        
        $event = new Event();
        $event->setParams(array(
            'name'        => $method->getName(),
            'serviceSpec' => $serviceSpec,
            'operationSpec' => $operationSpec
        ));
        
        foreach ($annotations as $annotation) {
            $event->setParam('annotation', $annotation);
            $events->trigger(__FUNCTION__, $this, $event);
        }
        
        // Skip annotations if inherit flag is set
        if ($operationSpec['inherit'] === true) {
            return;
        }
        
        // Do not configure operation if it is excluded on
        // service or operation level
        $excludePatterns = $serviceSpec['exclude_patterns'];

        if ($operationSpec['exclude'] === true) {
            return;
        } elseif ($operationSpec['exclude'] === null && sizeof($excludePatterns)) {
            foreach ($excludePatterns as $excludePattern) {
               if (preg_match($excludePattern, $method->getName())) {
                   return;
               }
            }
        }
        
        unset($operationSpec['exclude']);
        
        // Configure operation (overwrites any existing configurations
        // for this operation)
        $serviceSpec['operations'][$method->getName()] = $operationSpec;
    }