本文整理汇总了Java中org.apache.axis2.description.AxisServiceGroup.getServices方法的典型用法代码示例。如果您正苦于以下问题:Java AxisServiceGroup.getServices方法的具体用法?Java AxisServiceGroup.getServices怎么用?Java AxisServiceGroup.getServices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.description.AxisServiceGroup
的用法示例。
在下文中一共展示了AxisServiceGroup.getServices方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的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()]);
}
示例2: configureAddressing
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
private void configureAddressing(AxisServiceGroup serviceGroup) {
EndpointContextMap map =
(EndpointContextMap) configCtx.getProperty(org.apache.axis2.jaxws.Constants.ENDPOINT_CONTEXT_MAP);
if (map == null) {
map = EndpointContextMapManager.getEndpointContextMap();
configCtx.setProperty(org.apache.axis2.jaxws.Constants.ENDPOINT_CONTEXT_MAP, map);
}
Iterator<AxisService> iterator = serviceGroup.getServices();
while (iterator.hasNext()) {
AxisService axisService = iterator.next();
Parameter param =
axisService.getParameter(EndpointDescription.AXIS_SERVICE_PARAMETER);
EndpointDescription ed = (EndpointDescription) param.getValue();
QName serviceName = ed.getServiceQName();
QName portName = ed.getPortQName();
EndpointKey key = new EndpointKey(serviceName, portName);
map.put(key, axisService);
}
}
示例3: initService
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
/**
* To init all the services in application scope
*
* @param serviceGroupContext the ServiceGroupContext from which to extract all the services
* @throws AxisFault if there's a problem initializing
*/
public static void initService(ServiceGroupContext serviceGroupContext) throws AxisFault {
AxisServiceGroup serviceGroup = serviceGroupContext.getDescription();
Iterator<AxisService> serviceItr = serviceGroup.getServices();
while (serviceItr.hasNext()) {
AxisService axisService = (AxisService) serviceItr.next();
ServiceContext serviceContext = serviceGroupContext.getServiceContext(axisService);
AxisService service = serviceContext.getAxisService();
ClassLoader classLoader = service.getClassLoader();
Parameter implInfoParam = service.getParameter(Constants.SERVICE_CLASS);
if (implInfoParam != null) {
try {
ThreadContextDescriptor tc = setThreadContext(axisService);
Class implClass = Loader.loadClass(
classLoader,
((String) implInfoParam.getValue()).trim());
Object serviceImpl = makeNewServiceObject(service);
serviceContext.setProperty(ServiceContext.SERVICE_OBJECT, serviceImpl);
initServiceObject(serviceImpl, serviceContext);
restoreThreadContext(tc);
} catch (Exception e) {
throw AxisFault.makeFault(e);
}
}
}
}
示例4: containsExternalizedAxisServiceName
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
/**
* Answer if there are any AxisServices in the specified ServiceGroup that have an externalized
* name that matches the service group name.
*
* @param checkServiceGroup The AxisServiceGroup containing the AxisServies to check
* @param serviceGrpName The name to check as the externalized name of the AxisService
* @return true if the group contains an AxisService with that name; false otherwise.
*/
private static boolean containsExternalizedAxisServiceName(
AxisServiceGroup checkServiceGroup, String serviceGrpName) {
boolean containsAxisService = false;
if (serviceGrpName != null && checkServiceGroup != null) {
// Get a list of AxisServices on the group
// Iterate over them to see if any have the Externalized Name Parameter
// If so and it mathces, then this service group name then use this service group
Iterator axisServicesInGroup = checkServiceGroup.getServices();
while (axisServicesInGroup.hasNext()) {
AxisService checkService = (AxisService) axisServicesInGroup.next();
String externalizedServiceName =
(String) checkService.getParameterValue(EXTERNALIZED_AXIS_SERVICE_NAME);
if (externalizedServiceName != null &&
externalizedServiceName.equals(serviceGrpName)) {
containsAxisService = true;
break;
}
}
}
return containsAxisService;
}
示例5: unRegister
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
public void unRegister(Bundle bundle, boolean uninstall) {
lock.lock();
try {
List<AxisServiceGroup> axisServiceGroupList = resolvedBundles.get(bundle);
if (axisServiceGroupList != null) {
for (AxisServiceGroup axisServiceGroup : axisServiceGroupList) {
if (resolvedBundles.containsKey(bundle)) {
resolvedBundles.remove(bundle);
}
if (!unreslovedBundles.contains(bundle) && !uninstall) {
unreslovedBundles.add(bundle);
}
try {
for (Iterator iterator = axisServiceGroup.getServices();
iterator.hasNext();) {
AxisService service = (AxisService) iterator.next();
log.info("[Axis2/OSGi] Service - " + service.getName());
}
configCtx.getAxisConfiguration()
.removeServiceGroup(axisServiceGroup.getServiceGroupName());
log.info("[Axis2/OSGi] Stopping " +
axisServiceGroup.getServiceGroupName() +
" service group in Bundle - " +
bundle.getSymbolicName());
} catch (AxisFault e) {
String msg = "Error while removing the service group";
log.error(msg, e);
}
}
}
} finally {
lock.unlock();
}
}
示例6: undeploy
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
public void undeploy(String fileName) throws DeploymentException {
try {
//find the hierarchical part of the service group name
String serviceHierarchy = Utils.getServiceHierarchy(fileName, this.directory);
fileName = Utils.getShortFileName(fileName);
fileName = DeploymentEngine.getAxisServiceName(fileName);
//attach the hierarchical part if it is not null
if (serviceHierarchy != null) {
fileName = serviceHierarchy + fileName;
}
AxisServiceGroup serviceGroup = axisConfig.removeServiceGroup(fileName);
//Fixed - https://issues.apache.org/jira/browse/AXIS2-4610
if (serviceGroup != null) {
for (Iterator services = serviceGroup.getServices(); services.hasNext();) {
AxisService axisService = (AxisService) services.next();
ServiceLifeCycle serviceLifeCycle = axisService.getServiceLifeCycle();
if (serviceLifeCycle != null) {
serviceLifeCycle.shutDown(configCtx, axisService);
}
}
configCtx.removeServiceGroupContext(serviceGroup);
log.info(Messages.getMessage(DeploymentErrorMsgs.SERVICE_REMOVED,
fileName));
} else {
axisConfig.removeFaultyService(fileName);
}
super.undeploy(fileName);
} catch (AxisFault axisFault) {
//May be a faulty service
axisConfig.removeFaultyService(fileName);
throw new DeploymentException(axisFault);
}
}
示例7: removeServiceGroup
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
public AxisServiceGroup removeServiceGroup(String serviceGroupName) throws AxisFault {
AxisServiceGroup axisServiceGroup = (AxisServiceGroup) getChild(serviceGroupName);
if (axisServiceGroup == null) {
throw new AxisFault(Messages.getMessage("invalidservicegroupname",
serviceGroupName));
}
Iterator<AxisService> services = axisServiceGroup.getServices();
boolean isClientSide = false;
while (services.hasNext()) {
AxisService axisService = services.next();
allServices.remove(axisService.getName());
if (!axisService.isClientSide()) {
notifyObservers(new AxisEvent(AxisEvent.SERVICE_REMOVE , axisService), axisService);
} else {
isClientSide = true;
}
//removes the endpoints to this service
String serviceName = axisService.getName();
String key;
for (String s : axisService.getEndpoints().keySet()) {
key = serviceName + "." + s;
this.allEndpoints.remove(key);
}
}
removeChild(serviceGroupName);
if (!isClientSide) {
notifyObservers(new AxisEvent(AxisEvent.SERVICE_REMOVE, axisServiceGroup), axisServiceGroup);
}
return axisServiceGroup;
}
示例8: calculateMaxScopeForServiceGroup
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
/**
* Walk through the list of services and use the maximum of the scopes as the scope
* for the whole service group
*
* @param axisServiceGroup the service group
* @return scope for the service group
*/
public static String calculateMaxScopeForServiceGroup(AxisServiceGroup axisServiceGroup) {
Iterator<AxisService> servics = axisServiceGroup.getServices();
int maxScope = 1;
while (servics.hasNext()) {
AxisService axisService = (AxisService) servics.next();
int scopeIntValue = getScopeIntValue(axisService.getScope());
if (maxScope < scopeIntValue) {
maxScope = scopeIntValue;
}
}
return getScopeString(maxScope);
}
示例9: addServiceGroup
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
public synchronized void addServiceGroup(AxisServiceGroup axisServiceGroup)
throws AxisFault {
axisServiceGroup.setParent(this);
notifyObservers(new AxisEvent(AxisEvent.SERVICE_DEPLOY, axisServiceGroup), axisServiceGroup);
AxisService axisService;
Iterator<AxisService> services = axisServiceGroup.getServices();
while (services.hasNext()) {
axisService = services.next();
if (axisService.getSchemaTargetNamespace() == null) {
axisService.setSchemaTargetNamespace(Java2WSDLConstants.AXIS2_XSD);
}
}
services = axisServiceGroup.getServices();
while (services.hasNext()) {
axisService = services.next();
if (axisService.isUseDefaultChains()) {
Iterator<AxisOperation> operations = axisService.getOperations();
while (operations.hasNext()) {
AxisOperation operation = operations.next();
phasesinfo.setOperationPhases(operation);
}
}
}
Iterator<AxisModule> enModule = getEngagedModules().iterator();
while (enModule.hasNext()) {
axisServiceGroup.engageModule(enModule.next());
}
services = axisServiceGroup.getServices();
ArrayList<AxisService> servicesIAdded = new ArrayList<AxisService>();
while (services.hasNext()) {
axisService = services.next();
processEndpoints(axisService, axisService.getAxisConfiguration());
Map<String, AxisEndpoint> endpoints = axisService.getEndpoints();
String serviceName = axisService.getName();
try {
addToAllServicesMap(axisService);
} catch (AxisFault axisFault) {
// Whoops, must have been a duplicate! If we had a problem here, we have to
// remove all the ones we added...
for (AxisService service : servicesIAdded) {
allServices.remove(service.getName());
}
// And toss this in case anyone wants it?
throw axisFault;
}
servicesIAdded.add(axisService);
if (endpoints != null) {
Iterator<String> endpointNameIter = endpoints.keySet().iterator();
while (endpointNameIter.hasNext()) {
String endpointName = endpointNameIter.next();
if (log.isDebugEnabled()) {
log.debug("Adding service to allEndpoints map: ("
+ serviceName + "," + endpointName + ") ");
}
allEndpoints.put(serviceName + "." + endpointName, axisService);
}
if (log.isDebugEnabled()) {
log.debug("After adding to allEndpoints map, size is "
+ allEndpoints.size());
}
}
if (!axisService.isClientSide()) {
notifyObservers(new AxisEvent(AxisEvent.SERVICE_DEPLOY ,axisService ), axisService);
}
}
// serviceGroups.put(axisServiceGroup.getServiceGroupName(),
// axisServiceGroup);
addChild(axisServiceGroup);
}
示例10: findServiceGroupForArtifact
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
/**
* Finds the AxisServiceGroup which corresponds to the given cApp Artifact. Artifact file
* name is used to identify the AxisServiceGroup. Then the service type is also checked with
* the type of the given artifact.
*
* @param artifact - cApp artifact
* @return - corresponding AxisServiceGroup
*/
private AxisServiceGroup findServiceGroupForArtifact(Artifact artifact) {
// Number of files in a service artifact should be 1
if (artifact.getFiles().size() != 1) {
return null;
}
String fileName = artifact.getFiles().get(0).getName();
AxisConfiguration axisConfiguration = getAxisConfig();
Iterator<AxisServiceGroup> serviceGroups = axisConfiguration.getServiceGroups();
while (serviceGroups.hasNext()) {
AxisServiceGroup sg = serviceGroups.next();
// Filtering the admin services
if (SystemFilter.isFilteredOutService(sg)) {
continue; // No advancement of currentIndex
}
AxisService axisService = null;
Iterator<AxisService> services = sg.getServices();
// Find a service with the file name in this service group
while (services.hasNext()) {
AxisService temp = services.next();
if (temp.getFileName() != null) {
axisService = temp;
break;
}
}
if (axisService != null) {
String filePath = axisService.getFileName().getPath().trim();
if (filePath.endsWith(fileName)) {
String serviceType = getArtifactTypeFromService(axisService, fileName);
if (serviceType.equals(artifact.getType())) {
return sg;
}
}
}
}
return null;
}
示例11: run
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
public void run() {
synchronized (axisConfig) {
PrivilegedCarbonContext.startTenantFlow();
try {
PrivilegedCarbonContext privilegedCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
privilegedCarbonContext.setTenantId(MultitenantConstants.SUPER_TENANT_ID);
privilegedCarbonContext.setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
AxisServiceGroup proxyAxisServiceGroup =
axisConfig.getServiceGroup(WSDL2FormGenerator.TRYIT_SG_NAME);
if (proxyAxisServiceGroup != null) {
List removeServiceList = new ArrayList();
for (Iterator iterator = proxyAxisServiceGroup.getServices();
iterator.hasNext();) {
AxisService axisServce = (AxisService) iterator.next();
Long longTime =
(Long) axisServce
.getParameterValue(WSDL2FormGenerator.LAST_TOUCH_TIME);
if ((System.currentTimeMillis() - longTime.longValue()) > WSDL2FormGenerator
.PERIOD) {
removeServiceList.add(axisServce.getName());
}
}
if (removeServiceList.size() > 0) {
for (Iterator iterator = removeServiceList.iterator(); iterator.hasNext();)
{
String axisServiceName = (String) iterator.next();
proxyAxisServiceGroup.removeService(axisServiceName);
}
}
boolean isLast = proxyAxisServiceGroup.getServices().hasNext();
if (!isLast) {
axisConfig.removeServiceGroup(WSDL2FormGenerator.TRYIT_SG_NAME);
}
}
} catch (AxisFault axisFault) {
String msg = "Fault occured when manipulating Tryit proxy service group";
log.error(msg, axisFault);
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
}