public static String getContextRoot ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { final DeploymentUnit unit = WSHelper . getRequiredAttachment ( dep , DeploymentUnit . class ) ; final JBossAppMetaData jbossAppMD = unit . getParent ( ) == null ? null : ASHelper . getOptionalAttachment ( unit . getParent ( ) , WSAttachmentKeys . JBOSS_APP_METADATA_KEY ) ; String contextRoot = null ; // prefer context root defined in application.xml over one defined in jboss-web.xml if ( jbossAppMD != null ) { final ModuleMetaData moduleMD = jbossAppMD . getModules ( ) . get ( dep . getSimpleName ( ) ) ; if ( moduleMD != null ) { final WebModuleMetaData webModuleMD = ( WebModuleMetaData ) moduleMD . getValue ( ) ; contextRoot = webModuleMD . getContextRoot ( ) ; } } if ( contextRoot == null ) { contextRoot = jbossWebMD != null ? jbossWebMD . getContextRoot ( ) : null ; } return contextRoot ; }
Returns context root associated with webservice deployment .