public static DeploymentUnit getSipContextAnchorDu ( final DeploymentUnit du ) { // attach context to top-level deploymentUnit so it can be used to get context resources (SipFactory, etc.) DeploymentUnit parentDu = du . getParent ( ) ; if ( parentDu == null ) { // this is a war only deployment return du ; } else if ( DeploymentTypeMarker . isType ( DeploymentType . EAR , parentDu ) ) { return parentDu ; } else { logger . error ( "Can't find proper anchor deployment unit for " + du . getName ( ) + " - This is probably a bug" ) ; return null ; } }
returns the anchor deployment unit that will have attached a SIPWebContext