本文整理汇总了Java中org.apache.axis2.description.AxisModule类的典型用法代码示例。如果您正苦于以下问题:Java AxisModule类的具体用法?Java AxisModule怎么用?Java AxisModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AxisModule类属于org.apache.axis2.description包,在下文中一共展示了AxisModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: engageModules
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
protected boolean engageModules(String scenarioId, String serviceName, AxisService axisService)
throws SecurityConfigException {
boolean isRahasEngaged = false;
SecurityScenario securityScenario = SecurityScenarioDatabase.get(scenarioId);
String[] moduleNames = (String[]) securityScenario.getModules()
.toArray(new String[securityScenario.getModules().size()]);
// handle each module required
try {
for (String modName : moduleNames) {
AxisModule module = axisService.getAxisConfiguration().getModule(modName);
// engage at axis2
axisService.disengageModule(module);
axisService.engageModule(module);
if (SecurityConstants.TRUST_MODULE.equalsIgnoreCase(modName)) {
isRahasEngaged = true;
}
}
return isRahasEngaged;
} catch (AxisFault e) {
log.error(e);
throw new SecurityConfigException("Error in engaging modules", e);
}
}
示例2: createAdressedEnabledClientSide
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public static ServiceContext createAdressedEnabledClientSide(
AxisService service) throws AxisFault {
File file = getAddressingMARFile();
TestCase.assertTrue(file.exists());
ConfigurationContext configContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(
TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
AxisModule axisModule = DeploymentEngine.buildModule(file,
configContext.getAxisConfiguration());
configContext.getAxisConfiguration().addModule(axisModule);
configContext.getAxisConfiguration().addService(service);
ServiceGroupContext serviceGroupContext =
configContext.createServiceGroupContext(service.getAxisServiceGroup());
return serviceGroupContext.getServiceContext(service);
}
示例3: processEngagingGlobally
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public void processEngagingGlobally(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
Map<String,AxisModule> modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
String moduleName = req.getParameter("modules");
req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
if (moduleName != null) {
try {
configContext.getAxisConfiguration().engageModule(moduleName);
req.getSession().setAttribute(Constants.ENGAGE_STATUS,
moduleName + " module engaged globally successfully");
} catch (AxisFault axisFault) {
req.getSession().setAttribute(Constants.ENGAGE_STATUS, axisFault.getMessage());
}
}
req.getSession().setAttribute("modules", null);
renderView(ENGAGING_MODULE_GLOBALLY_JSP_NAME, req, res);
}
示例4: init
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
/**
* Init by creating and deploying AxisServices for each script
*/
public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault {
log.debug("script services init");
AxisConfiguration axisConfig = configContext.getAxisConfiguration();
if(axisConfig.getRepository() == null) {
log.error("AxisConfiguration getRepository returns null, cannot deploy scripts");
} else {
File scriptServicesDirectory = getScriptServicesDirectory(axisConfig);
ScriptDeploymentEngine deploymentEngine = new ScriptDeploymentEngine(axisConfig);
deploymentEngine.loadRepository(scriptServicesDirectory);
deploymentEngine.loadServices();
}
log.debug("script module activated");
}
示例5: execute
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public void execute(ConfigurationContext configCtx) throws ClusteringFault {
List serviceGroupNames = new ArrayList();
AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
for (Iterator iter = axisConfig.getServiceGroups(); iter.hasNext();) {
AxisServiceGroup serviceGroup = (AxisServiceGroup) iter.next();
boolean excludeSG = false;
for (Iterator serviceIter = serviceGroup.getServices(); serviceIter.hasNext();) {
AxisService service = (AxisService) serviceIter.next();
if (service.getParameter(AxisModule.MODULE_SERVICE) != null ||
service.isClientSide()) { // No need to send services deployed through modules or client side services
excludeSG = true;
break;
}
}
//TODO: Exclude all services loaded from modules. How to handle data services etc.?
if (!excludeSG) {
serviceGroupNames.add(serviceGroup.getServiceGroupName());
}
}
this.serviceGroupNames =
(String[]) serviceGroupNames.toArray(new String[serviceGroupNames.size()]);
}
示例6: init
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public static void init(AxisConfiguration configuration) {
classLoaders.put("system", configuration.getSystemClassLoader());
classLoaders.put("axis2", ClassLoaderUtil.class.getClassLoader());
for (Iterator iter = configuration.getServiceGroups(); iter.hasNext(); ) {
AxisServiceGroup group = (AxisServiceGroup) iter.next();
ClassLoader serviceGroupClassLoader = group.getServiceGroupClassLoader();
if (serviceGroupClassLoader != null) {
classLoaders.put(getServiceGroupMapKey(group), serviceGroupClassLoader);
}
}
for (Object obj : configuration.getModules().values()) {
AxisModule module = (AxisModule) obj;
ClassLoader moduleClassLoader = module.getModuleClassLoader();
if (moduleClassLoader != null) {
classLoaders.put(getModuleMapKey(module), moduleClassLoader);
}
}
}
示例7: createAdressedEnabledClientSide
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public static ServiceContext createAdressedEnabledClientSide(
AxisService service, String clientHome) throws AxisFault {
File file = getAddressingMARFile();
TestCase.assertTrue(file.exists());
ConfigurationContext configContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(clientHome, null);
AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
AxisModule axisModule = DeploymentEngine.buildModule(file,axisConfiguration);
axisConfiguration.addModule(axisModule);
axisConfiguration.addService(service);
ServiceGroupContext serviceGroupContext =
configContext.createServiceGroupContext((AxisServiceGroup) service.getParent());
return serviceGroupContext.getServiceContext(service);
}
示例8: addModule
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
/**
* Add an available Module to this configuration
*
* @param module an AxisModule
* @throws AxisFault in case of error
*/
public void addModule(AxisModule module) throws AxisFault {
module.setParent(this);
// check whether the module version paramter is there , if so set the module version as that
Parameter versionParameter = module.getParameter(org.apache.axis2.Constants.MODULE_VERSION);
if (versionParameter !=null ) {
String version = (String) versionParameter.getValue();
try {
module.setVersion(new Version(version));
} catch (ParseException ex) {
throw new AxisFault("The version number '" + version + "' specified by the "
+ org.apache.axis2.Constants.MODULE_VERSION + " parameter is invalid");
}
}
allModules.put(module.getArchiveName(), module);
notifyObservers(new AxisEvent(AxisEvent.MODULE_DEPLOY,null), module);
// Registering the policy namespaces that the module understand
registerModulePolicySupport(module);
// Registering the policy assertions that are local to the system
registerLocalPolicyAssertions(module);
}
示例9: getModule
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
/**
* Get an AxisModule by name.
*
* If the exact name passed (which might contain a version) is present, we'll return that,
* otherwise we'll look for the default version *if* there is no version in the passed
* name.
*
* @param name module name to look up
* @return an AxisModule if found, or null
*/
public AxisModule getModule(String name) {
AxisModule module = allModules.get(name);
if (module != null) {
return module;
}
// checks whether the version string seperator is not there in the
// module name
String defaultModuleVersion = getDefaultModuleVersion(name);
if (defaultModuleVersion != null) {
module = allModules.get(Utils.getModuleName(name, defaultModuleVersion));
if (module != null) {
return module;
}
}
return null;
}
示例10: registerModulePolicySupport
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public void registerModulePolicySupport(AxisModule axisModule) {
String[] namespaces = axisModule.getSupportedPolicyNamespaces();
if (namespaces == null) {
return;
}
List<AxisModule> modulesList;
for (String namespace : namespaces) {
modulesList = policySupportedModules.get(namespace);
if (modulesList != null) {
modulesList.add(axisModule);
} else {
modulesList = new ArrayList<AxisModule>();
modulesList.add(axisModule);
policySupportedModules.put(namespace, modulesList);
}
}
}
示例11: WSDLBasedPolicyProcessor
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public WSDLBasedPolicyProcessor(ConfigurationContext configctx) {
AxisConfiguration axisConfiguration = configctx.getAxisConfiguration();
for (Iterator iterator = axisConfiguration.getModules().values()
.iterator(); iterator.hasNext();) {
AxisModule axisModule = (AxisModule) iterator.next();
String[] namespaces = axisModule.getSupportedPolicyNamespaces();
if (namespaces == null) {
continue;
}
for (int i = 0; i < namespaces.length; i++) {
ArrayList moduleList = null;
Object obj = ns2modules.get(namespaces[i]);
if (obj == null) {
moduleList = new ArrayList(5);
ns2modules.put(namespaces[i], moduleList);
} else {
moduleList = (ArrayList) obj;
}
moduleList.add(axisModule);
}
}
}
示例12: testModuleWithSNAPSHOT
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public void testModuleWithSNAPSHOT() throws AxisFault {
AxisConfiguration axisConfiguration = new AxisConfiguration();
AxisModule module1 = new AxisModule();
module1.setArchiveName("Module1");
axisConfiguration.addModule(module1);
AxisModule module2 = new AxisModule();
module2.setArchiveName("Module1-SNAPSHOT");
axisConfiguration.addModule(module2);
AxisModule module3 = new AxisModule();
module3.setArchiveName("Module1-0.95");
axisConfiguration.addModule(module3);
Utils.calculateDefaultModuleVersion(axisConfiguration.getModules(), axisConfiguration);
assertEquals(module2, axisConfiguration.getDefaultModule("Module1"));
}
示例13: testModuleWithSNAPSHOT2
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public void testModuleWithSNAPSHOT2() throws AxisFault {
AxisConfiguration axisConfiguration = new AxisConfiguration();
AxisModule module1 = new AxisModule();
module1.setArchiveName("Module1-a");
axisConfiguration.addModule(module1);
AxisModule module2 = new AxisModule();
module2.setArchiveName("Module1-a-SNAPSHOT");
axisConfiguration.addModule(module2);
AxisModule module3 = new AxisModule();
module3.setArchiveName("Module1-a-0.95");
axisConfiguration.addModule(module3);
Utils.calculateDefaultModuleVersion(axisConfiguration.getModules(), axisConfiguration);
Utils.calculateDefaultModuleVersion(axisConfiguration.getModules(), axisConfiguration);
assertEquals(module2, axisConfiguration.getDefaultModule("Module1-a"));
}
示例14: testGlobalDisengagement
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public void testGlobalDisengagement() throws AxisFault {
AxisModule module = config.getModule("testModule");
assertNotNull(module);
Phase phase;
Phase userPhase;
List globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
phase = (Phase) globalinflow.get(3);
assertNotNull(phase);
assertEquals(phase.getHandlerCount(), 0);
AxisService service = config.getService(serviceName);
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
config.engageModule(module.getName());
assertEquals(2, phase.getHandlerCount());
assertEquals(1, userPhase.getHandlerCount());
config.disengageModule(module);
assertEquals(0, phase.getHandlerCount());
assertEquals(0, userPhase.getHandlerCount());
}
示例15: testOperationDisengagement
import org.apache.axis2.description.AxisModule; //导入依赖的package包/类
public void testOperationDisengagement() throws AxisFault {
AxisModule module = config.getModule("testModule");
assertNotNull(module);
Phase phase;
Phase userPhase;
List globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
phase = (Phase) globalinflow.get(3);
assertNotNull(phase);
assertEquals(phase.getHandlerCount(), 0);
AxisService service = config.getService(serviceName);
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
config.engageModule(module.getName());
assertEquals(2, phase.getHandlerCount());
assertEquals(1, userPhase.getHandlerCount());
operation.disengageModule(module);
assertEquals(2, phase.getHandlerCount());
assertEquals(0, userPhase.getHandlerCount());
}