当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationContext.getAxisConfiguration方法代码示例

本文整理汇总了Java中org.apache.axis2.context.ConfigurationContext.getAxisConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationContext.getAxisConfiguration方法的具体用法?Java ConfigurationContext.getAxisConfiguration怎么用?Java ConfigurationContext.getAxisConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.context.ConfigurationContext的用法示例。


在下文中一共展示了ConfigurationContext.getAxisConfiguration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadTransportProperties

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
private static Properties loadTransportProperties() throws Exception {
	
	transportProperties = new Properties();

	try {
		ConfigurationContext configContext = CarbonConfigurationContextFactory.getConfigurationContext();
		AxisConfiguration axisConfig = configContext.getAxisConfiguration();
		TransportOutDescription mailto = axisConfig.getTransportOut("mailto"); 
		ArrayList<Parameter> parameters = mailto.getParameters();
		
           for (Parameter parameter : parameters) {
			String prop = parameter.getName();
			String value = (String)parameter.getValue();
			transportProperties.setProperty(prop, value);
		}
	}
	catch (Exception e) {
		throw e;
	}
	
	return transportProperties;
}
 
开发者ID:vasttrafik,项目名称:wso2-community-api,代码行数:23,代码来源:MailUtil.java

示例2: activate

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
protected void activate(ComponentContext ctxt) {
    try {
        ConfigurationContext mainConfigCtx = configContextService.getServerConfigContext();
        AxisConfiguration mainAxisConfig = mainConfigCtx.getAxisConfiguration();
        BundleContext bundleCtx = ctxt.getBundleContext();
        String enablePoxSecurity = ServerConfiguration.getInstance()
                .getFirstProperty("EnablePoxSecurity");
        if (enablePoxSecurity == null || "true".equals(enablePoxSecurity)) {
            mainAxisConfig.engageModule(POX_SECURITY_MODULE);
        } else {
            log.info("POX Security Disabled");
        }

        bundleCtx.registerService(SecurityConfigAdmin.class.getName(),
                new SecurityConfigAdmin(mainAxisConfig,
                        registryService.getConfigSystemRegistry(),
                        null),
                null);
        bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
                new SecurityAxis2ConfigurationContextObserver(),
                null);
        log.debug("Security Mgt bundle is activated");
    } catch (Throwable e) {
        log.error("Failed to activate SecurityMgtServiceComponent", e);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:27,代码来源:SecurityMgtServiceComponent.java

示例3: testOperationModule

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Confirm that an operation module a) doesn't cause any deployment problems, and
 * b) correctly configures the AxisOperation.
 *
 * @throws Exception if there is a problem
 */
public void testOperationModule() throws Exception {
    ConfigurationContext configCtx =
            ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                    AbstractTestCase.basedir +
                            "/test-resources/deployment/AxisMessageTestRepo");
    AxisConfiguration config = configCtx.getAxisConfiguration();
    AxisService service = config.getService("MessagetestService");
    assertNotNull("Couldn't find service", service);
    AxisOperation operation = service.getOperation(new QName("echoString"));
    assertNotNull("Couldn't find operation", operation);
    ArrayList moduleRefs = operation.getModuleRefs();
    assertEquals("Wrong # of modules", 1, moduleRefs.size());
    String moduleName = (String)moduleRefs.get(0);
    assertEquals("Wrong module name", "module1", moduleName);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:OperationModuleTest.java

示例4: testNoBuilder

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * A builder is not added for the multipart/mixed as in the above test.
 * @throws Exception
 */
public void testNoBuilder() throws Exception {
       File file = getTestResourceFile("mime_message.txt");
       MIMEBuilder mimeBuilder = new MIMEBuilder();
       FileInputStream fis = new FileInputStream(file);
       ConfigurationContext configContext = ConfigurationContextFactory.createDefaultConfigurationContext();
       AxisConfiguration axisConfig = configContext.getAxisConfiguration();
       MessageContext mc = new MessageContext();
       mc.setConfigurationContext(configContext);
       axisConfig.addMessageBuilder("multipart/related", new MIMEBuilder());
       axisConfig.addMessageBuilder("application/soap+xml", new SOAPBuilder());
       axisConfig.addMessageBuilder("text/xml", new SOAPBuilder());
       axisConfig.addMessageBuilder("application/xop+xml", new MTOMBuilder());
       axisConfig.addMessageBuilder("application/xml", new ApplicationXMLBuilder());
       axisConfig.addMessageBuilder("application/x-www-form-urlencoded",
                                    new XFormURLEncodedBuilder());
       axisConfig.addParameter(Constants.Configuration.USE_DEFAULT_FALLBACK_BUILDER, "true");
       OMElement envelope = TransportUtils.createSOAPMessage(mc,fis,"multipart/mixed;boundary=--MIMEBoundary258DE2D105298B756D");
       
       assertTrue(envelope != null);
       assertTrue(envelope instanceof SOAPEnvelope);
       OMElement firstElement = ((SOAPEnvelope)envelope).getBody().getFirstElement();
	assertTrue(firstElement instanceof OMSourcedElement);
	assertTrue(((OMSourcedElement)firstElement).getDataSource() instanceof UnknownContentOMDataSource);
   }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:29,代码来源:UnknownContentBuilderTest.java

示例5: invoke

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public void invoke() {

        ConfigurationContext mainCfgCtx =
                ConfigHolder.getInstance().getServerConfigurationContext();
        if (mainCfgCtx != null) {
            AxisConfiguration mainAxisConfig = mainCfgCtx.getAxisConfiguration();
            if (mainAxisConfig.getParameter(DiscoveryConstants.DISCOVERY_PROXY) != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Sending BYE messages for services deployed in the super tenant");
                }
                Util.unregisterServiceObserver(mainAxisConfig, true);
            }
        } else {
            log.warn("Unable to notify service undeployment. ConfigurationContext is " +
                    "unavailable.");
        }
    }
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:18,代码来源:DiscoveryShutdownHandler.java

示例6: testFindService

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public void testFindService() throws AxisFault {
    MessageContext messageContext;
    AxisService as1 = new AxisService("Service1");
    AxisService as2 = new AxisService("Service2");
    ConfigurationContext cc = ConfigurationContextFactory.createEmptyConfigurationContext();
    AxisConfiguration ac = cc.getAxisConfiguration();
    ac.addService(as1);
    ac.addService(as2);
    messageContext = cc.createMessageContext();

    SOAPEnvelope se = OMAbstractFactory.getSOAP11Factory().createSOAPEnvelope();
    SOAPBody sb = OMAbstractFactory.getSOAP11Factory().createSOAPBody(se);
    sb.addChild(OMAbstractFactory.getSOAP11Factory().createOMElement("operation2",
                                                                     "http://127.0.0.1:8080/axis2/services/Service2",
                                                                     "pfx"));
    messageContext.setEnvelope(se);


    SOAPMessageBodyBasedServiceDispatcher ruisd = new SOAPMessageBodyBasedServiceDispatcher();
    ruisd.invoke(messageContext);

    assertEquals(as2, messageContext.getAxisService());
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:SOAPMessageBodyBasedServiceDispatcherTest.java

示例7: createdConfigurationContext

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
@Override
public void createdConfigurationContext(ConfigurationContext configCtx) {
    AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
    int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
    //Register SecurityDeploymentInterceptor as an AxisObserver in tenant's AxisConfig.

    SecurityDeploymentInterceptor secDeployInterceptor = new SecurityDeploymentInterceptor();
    secDeployInterceptor.init(axisConfig);
    axisConfig.addObservers(secDeployInterceptor);

    //Store the policy resources in newly created tenant's config. registry
    Map<String, Resource> policyResourceMap = SecurityServiceHolder.getPolicyResourceMap();
    try {
        Registry registry = SecurityServiceHolder.getRegistryService().getConfigSystemRegistry(
                tenantId);
        boolean transactionStarted = Transaction.isStarted();
        if (!transactionStarted) {
            registry.beginTransaction();
        }
        for (Map.Entry<String, Resource> resourceLocEntry : policyResourceMap.entrySet()) {
            if (!registry.resourceExists(resourceLocEntry.getKey())) {
                registry.put(resourceLocEntry.getKey(), resourceLocEntry.getValue());
            }
        }
        if (!transactionStarted) {
            registry.commitTransaction();
        }
    } catch (Exception e) {
        String errorMsg = "Error when storing the policy resource in registry for tenant : " +
                tenantId;
        log.error(errorMsg, e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:34,代码来源:SecurityDeploymentListener.java

示例8: createdConfigurationContext

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
@Override
public void createdConfigurationContext(ConfigurationContext configurationContext) {
    AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
    AxisModule poxSecModule =
            axisConfig.getModule("POXSecurityModule");
    if (poxSecModule != null) {
        try {
            axisConfig.engageModule(poxSecModule);
        } catch (AxisFault e) {
            log.error("Cannot globally engage POX Security module", e);
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:14,代码来源:SecurityAxis2ConfigurationContextObserver.java

示例9: activate

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
@Activate
protected void activate(ComponentContext ctxt) {
    try {
        ConfigurationContext mainConfigCtx = configContextService.getServerConfigContext();
        AxisConfiguration mainAxisConfig = mainConfigCtx.getAxisConfiguration();
        BundleContext bundleCtx = ctxt.getBundleContext();
        String enablePoxSecurity = ServerConfiguration.getInstance()
                .getFirstProperty("EnablePoxSecurity");
        if (enablePoxSecurity == null || "true".equals(enablePoxSecurity)) {
            mainAxisConfig.engageModule(POX_SECURITY_MODULE);
        } else {
            log.info("POX Security Disabled");
        }

        bundleCtx.registerService(SecurityConfigAdmin.class.getName(),
                new SecurityConfigAdmin(mainAxisConfig,
                        registryService.getConfigSystemRegistry(),
                        null),
                null);
        bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
                new SecurityAxis2ConfigurationContextObserver(),
                null);
        log.debug("Security Mgt bundle is activated");
    } catch (Throwable e) {
        log.error("Failed to activate SecurityMgtServiceComponent", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:28,代码来源:SecurityMgtServiceComponent.java

示例10: init

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * This method will be executed in order to initialize the caching module and this
 * will set the CacheManager object to the ConfigurationContext and also populates the
 * CacheConfiguration according to the cache policy
 *
 * @param configContext - ConfigurationContext for the cache objects to be added
 * @param module        - AxisModule to be initialized
 * @throws AxisFault if an error occured in the process of initializing
 */
public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault {

    this.moduleName = module.getName();
    CacheConfiguration cacheConfig = null;
    CachingObserver cachingObserver = new CachingObserver();
    AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
    axisConfiguration.addObservers(cachingObserver);

    PolicySubject policySubject = module.getPolicySubject();

    if (policySubject != null) {
        try {
            cacheConfig = CachingPolicyProcessor.processCachingPolicy(policySubject);
        } catch (CachingException e) {
            handleException("Unable to initialize the caching module : " +
                    "Error in processing caching policy", e);
        }
    }

    // it is a must to have a gloabl configuration
    if (cacheConfig == null) {
        if (log.isDebugEnabled()) {
            log.debug("Using the default initializer for the CacheConfiguration");
        }
        cacheConfig = new CacheConfiguration();
    }

    configContext.getAxisConfiguration().addParameter(
            CachingConstants.CACHE_CONFIGURATION, cacheConfig);
    configContext.setNonReplicableProperty(CachingConstants.CACHE_MANAGER, new CacheManager());
}
 
开发者ID:wso2-attic,项目名称:carbon-qos,代码行数:41,代码来源:CachingModule.java

示例11: lookupAxisConfig

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public static AxisConfiguration lookupAxisConfig(int tid) {
  	ConfigurationContext mainConfigCtx = TasksDSComponent.getConfigurationContextService().
		getServerConfigContext();
AxisConfiguration tenantAxisConf;
if (tid == MultitenantConstants.SUPER_TENANT_ID) {
	tenantAxisConf = mainConfigCtx.getAxisConfiguration();
} else {
                  String tenantDomain = DBUtils.getTenantDomainFromId(tid);
    tenantAxisConf = TenantAxisUtils.getTenantAxisConfiguration(tenantDomain, 
    		mainConfigCtx);
}
return tenantAxisConf;
  }
 
开发者ID:wso2,项目名称:carbon-data,代码行数:14,代码来源:DSTaskUtils.java

示例12: findServices

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Search the service artifacts stored in the registry and find the set of services
 * that satisfy the conditions stated in the given WS-D probe. If the probe does not
 * impose any restrictions on the result set, all the services in the registry will
 * be returned.
 *
 * @param probe a WS-D probe describing the search criteria
 * @return an array of TargetService instances matching the probe or null
 * @throws Exception if an error occurs while accessing the registry
 */
public static TargetService[] findServices(Probe probe) throws Exception {
    ServiceManager serviceManager = new ServiceManager(getRegistry());
    DiscoveryServiceFilter filter = new DiscoveryServiceFilter(probe);

    // Check whether the inactive services should be skipped when searching
    AxisConfiguration axisConfig;
    String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true);
    ConfigurationContext mainCfgCtx = ConfigHolder.getInstance().getServerConfigurationContext();
    if (tenantDomain != MultitenantConstants.SUPER_TENANT_DOMAIN_NAME) {
        axisConfig = TenantAxisUtils.getTenantAxisConfiguration(tenantDomain, mainCfgCtx);
    } else {
        axisConfig = mainCfgCtx.getAxisConfiguration();
    }
    
    Parameter parameter = axisConfig.getParameter(DiscoveryConstants.SKIP_INACTIVE_SERVICES);
    filter.setSkipInactiveServices(parameter == null || "true".equals(parameter.getValue()));

    Service[] services = serviceManager.findServices(filter);
    if (services != null && services.length > 0) {
        TargetService[] targetServices = new TargetService[services.length];
        for (int i = 0; i < services.length; i++) {
            targetServices[i] = getTargetService(services[i]);
        }
        return targetServices;
    }
    return null;
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:38,代码来源:DiscoveryServiceUtils.java

示例13: releaseResources

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Release the AxisService objects associated with this EndpointDescription.  Note that
 * this should only be called by the ServiceDescription that owns this EndpointDescrition.
 * 
 * @param configurationContext  The Axis2 ConfigurationContext holding the AxisConfiguration
 * from which the AxisServices should be removed.
 */
void releaseResources(ConfigurationContext configurationContext) {
    if (configurationContext != null) {
        AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
        AxisService axisService = getAxisService();
        AxisServiceGroup axisServiceGroup = axisService.getAxisServiceGroup();
        try {
            axisConfig.removeServiceGroup(axisServiceGroup.getServiceGroupName());
        } catch (AxisFault e) {
            if (log.isDebugEnabled()) {
                log.debug("EndpointDescriptionImpl release resources caught exception which it is ignoring", e);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:EndpointDescriptionImpl.java

示例14: setMonitoring

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * @param flag; support ON or OFF.
 * @return The information about the Tracer service
 * @throws AxisFault If the tracer module is not found
 */
public TracerServiceInfo setMonitoring(String flag) throws AxisFault {
    if (!flag.equalsIgnoreCase("ON") && !flag.equalsIgnoreCase("OFF")) {
        throw new RuntimeException("IllegalArgument for monitoring status. Only 'ON' and 'OFF' is allowed");
    }
    TracerServiceInfo tracerServiceInfo = new TracerServiceInfo();
    ConfigurationContext configurationContext = getConfigContext();
    AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();
    AxisModule axisModule = axisConfiguration.getModule(TracerConstants.WSO2_TRACER);

    if (axisModule == null) {
        throw new RuntimeException(TracerAdmin.class.getName() + " " +
                                   TracerConstants.WSO2_TRACER + " is not available");
    }

    if (flag.equalsIgnoreCase("ON")) {
        if (!axisConfiguration.isEngaged(axisModule.getName())) {
            try {
                axisConfiguration.engageModule(axisModule);
            } catch (AxisFault axisFault) {
                log.error(axisFault);
                throw new RuntimeException(axisFault);
            }
        }
    } else if (flag.equalsIgnoreCase("OFF")) {
        if (axisConfiguration.isEngaged(axisModule.getName())) {
            axisConfiguration.disengageModule(axisModule);
            configurationContext.removeProperty(TracerConstants.MSG_SEQ_BUFFER);
        }
    }
    TracePersister tracePersister = getTracePersister();
    tracePersister.saveTraceStatus(flag);
    tracerServiceInfo.setEmpty(true);
    tracerServiceInfo.setFlag(flag);
    tracerServiceInfo.setTracePersister(tracePersister.getClass().getName());

    return tracerServiceInfo;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:43,代码来源:TracerAdmin.java

示例15: testParameterEdit

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public void testParameterEdit() throws Exception{
    ConfigurationContext configCtx = ConfigurationContextFactory.createEmptyConfigurationContext();
    AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
    Parameter parameter = new Parameter();
    parameter.setValue("true");
    parameter.setName("enableMTOM");
    axisConfig.addParameter(parameter);
    parameter.setValue("true");
    AxisServiceGroup serviceGroup = new AxisServiceGroup();
    serviceGroup.setServiceGroupName("testServiceGroup");
    AxisService service = new AxisService();
    service.setName("service");
    serviceGroup.addService(service);
    axisConfig.addServiceGroup(serviceGroup);
    parameter = serviceGroup.getParameter("enableMTOM");
    parameter.setValue("true");
    Parameter para2= serviceGroup.getParameter("enableMTOM");
    assertEquals(para2.getValue(),"true");
    Parameter test = new Parameter();
    test.setName("test");
    test.setValue("test");
    serviceGroup.addParameter(test);
    Parameter para = serviceGroup.getParameter("test");
    assertNotNull(para);
    assertEquals(para.getValue(),"test");
    para.setValue("newValue");
    para = serviceGroup.getParameter("test");
    assertNotNull(para);
    assertEquals(para.getValue(),"newValue");

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:32,代码来源:ParameterEditTest.java


注:本文中的org.apache.axis2.context.ConfigurationContext.getAxisConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。