public FaultyServiceData(AxisServiceGroup serviceGroup, ArrayList<AxisService> serviceList, URL serviceLocation, DeploymentFileData currentDeploymentFile) { serviceGroupName = serviceGroup.getServiceGroupName(); this.serviceGroup = serviceGroup; this.serviceList = serviceList; this.currentDeploymentFile = currentDeploymentFile; this.serviceLocation = serviceLocation; }
private AxisServiceGroup createServiceGroupForService(AxisService svc) throws AxisFault { AxisServiceGroup svcGroup = new AxisServiceGroup(); svcGroup.setServiceGroupName(svc.getName()); svcGroup.addService(svc); // Checking configured using files param is not a good solution. We must figure out a way to handle this // at Carbon persistence manager layer. if (svc.getParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM) != null && svc.getParameter(BusinessProcessConstants.CONFIGURED_USING_BPEL_PKG_CONFIG_FILES) == null) { svcGroup.addParameter(new Parameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true")); } return svcGroup; }
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()]); }
/** * Add an AxisService to our global configuration. Since services must * be in ServiceGroups, we construct an anonymous AxisServiceGroup around * the passed AxisService and then call addServiceGroup(). * * @param service an AxisService to deploy. * @throws AxisFault if something goes wrong (invalid service, service is * already deployed, etc...) */ public synchronized void addService(AxisService service) throws AxisFault { AxisServiceGroup axisServiceGroup = new AxisServiceGroup(); axisServiceGroup.setServiceGroupName(service.getName()); axisServiceGroup.setParent(this); axisServiceGroup.addService(service); addServiceGroup(axisServiceGroup); // processEndpoints(service, service.getAxisConfiguration()); }
URL url = (URL) enumeration.nextElement(); AxisServiceGroup serviceGroup = new AxisServiceGroup(configCtx.getAxisConfiguration()); serviceGroup.addParameter("last.updated", bundle.getLastModified()); ClassLoader loader = new BundleClassLoader(bundle, Registry.class.getClassLoader()); serviceGroup.setServiceGroupClassLoader(loader); InputStream inputStream = url.openStream(); DescriptionBuilder builder = new DescriptionBuilder(inputStream, configCtx); String bundleSymbolicName = (String) headers.get("Bundle-SymbolicName"); bundleSymbolicName = bundleSymbolicName + "_" + i; serviceGroup.setServiceGroupName(bundleSymbolicName); HashMap wsdlServicesMap = new HashMap(); if (DeploymentConstants.TAG_SERVICE.equals(elementName)) { configCtx.getAxisConfiguration()); log.info("[Axis2/OSGi] Deployed axis2 service group:" + serviceGroup.getServiceGroupName() + " in Bundle: " + bundle.getSymbolicName()); serviceGroup.addParameter(OSGi_BUNDLE_ID, bundle.getBundleId()); axisServiceGroupList.add(serviceGroup);
DeploymentFileData currentDeploymentFile = new DeploymentFileData(null, null); currentDeploymentFile.setClassLoader(classLoader); AxisServiceGroup serviceGroup = new AxisServiceGroup(); serviceGroup.setServiceGroupClassLoader(classLoader); serviceGroup.setServiceGroupName(serviceGroupName); AxisConfiguration axisConfig = configCtx.getAxisConfiguration(); try {
return; AxisServiceGroup serviceGroup = new AxisServiceGroup(); StringWriter errorWriter = new StringWriter(); ArrayList<AxisService> servicelist = axisConfig); if (!JavaUtils.isTrueExplicitly(serviceGroup.getParameterValue( Constants.HIDDEN_SERVICE_PARAM_NAME))) { log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS, serviceGroup.getServiceGroupName(), servicesURL.toString()));
ArrayList<String> groupModules = serviceGroup.getModuleRefs(); serviceGroup.setParent(axisConfig); for (Object groupModule : groupModules) { String moduleName = (String) groupModule; serviceGroup.engageModule(axisConfig.getModule(moduleName)); } else { throw new DeploymentException( Messages.getMessage( DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE, serviceGroup.getServiceGroupName(), moduleName)); serviceGroup.addService(axisService);
AxisServiceGroup serviceGroup = new AxisServiceGroup(); serviceGroup.setServiceGroupName(serviceHierarchy + deploymentFileData.getName()); for (Object anAxisServiceList : axisServiceList) { AxisService axisService = (AxisService)anAxisServiceList; axisService.setName(serviceHierarchy + axisService.getName()); serviceGroup.addService(axisService);
public void onDisengage(AxisModule module) throws AxisFault { for (Iterator<AxisService> serviceIter = getServices(); serviceIter.hasNext();) { AxisService axisService = (AxisService) serviceIter.next(); axisService.disengageModule(module); } }
AxisServiceGroup axisServiceGroup = (AxisServiceGroup) sgs.next(); String sgName = axisServiceGroup.getServiceGroupName(); if (SystemFilter.isFilteredOutService(sgName)) { List serviceTypes = new ArrayList(); Parameter serviceTypeParam; for (Iterator serviceIter = axisServiceGroup.getServices(); serviceIter.hasNext();) { AxisService axisService = (AxisService) serviceIter.next(); if (axisService.isClientSide()) { axisServiceGroup.getParameter(Constants.Configuration.ENABLE_MTOM); if (parameter != null) { sgMetaData.setEnableMTOM((String) parameter.getValue());
AxisServiceGroup serviceGroup = new AxisServiceGroup( axisConfig); serviceGroup.setServiceGroupClassLoader(filedata .getClassLoader()); ArrayList serviceList = archiveReader.processServiceGroup( moduleService.setName(AxisModule.MODULE_SERVICE); axisService.addParameter(moduleService); serviceGroup.addService(axisService);
@Override protected ArrayList<?> populateService(AxisServiceGroup serviceGroup, URL servicesURL, String serviceName) throws DeploymentException { try { serviceGroup.setServiceGroupName(serviceName); servicesURL = new URL(servicesURL.toString() + "/"); // ADDED. url's a dir, not a file - TWW ClassLoader serviceClassLoader = Utils.createClassLoader(new URL[] { servicesURL }, axisConfig .getServiceClassLoader(), false, null); // MODIFIED. SET extractJars TO FALSE - TWW serviceGroup.setServiceGroupClassLoader(serviceClassLoader); HashMap<?, ?> servicesMap = new HashMap<Object, Object>(); InputStream servicexmlStream = serviceClassLoader.getResourceAsStream("META-INF/services.xml");
ArrayList parameters = serviceGroup.getParameters(); Parameter parameter = ParameterUtil .createParameter(Constants.Configuration.ENABLE_MTOM, flag.trim()); serviceGroup.addParameter(parameter); Parameter parameter = serviceGroup.getParameter(Constants.Configuration.ENABLE_MTOM); for (Iterator iterator = serviceGroup.getServices(); iterator.hasNext();) { AxisService axisServce = (AxisService) iterator.next(); axisServce.addParameter(ParameterUtil.createParameter(
/** * Return service group details for a given service group * * @param serviceGroupName * * @return ServiceGroupMetaData * * @throws AxisFault */ public ServiceGroupMetaData listServiceGroup(String serviceGroupName) throws AxisFault { ServiceGroupMetaData sgmd = new ServiceGroupMetaData(); AxisServiceGroup serviceGroup = getAxisConfig().getServiceGroup(serviceGroupName); sgmd.setGroup_name(serviceGroup.getServiceGroupName()); Parameter parameter = serviceGroup.getParameter(Constants.Configuration.ENABLE_MTOM); if (parameter != null) { sgmd.setEnableMTOM((String) parameter.getValue()); } return sgmd; }
AxisServiceGroup serviceGroup = new AxisServiceGroup(); serviceGroup.setServiceGroupName(serviceGroupName); service = processService(deploymentFileData, serviceGroup, this.configCtx); service.setName(serviceHierarchy + service.getName());
public void setServiceGroupParameter(String serviceGroupId, OMElement parameterElement) throws AxisFault { AxisServiceGroup axisServiceGroup = getAxisConfig().getServiceGroup(serviceGroupId); Parameter parameter = ParameterUtil.createParameter(parameterElement); Parameter p = axisServiceGroup.getParameter(parameter.getName()); ServiceGroupDO serviceGroupDO = pm.getServiceGroup(serviceGroupId); ServiceGroupParameterDO sgParamDO = serviceGroupDO.getParameter(parameter.getName()); if (p != null && sgParamDO != null) { // Setting a new value for a parameter declared in AxisServiceGroup if (!p.isLocked()) { axisServiceGroup.addParameter(parameter); sgParamDO.setValue(parameterElement.toString()); pm.updateEntity(sgParamDO); } } else { // If we are adding a new AxisServiceGroup param or overriding a param in the Configuration hierarchy if (p == null || !p.isLocked()) { axisServiceGroup.addParameter(parameter); sgParamDO = new ServiceGroupParameterDO(); sgParamDO.setName(parameter.getName()); sgParamDO.setValue(parameterElement.toString()); sgParamDO.setServiceGroup(serviceGroupDO); try { pm.addEntity(sgParamDO); } catch (DuplicateEntityException e) { log.error("Service Parameter already exists", e); } } } }
if (serviceGrp.isEngaged(module)) { if (moduleId.equalsIgnoreCase("rahas")) { // Check if Rahas disengaging is possible for (Iterator iter = serviceGrp.getServices(); iter.hasNext();) { checkRahasDisengagingForService((AxisService) iter.next(), moduleId); for (Iterator iter = serviceGrp.getServices(); iter.hasNext();) { checkRampartDisengagingForService((AxisService) iter.next(), moduleId); serviceGrp.disengageModule(module);
public ArrayList<AxisService> processServiceGroup(OMElement serviceMetaData, DeploymentFileData currentFile, AxisServiceGroup axisServiceGroup, boolean extractService, Map<String, AxisService> wsdlServices, ConfigurationContext configCtx) throws AxisFault { Object serviceMetaDataObject; try { if (serviceMetaData == null) { serviceMetaDataObject = currentFile.getServiceMetaData(); if (serviceMetaDataObject != null && serviceMetaDataObject instanceof OMElement) { serviceMetaData = (OMElement) serviceMetaDataObject; } } if (serviceMetaData != null) { if(!extractService){ axisServiceGroup.setServiceGroupName( DescriptionBuilder.getShortFileName(currentFile.getName())); } else { axisServiceGroup.setServiceGroupName(currentFile.getName()); } return buildServiceGroup(serviceMetaData, currentFile, axisServiceGroup, wsdlServices, configCtx); } throw new DeploymentException("Can not find service meta data file"); } catch (XMLStreamException e) { throw new DeploymentException(e); } }
if (asg.isEngaged(axisModule)) { return "Module " + Utils.getModuleName(moduleId, moduleVersion) + " has already been engaged to service group " + serviceGroupId; "the Rampart module should be present."); if (!asg.isEngaged(rampartModule)) { engageModuleForServiceGroup(rampartModule.getName(), rampartModule.getVersion(), for (Iterator serviceIter = asg.getServices(); serviceIter.hasNext();) { AxisService service = (AxisService) serviceIter.next(); if (service.isEngaged(axisModule)) { asg.engageModule(axisModule);