本文整理汇总了Java中org.apache.axis2.engine.AxisConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java AxisConfiguration类的具体用法?Java AxisConfiguration怎么用?Java AxisConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AxisConfiguration类属于org.apache.axis2.engine包,在下文中一共展示了AxisConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetServerURL
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
@Test(dataProvider = "getServerURLData")
public void testGetServerURL(String host, int port, String proxyCtx, String ctxRoot, String endpoint, boolean
addProxyContextPath, boolean addWebContextRoot, String expected) throws Exception {
when(CarbonUtils.getTransportPort(any(AxisConfiguration.class), anyString())).thenReturn(9443);
when(CarbonUtils.getTransportProxyPort(any(AxisConfiguration.class), anyString())).thenReturn(port);
when(CarbonUtils.getManagementTransport()).thenReturn("https");
when(mockServerConfiguration.getFirstProperty(IdentityCoreConstants.HOST_NAME)).thenReturn(host);
when(mockServerConfiguration.getFirstProperty(IdentityCoreConstants.WEB_CONTEXT_ROOT)).thenReturn(ctxRoot);
when(mockServerConfiguration.getFirstProperty(IdentityCoreConstants.PROXY_CONTEXT_PATH)).thenReturn(proxyCtx);
assertEquals(IdentityUtil.getServerURL(endpoint, addProxyContextPath, addWebContextRoot), expected, String
.format("Generated server url doesn't match the expected for input: host = %s, " +
"port = %d, proxyCtx = %s, ctxRoot = %s, endpoint = %s, addProxyContextPath = %b, " +
"addWebContextRoot = %b", host, port, proxyCtx, ctxRoot, endpoint, addProxyContextPath,
addWebContextRoot));
}
示例2: loadTransportProperties
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的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;
}
示例3: init
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
@BeforeClass
public void init() throws NoSuchFieldException, IllegalAccessException, IOException, RegistryException {
Field deviceTypePlugins;
Field deviceTypeUIs;
deviceTypeCAppDeployer = Mockito.mock(DeviceTypeCAppDeployer.class, Mockito.CALLS_REAL_METHODS);
carbonApplication = Mockito.mock(CarbonApplication.class, Mockito.CALLS_REAL_METHODS);
axisConfiguration = Mockito.mock(AxisConfiguration.class, Mockito.CALLS_REAL_METHODS);
applicationConfiguration = Mockito.mock(ApplicationConfiguration.class, Mockito.CALLS_REAL_METHODS);
Mockito.doReturn(applicationConfiguration).when(carbonApplication).getAppConfig();
Mockito.doNothing().when(deviceTypeCAppDeployer).deployTypeSpecifiedArtifacts(Mockito.any(), Mockito.any(),
Mockito.any(), Mockito.any());
Mockito.doNothing().when(deviceTypeCAppDeployer).undeployTypeSpecifiedArtifacts(Mockito.any(), Mockito.any(),
Mockito.any(), Mockito.any());
this.initializeCarbonContext();
deviceTypePlugins = DeviceTypeCAppDeployer.class.getDeclaredField("deviceTypePlugins");
deviceTypePlugins.setAccessible(true);
deviceTypePlugins.set(deviceTypeCAppDeployer, new ArrayList<Artifact>());
deviceTypeUIs = DeviceTypeCAppDeployer.class.getDeclaredField("deviceTypeUIs");
deviceTypeUIs.setAccessible(true);
deviceTypeUIs.set(deviceTypeCAppDeployer, new ArrayList<Artifact>());
}
示例4: overrideCallbackHandler
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
/**
* Override WSAS callback handler to be able to auth users with usermanager.
*
* @param axisConfig
* @throws AxisFault
*/
public static void overrideCallbackHandler(AxisConfiguration axisConfig, String service) throws AxisFault {
AxisService sts = axisConfig.getService(service);
Parameter cbHandlerParam = sts.getParameter(WSHandlerConstants.PW_CALLBACK_REF);
if (cbHandlerParam != null) {
sts.removeParameter(cbHandlerParam);
if (log.isDebugEnabled()) {
log.debug("removedParameter");
}
}
Parameter param = getPasswordCallBackRefParameter();
sts.addParameter(param);
if (log.isDebugEnabled()) {
log.debug("addedParameter");
}
}
示例5: getAxisConfigData
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
/**
* @return the global axisConfig data for running server
*/
public AxisConfigData getAxisConfigData() {
AxisConfigData axisConfigData = new AxisConfigData();
AxisConfiguration axisConfiguration = getAxisConfig();
// setting the in-phase order data
axisConfigData.setInflowPhaseOrder(getPhaseOrderData(axisConfiguration.getInFlowPhases(),
null, false));
axisConfigData.setOutflowPhaseOrder(getPhaseOrderData(
axisConfiguration.getOutFlowPhases(), null, true));
axisConfigData.
setInfaultflowPhaseOrder(getPhaseOrderData(axisConfiguration.getInFaultFlowPhases(),
null, false));
axisConfigData.
setOutfaultPhaseOrder(getPhaseOrderData(axisConfiguration.getOutFaultFlowPhases(),
null, true));
return axisConfigData;
}
示例6: populateRampartConfig
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
/**
* Updates RelyingPartyService with Crypto information
*
* @param config AxisConfiguration
* @throws Exception
*/
public static void populateRampartConfig(AxisConfiguration config) throws Exception {
AxisService service;
// Get the RelyingParty Service to update security policy with keystore information
service = config.getService(IWA_SERVICE_NAME);
if (service == null) {
String msg = IWA_SERVICE_NAME + " is not available in the Configuration Context";
log.error(msg);
}
// Create a Rampart Config with default crypto information
//Policy rampartConfig = IdentityBaseUtil.getDefaultRampartConfig();
Policy rampartConfig = IdentityBaseUtil.getDefaultRampartConfig();
// Add the RampartConfig to service policy
service.getPolicySubject().attachPolicy(rampartConfig);
}
示例7: createdConfigurationContext
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
public void createdConfigurationContext(ConfigurationContext configurationContext) {
AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
try {
if (axisConfig.getModule(StatisticsConstants.STATISTISTICS_MODULE_NAME) != null) {
axisConfig.engageModule(StatisticsConstants.STATISTISTICS_MODULE_NAME);
}
} catch (Throwable e) {
PrivilegedCarbonContext carbonContext =
PrivilegedCarbonContext.getThreadLocalCarbonContext();
String msg;
if (carbonContext.getTenantDomain() != null) {
msg = "Could not globally engage " + StatisticsConstants.STATISTISTICS_MODULE_NAME +
" module to tenant " + carbonContext.getTenantDomain() +
"[" + carbonContext.getTenantId() + "]";
} else {
msg = "Could not globally engage " + StatisticsConstants.STATISTISTICS_MODULE_NAME +
" module to super tenant ";
}
log.error(msg, e);
}
}
示例8: performThreadCleanup
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
/**
* Activate any registered ThreadContextMigrators to remove information
* from the thread of execution if necessary.
*
* @param threadContextMigratorListID The name of the parameter in the
* AxisConfiguration that contains
* the list of migrators.
* @param msgContext
*/
public static void performThreadCleanup(String threadContextMigratorListID,
MessageContext msgContext) {
if (msgContext == null) {
return;
}
AxisConfiguration axisConfiguration =
msgContext.getConfigurationContext().getAxisConfiguration();
Parameter param = axisConfiguration.getParameter(threadContextMigratorListID);
if (param != null) {
List migratorList = (List) param.getValue();
int size = migratorList.size();
for (int i=0; i<size;i++) {
((ThreadContextMigrator) migratorList.get(i)).cleanupThread(msgContext);
}
}
}
示例9: StratosManagerContext
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
private StratosManagerContext() {
// Initialize clustering status
AxisConfiguration axisConfiguration = ServiceReferenceHolder.getInstance().getAxisConfiguration();
if ((axisConfiguration != null) && (axisConfiguration.getClusteringAgent() != null)) {
clustered = true;
}
// Initialize distributed object provider
distributedObjectProvider = ServiceReferenceHolder.getInstance().getDistributedObjectProvider();
// Get maps from distributed object provider
cartridgeTypeToCartridgeGroupsMap = distributedObjectProvider.getMap(SM_CARTRIDGE_TYPE_TO_CARTIDGE_GROUPS_MAP);
cartridgeTypeToApplicationsMap = distributedObjectProvider.getMap(SM_CARTRIDGE_TYPE_TO_APPLICATIONS_MAP);
cartridgeGroupToCartridgeSubGroupsMap = distributedObjectProvider
.getMap(SM_CARTRIDGE_GROUP_TO_CARTIDGE_GROUPS_MAP);
cartridgeGroupToApplicationsMap = distributedObjectProvider.getMap(SM_CARTRIDGE_GROUP_TO_APPLICATIONS_MAP);
// Update context from the registry
updateContextFromRegistry();
}
示例10: HumanTaskBaseConfiguration
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
public HumanTaskBaseConfiguration(HumanInteractionsDocument humanInteractionsDocument,
String targetNamespace,
String humanTaskArtifactName,
AxisConfiguration tenantAxisConf,
boolean task, String packageName,
long version,
File humanTaskDefinitionFile) {
this.humanInteractionsDocument = humanInteractionsDocument;
this.targetNamespace = targetNamespace;
this.humanTaskArtifactName = humanTaskArtifactName;
this.task = task;
this.tenantAxisConf = tenantAxisConf;
this.packageName = packageName;
this.humanTaskDefinitionFile = humanTaskDefinitionFile;
this.packageStatus = TaskPackageStatus.ACTIVE;
this.version = version;
if (humanInteractionsDocument.getHumanInteractions().getExpressionLanguage() != null) {
this.defaultExpressionLanguage = humanInteractionsDocument.getHumanInteractions().
getExpressionLanguage().trim();
}
}
示例11: testFindServiceWithNoParametersFound
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
/**
* Test that with extra name information but no Parameters on the AxisService that the
* service is found.
* @throws AxisFault
*/
public void testFindServiceWithNoParametersFound() throws AxisFault {
AxisConfiguration axisCfg = new AxisConfiguration();
AxisService svc1 = new AxisService();
QName svc1QN = new QName("http://service.name/space/1", "service1");
String portName = "port1";
// We don't use the setup method since we do not want the parameters set on this
// service
// setupAxisService(svc1, svc1QN, portName);
svc1.setName(generateAxisServiceName(svc1QN, portName));
axisCfg.addService(svc1);
String extraName = ActivateUtils.getAxisServiceExternalizeExtraName(svc1) + "_NoMatch";
AxisService foundService = ActivateUtils.findService(axisCfg, AxisService.class.getName(),
generateAxisServiceName(svc1QN, portName), extraName);
assertSame("Should have found matching service without matching extraname", svc1, foundService);
}
示例12: addRuleService
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
/**
* Adds a rule service based on the given name and other information in the serviceXML
*
* @param fileExtension rule service file extension
* @param name name of the service to be created
* @param ruleServiceXML meta data required to create a rule service
* @throws RuleServiceAdminException for any errors during service add operation
*/
public void addRuleService(String fileExtension,
String name,
OMElement ruleServiceXML) throws RuleServiceAdminException {
validateName(name);
validateElement(ruleServiceXML);
try {
RuleService ruleService = RuleServiceHelper.getRuleService(ruleServiceXML);
validateRuleServiceDescription(ruleService, ruleServiceXML);
AxisConfiguration axisConfig = getAxisConfig();
AxisService axisService = axisConfig.getService(name);
if (axisService != null) {
throw new RuleServiceAdminException("There is already a service " +
"with the given name : ");
}
RuleServiceAdminHandler adminHandler = getRuleServiceAdminHandler(fileExtension);
adminHandler.saveRuleService(getAxisConfig(), axisService, ruleService);
} catch (AxisFault axisFault) {
throw new RuleServiceAdminException("Error while accessing " +
"the service with the name : " + name, axisFault);
} catch (RuleConfigurationException e) {
throw new RuleServiceAdminException("Can not parse the received xml");
}
}
示例13: performMigrationToThread
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
/**
* Activate any registered ThreadContextMigrators to move context info
* to the thread of execution.
*
* @param threadContextMigratorListID The name of the parameter in the
* AxisConfiguration that contains
* the list of migrators.
* @param msgContext
* @throws AxisFault
*/
public static void performMigrationToThread(String threadContextMigratorListID,
MessageContext msgContext)
throws AxisFault {
if (msgContext == null) {
return;
}
AxisConfiguration axisConfiguration =
msgContext.getConfigurationContext().getAxisConfiguration();
Parameter param = axisConfiguration.getParameter(threadContextMigratorListID);
if (param != null) {
List migratorList = (List) param.getValue();
int size = migratorList.size();
for (int i=0; i<size;i++) {
((ThreadContextMigrator) migratorList.get(i))
.migrateContextToThread(msgContext);
}
}
}
示例14: init
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
public void init(AxisConfiguration axisConfiguration) {
if (log.isDebugEnabled()) {
log.debug("Initializing Registry WS-API Component");
}
try {
AxisService service = axisConfiguration.getService(WS_REGISTRY_SERVICE_NAME);
if (service != null) {
engageSecurity(service);
}
} catch (AxisFault ignore) {
}
}
示例15: processModuleConfig
import org.apache.axis2.engine.AxisConfiguration; //导入依赖的package包/类
protected void processModuleConfig(Iterator moduleConfigs, ParameterInclude parent,
AxisConfiguration config)
throws DeploymentException {
while (moduleConfigs.hasNext()) {
OMElement moduleConfig = (OMElement) moduleConfigs.next();
OMAttribute moduleName_att = moduleConfig.getAttribute(new QName(ATTRIBUTE_NAME));
if (moduleName_att == null) {
throw new DeploymentException(
Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
} else {
String module = moduleName_att.getAttributeValue();
ModuleConfiguration moduleConfiguration =
new ModuleConfiguration(module, parent);
Iterator parameters = moduleConfig.getChildrenWithName(new QName(TAG_PARAMETER));
processParameters(parameters, moduleConfiguration, parent);
config.addModuleConfig(moduleConfiguration);
}
}
}