@Override
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        // Commented for http://code.google.com/p/sipservlets/issues/detail?id=168
    	// When no sip.xml but annotations only, Application is not recognized as SIP App by AS7
//        SipMetaData sipMetaData = deploymentUnit.getAttachment(SipMetaData.ATTACHMENT_KEY);
//        if (sipMetaData == null) {
//            return;
//        }
        SipAnnotationMetaData sipAnnotationsMetaData = deploymentUnit.getAttachment(SipAnnotationMetaData.ATTACHMENT_KEY);
        if (sipAnnotationsMetaData == null) {
            sipAnnotationsMetaData = new SipAnnotationMetaData();
            deploymentUnit.putAttachment(SipAnnotationMetaData.ATTACHMENT_KEY, sipAnnotationsMetaData);
        }
        Map<ResourceRoot, Index> indexes = AnnotationIndexUtils.getAnnotationIndexes(deploymentUnit);

        // Process components
        for (final Entry<ResourceRoot, Index> entry : indexes.entrySet()) {
            if (logger.isDebugEnabled()) logger.debug("doDeploy(): processing annotations from " + entry.getKey().getRootName());
            final Index jarIndex = entry.getValue();
            SipMetaData sipMetaData = processAnnotations(sipAnnotationsMetaData, jarIndex);
            if(sipMetaData != null) {
            	// https://github.com/Mobicents/sip-servlets/issues/68 Adding only the ones that actually have annotations 
            	// to save memory and computing time later on
            	sipAnnotationsMetaData.put(entry.getKey().getRootName(), sipMetaData);
            }
        }
    }
@ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; SipAnnotationMetaData sipAnnotationsMetaData = deploymentUnit . getAttachment ( SipAnnotationMetaData . ATTACHMENT_KEY ) ; if ( sipAnnotationsMetaData == null ) { sipAnnotationsMetaData = new SipAnnotationMetaData ( ) ; deploymentUnit . putAttachment ( SipAnnotationMetaData . ATTACHMENT_KEY , sipAnnotationsMetaData ) ; } Map < ResourceRoot , Index > indexes = AnnotationIndexUtils . getAnnotationIndexes ( deploymentUnit ) ; for ( final Entry < ResourceRoot , Index > entry : indexes . entrySet ( ) ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "doDeploy(): processing annotations from " + entry . getKey ( ) . getRootName ( ) ) ; final Index jarIndex = entry . getValue ( ) ; SipMetaData sipMetaData = processAnnotations ( sipAnnotationsMetaData , jarIndex ) ; if ( sipMetaData != null ) { sipAnnotationsMetaData . put ( entry . getKey ( ) . getRootName ( ) , sipMetaData ) ; } } }
Process web annotations.