public EndpointConfig resolveEndpointConfig ( ) { final String endpointClassName = getEndpointClassName ( ) ; // 1) default values //String configName = org.jboss.wsf.spi.metadata.config.EndpointConfig.STANDARD_ENDPOINT_CONFIG; String configName = endpointClassName ; String configFile = EndpointConfig . DEFAULT_ENDPOINT_CONFIG_FILE ; boolean specifiedConfig = false ; // 2) annotation contribution if ( isEndpointClassAnnotated ( org . jboss . ws . api . annotation . EndpointConfig . class ) ) { final String cfgName = getEndpointConfigNameFromAnnotation ( ) ; if ( cfgName != null && ! cfgName . isEmpty ( ) ) { configName = cfgName ; } final String cfgFile = getEndpointConfigFileFromAnnotation ( ) ; if ( cfgFile != null && ! cfgFile . isEmpty ( ) ) { configFile = cfgFile ; } specifiedConfig = true ; } // 3) descriptor overrides (jboss-webservices.xml or web.xml) final String epCfgNameOverride = getEndpointConfigNameOverride ( ) ; if ( epCfgNameOverride != null && ! epCfgNameOverride . isEmpty ( ) ) { configName = epCfgNameOverride ; specifiedConfig = true ; } final String epCfgFileOverride = getEndpointConfigFileOverride ( ) ; if ( epCfgFileOverride != null && ! epCfgFileOverride . isEmpty ( ) ) { configFile = epCfgFileOverride ; } // 4) setup of configuration if ( configFile != EndpointConfig . DEFAULT_ENDPOINT_CONFIG_FILE ) { //look for provided endpoint config file try { ConfigRoot configRoot = ConfigMetaDataParser . parse ( getConfigFile ( configFile ) ) ; EndpointConfig config = configRoot . getEndpointConfigByName ( configName ) ; if ( config == null && ! specifiedConfig ) { config = configRoot . getEndpointConfigByName ( EndpointConfig . STANDARD_ENDPOINT_CONFIG ) ; } if ( config != null ) { return config ; } } catch ( IOException e ) { throw Messages . MESSAGES . couldNotReadConfigFile ( configFile ) ; } } else { EndpointConfig config = null ; URL url = getDefaultConfigFile ( configFile ) ; if ( url != null ) { //the default file exists try { ConfigRoot configRoot = ConfigMetaDataParser . parse ( url ) ; config = configRoot . getEndpointConfigByName ( configName ) ; if ( config == null && ! specifiedConfig ) { config = configRoot . getEndpointConfigByName ( EndpointConfig . STANDARD_ENDPOINT_CONFIG ) ; } } catch ( IOException e ) { throw Messages . MESSAGES . couldNotReadConfigFile ( configFile ) ; } } if ( config == null ) { //use endpoint configs from AS domain ServerConfig sc = getServerConfig ( ) ; config = sc . getEndpointConfig ( configName ) ; if ( config == null && ! specifiedConfig ) { config = sc . getEndpointConfig ( EndpointConfig . STANDARD_ENDPOINT_CONFIG ) ; } if ( config == null && specifiedConfig ) { throw Messages . MESSAGES . couldNotFindEndpointConfigName ( configName ) ; } } if ( config != null ) { return config ; } } return null ; }
Returns the EndpointConfig resolved for the current endpoint