public AxisConfiguration populateAxisConfiguration(InputStream in) throws DeploymentException { // Dirty hack necessary because class loading in AxisConfigBuilder is completely broken: // although it is possible to configure the class loaders explicitly in the AxisConfiguration, // the AxisConfigBuilder will still use the thread context class loader in some places. // On the other hand, in an OSGi environment, the TCCL is not well defined. To avoid problems, // we set it to the class loader of the Axis2 OSGi bundle. Thread currentThread = Thread.currentThread(); ClassLoader savedTCCL = currentThread.getContextClassLoader(); currentThread.setContextClassLoader(OSGiServerConfigurator.class.getClassLoader()); try { axisConfig = new AxisConfiguration(); AxisConfigBuilder builder = new AxisConfigBuilder(in, axisConfig, this); builder.populateConfig(); try { if (in != null) { in.close(); } } catch (IOException e) { String msg = "Error in closing input stream"; throw new DeploymentException(msg, e); } //TODO: if module deployer neede to set it should be set here. return axisConfig; } finally { currentThread.setContextClassLoader(savedTCCL); } }
axisConfig = new AxisConfiguration(); AxisConfigBuilder builder = new AxisConfigBuilder(in, axisConfig, this); builder.populateConfig(); try { if (in != null) {
axisConfig = new AxisConfiguration(); AxisConfigBuilder builder = new AxisConfigBuilder(in, axisConfig, this); builder.populateConfig(); try { if (in != null) {
/** * Creates configuration context using resource file found in the classpath. * * @return Returns ConfigurationContext. */ public static ConfigurationContext createBasicConfigurationContext(String resourceName) throws Exception { InputStream in = Loader.getResourceAsStream(resourceName); AxisConfiguration axisConfig = new AxisConfiguration(); AxisConfigBuilder builder = new AxisConfigBuilder(in, axisConfig, null); builder.populateConfig(); axisConfig.validateSystemPredefinedPhases(); ConfigurationContext configContext = new ConfigurationContext(axisConfig); if (axisConfig.getClusteringAgent() != null) { configContext.initCluster(); } setContextPaths(axisConfig, configContext); return configContext; } }
/** * Creates configuration context using resource file found in the classpath. * * @return Returns ConfigurationContext. */ public static ConfigurationContext createBasicConfigurationContext(String resourceName) throws Exception { InputStream in = Loader.getResourceAsStream(resourceName); AxisConfiguration axisConfig = new AxisConfiguration(); AxisConfigBuilder builder = new AxisConfigBuilder(in, axisConfig, null); builder.populateConfig(); axisConfig.validateSystemPredefinedPhases(); ConfigurationContext configContext = new ConfigurationContext(axisConfig); if (axisConfig.getClusteringAgent() != null) { configContext.initCluster(); } setContextPaths(axisConfig, configContext); return configContext; } }