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); } }
public void populateConfig() throws DeploymentException { try { OMElement config_element = buildOM(); processParameters(itr, axisConfig, axisConfig); config_element.getFirstChildWithName(new QName(TAG_MESSAGE_RECEIVERS)); if (messageReceiver != null) { HashMap mrs = processMessageReceivers(messageReceiver); Iterator keys = mrs.keySet().iterator(); while (keys.hasNext()) { processModuleRefs(moduleitr, axisConfig); processTransportSenders(trs_senders); processTransportReceivers(trs_Reivers); processTargetResolvers(axisConfig, targetResolvers); processThreadContextMigrators(axisConfig, threadContextMigrators); processObservers(obs_ittr); processPhaseOrders(phaseorders); processModuleConfig(moduleConfigs, axisConfig, axisConfig); processPolicyElements(policyElements, axisConfig.getPolicySubject());
OMElement element = (OMElement) XMLUtils.toOM(xmlStream); element.build(); AxisConfigBuilder builder = new AxisConfigBuilder(axisConfig); ArrayList transportReceivers = builder.processTransportReceivers(trs_Reivers); for (int i = 0; i < transportReceivers.size(); i++) { TransportInDescription transportInDescription = (TransportInDescription) transportReceivers.get(i); element.getChildrenWithName(new QName(DeploymentConstants.TAG_TRANSPORT_SENDER)); builder.processTransportSenders(trs_senders); super.deploy(deploymentFileData); } catch (Exception e) {
phase = getPhase(phaseClass); } catch (Exception e) { throw new DeploymentException( HandlerDescription handler = processHandler(omElement, axisConfig, phaseName);
public void populateConfig() throws DeploymentException { try { OMElement config_element = buildOM(); processParameters(itr, axisConfig, axisConfig); config_element.getFirstChildWithName(new QName(TAG_MESSAGE_RECEIVERS)); if (messageReceiver != null) { HashMap mrs = processMessageReceivers(messageReceiver); Iterator keys = mrs.keySet().iterator(); while (keys.hasNext()) { processModuleRefs(moduleitr, axisConfig); processTransportSenders(trs_senders); processTransportReceivers(trs_Reivers); processTargetResolvers(axisConfig, targetResolvers); processThreadContextMigrators(axisConfig, threadContextMigrators); processObservers(obs_ittr); processPhaseOrders(phaseorders); processModuleConfig(moduleConfigs, axisConfig, axisConfig); processPolicyElements(policyElements, axisConfig.getPolicySubject());
OMElement element = (OMElement) XMLUtils.toOM(xmlStream); element.build(); AxisConfigBuilder builder = new AxisConfigBuilder(axisConfig); ArrayList transportReceivers = builder.processTransportReceivers(trs_Reivers); for (int i = 0; i < transportReceivers.size(); i++) { TransportInDescription transportInDescription = (TransportInDescription) transportReceivers.get(i); element.getChildrenWithName(new QName(DeploymentConstants.TAG_TRANSPORT_SENDER)); builder.processTransportSenders(trs_senders); super.deploy(deploymentFileData); } catch (Exception e) {
phase = getPhase(phaseClass); } catch (Exception e) { throw new DeploymentException( HandlerDescription handler = processHandler(omElement, axisConfig, phaseName);
AxisConfigBuilder builder = new AxisConfigBuilder(in, axisConfig, this); builder.populateConfig(); try { if (in != null) {
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; } }