本文整理汇总了Java中org.apache.axis2.engine.AxisConfiguration.getService方法的典型用法代码示例。如果您正苦于以下问题:Java AxisConfiguration.getService方法的具体用法?Java AxisConfiguration.getService怎么用?Java AxisConfiguration.getService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.engine.AxisConfiguration
的用法示例。
在下文中一共展示了AxisConfiguration.getService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEventReceiverEndpoint
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Returns the endpoint URL of the AutoCheckoutService
*
* @return a String URL or null of the service is not available
*/
public static String getEventReceiverEndpoint() {
ConfigurationContextService configurationContextService =
RegistryServiceReferenceHolder.getConfigurationContextService();
if (configurationContextService == null) {
throw new IllegalStateException("Configuration context service not available");
}
AxisConfiguration axisConfig = configurationContextService.getServerConfigContext().
getAxisConfiguration();
AxisService service;
try {
service = axisConfig.getService(DeploymentSynchronizerConstants.EVENT_RECEIVER_SERVICE);
} catch (AxisFault axisFault) {
throw new IllegalStateException("Event receiver service not available", axisFault);
}
for (String epr : service.getEPRs()) {
if (epr.startsWith("http")) {
return epr;
}
}
return null;
}
示例2: waitForAxisServiceActivation
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Wait for a web service to be activated.
*
* @param axisServiceName
* @throws AxisFault
*/
@Override
public void waitForAxisServiceActivation(Component owner, String axisServiceName) throws AxisFault {
if (!componentStartUpSynchronizerEnabled) {
log.info(String.format("Component activation check is disabled, did not wait for %s to be activated.",
axisServiceName));
return;
}
AxisConfiguration axisConfiguration = CarbonConfigurationContextFactory.getConfigurationContext()
.getAxisConfiguration();
AxisService axisService = axisConfiguration.getService(axisServiceName);
log.info(String.format("%s is set to wait for %s Axis service to be activated.", owner, axisServiceName));
if (!axisService.isActive()) {
while (!axisService.isActive()) {
log.info(String.format("%s is waiting for %s Axis service to be activated...", owner, axisServiceName));
try {
Thread.sleep(componentActivationCheckInterval);
}
catch (InterruptedException ignore) {
return;
}
}
log.info(String.format("%s Axis service activated.", axisServiceName));
}
}
示例3: 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");
}
}
示例4: testOperationModule
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的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);
}
示例5: getServicePath
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Returns the path to the rule service with the given name
*
* @param axisConfig Axis2 Environment configuration
* @param serviceName the name of the service
* @return Path to the rule service
*/
protected String getServicePath(AxisConfiguration axisConfig, String serviceName)
throws RuleServiceAdminException {
AxisService axisService;
try {
axisService = axisConfig.getService(serviceName);
} catch (AxisFault axisFault) {
throw new RuleServiceAdminException(
"Error accessing rule service with name " + serviceName);
}
String servicePath = null;
if (axisService != null) {
Parameter servicePathParameter =
axisService.getParameter(Constants.RULE_SERVICE_PATH);
if (servicePathParameter != null) {
String value = (String) servicePathParameter.getValue();
if (value != null && !"".equals(value.trim())) {
servicePath = value.trim();
}
}
}
return servicePath;
}
示例6: lookupAxisService
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public static AxisService lookupAxisService(AxisConfiguration tenantAxisConf,
String serviceName) {
try {
if (tenantAxisConf != null) {
return tenantAxisConf.getService(serviceName);
} else {
return null;
}
} catch (AxisFault e) {
return null;
}
}
示例7: getAnonymousService
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Create AxisService for the requested endpoint config to sending out messages to external services.
*
*
* @param serviceName External service QName
* @param servicePort service port
* @param axisConfig AxisConfiguration object
* @param caller Identifier for the service caller
* @return AxisService
*/
public static AxisService getAnonymousService(QName serviceName, String servicePort,
AxisConfiguration axisConfig, String caller) {
String serviceKey = "axis_service_for_" + caller + "#" + serviceName.getLocalPart() + "#" +
servicePort;
try {
AxisService service = axisConfig.getService(serviceKey);
if (service == null) {
synchronized (AnonymousServiceFactory.class) {
/* Fix for bugs due to high concurrency. If there are number of service calls to same service from
* different process instances, two process instances will try to add same service to axis config.
*/
service = axisConfig.getService(serviceKey);
if (service != null) {
return service;
}
service = createAnonymousService(axisConfig, serviceKey);
}
}
return service;
} catch (AxisFault axisFault) {
handleException("Error retrieving service for key " + serviceKey, axisFault);
}
return null;
}
示例8: unDeployCRUDService
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
private void unDeployCRUDService(GovernanceArtifactConfiguration configuration, AxisConfiguration axisConfig) {
String singularLabel = configuration.getSingularLabel();
try {
if (axisConfig.getService(singularLabel) != null) {
axisConfig.removeService(singularLabel);
}
} catch (AxisFault axisFault) {
log.error(axisFault);
}
}
示例9: markServiceAsFaulty
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Marks the given service as faulty with the given comment
*
* @param serviceName service name
* @param msg comment for being faulty
* @param axisCfg configuration context
*/
public static void markServiceAsFaulty(String serviceName, String msg,
AxisConfiguration axisCfg) {
if (serviceName != null) {
try {
AxisService service = axisCfg.getService(serviceName);
if (service != null) {
axisCfg.getFaultyServices().put(service.getName(), msg);
}
} catch (AxisFault axisFault) {
log.warn("Error marking service : " + serviceName + " as faulty", axisFault);
}
}
}
示例10: processdeleteService
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void processdeleteService(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
String serviceName = req.getParameter("serviceName");
AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
if (axisConfiguration.getService(serviceName) != null) {
axisConfiguration.removeService(serviceName);
req.getSession().setAttribute("status", "Service '" + serviceName + "' has been successfully removed.");
} else {
req.getSession().setAttribute("status", "Failed to delete service '" + serviceName + "'. Service doesn't exist.");
}
renderView("deleteService.jsp", req, res);
}
示例11: printServiceHTML
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public static String printServiceHTML(String serviceName,
ConfigurationContext configurationContext) {
String temp = "";
try {
AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
AxisService axisService = axisConfig.getService(serviceName);
Iterator iterator = axisService.getOperations();
temp += "<h3>" + axisService.getName() + "</h3>";
temp += "<a href=\"" + axisService.getName() + "?wsdl\">wsdl</a> <br/> ";
temp += "<i>Service Description : " + axisService.getServiceDescription() +
"</i><br/><br/>";
if (iterator.hasNext()) {
temp += "Available operations <ul>";
for (; iterator.hasNext();) {
AxisOperation axisOperation = (AxisOperation) iterator.next();
temp += "<li>" + axisOperation.getName().getLocalPart() + "</li>";
}
temp += "</ul>";
} else {
temp += "No operations specified for this service";
}
temp = "<html><head><title>Axis2: Services</title></head>" + "<body>" + temp
+ "</body></html>";
}
catch (AxisFault axisFault) {
temp = "<html><head><title>Service has a fualt</title></head>" + "<body>"
+ "<hr><h2><font color=\"blue\">" + axisFault.getMessage() +
"</font></h2></body></html>";
}
return temp;
}
示例12: init
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void init(AxisConfiguration axisConfiguration) {
if (log.isDebugEnabled()) {
log.debug("Initializing WS-Discovery proxy observer");
}
try {
AxisService service = axisConfiguration.getService("DiscoveryProxy");
if (service != null) {
engageSecurity(service);
}
} catch (AxisFault ignore) {
}
}
示例13: findService
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public AxisService findService(MessageContext messageContext) throws AxisFault {
String serviceName = null;
String localPart = messageContext.getEnvelope().getSOAPBodyFirstElementLocalName();
if (localPart != null) {
OMNamespace ns = messageContext.getEnvelope().getSOAPBodyFirstElementNS();
if (ns != null) {
String filePart = ns.getNamespaceURI();
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(messageContext.getLogIDString() +
"Checking for Service using SOAP message body's first child's namespace : "
+ filePart);
}
String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
messageContext
.getConfigurationContext().getServiceContextPath());
if (values[0] != null) {
serviceName = values[0];
AxisConfiguration registry =
messageContext.getConfigurationContext().getAxisConfiguration();
return registry.getService(serviceName);
}
}
}
return null;
}
示例14: getOperationAxisConfigData
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* @param serviceId
* @param operationId
* @return Axis config data for the given axis operation
*/
public AxisConfigData getOperationAxisConfigData(String serviceId,
String operationId) throws AxisFault {
log.debug("Getting handler details for service " + serviceId +
" operation " + operationId);
AxisConfigData axisConfigData = new AxisConfigData();
AxisConfiguration axisConfiguration = getAxisConfig();
AxisService axisService = axisConfiguration.getService(serviceId);
AxisOperation axisOperation = axisService.getOperation(new QName(operationId));
// adding phases to axis config data object
axisConfigData.
setInflowPhaseOrder(getPhaseOrderData(axisConfiguration.getInFlowPhases(),
axisOperation.getRemainingPhasesInFlow(),
false));
axisConfigData.
setOutflowPhaseOrder(getPhaseOrderData(axisOperation.getPhasesOutFlow(),
axisConfiguration.getOutFlowPhases(),
true));
axisConfigData.
setInfaultflowPhaseOrder(getPhaseOrderData(axisConfiguration.getInFaultFlowPhases(),
axisOperation.getPhasesInFaultFlow(),
false));
axisConfigData.
setOutfaultPhaseOrder(getPhaseOrderData(axisOperation.getPhasesOutFaultFlow(),
axisConfiguration.getOutFaultFlowPhases(),
true));
return axisConfigData;
}
示例15: testDeployment
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testDeployment() {
try {
String filename = AbstractTestCase.basedir + "/target/test-resources/deployment";
AxisConfiguration er = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(filename, filename + "/axis2.xml")
.getAxisConfiguration();
assertNotNull(er);
AxisService service = er.getService("service2");
assertNotNull(service);
//commentd since there is no service based messageReceivers
/*MessageReceiver provider = service.getMessageReceiver();
assertNotNull(provider);
assertTrue(provider instanceof RawXMLINOutMessageReceiver);*/
ClassLoader cl = service.getClassLoader();
assertNotNull(cl);
Loader.loadClass(cl, "org.apache.axis2.Echo2");
assertNotNull(service.getName());
assertNotNull(service.getParameter("para2"));
AxisOperation op = service.getOperation(new QName("opname"));
assertNotNull(op);
} catch (Exception e) {
fail(e.getMessage());
}
}