public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException { log.info("Deploying HumanTask archive [ " + deploymentFileData.getName() + " ]"); try { humanTaskStore.deploy(deploymentFileData.getFile()); } catch (Exception e) { String errorMessage = "Error deploying HumanTask package : " + deploymentFileData.getName(); log.error(errorMessage, e); throw new DeploymentException(errorMessage, e); } }
/** * Reads the query-plan.siddhiql and deploys it. * * @param deploymentFileData information about query plan * @throws org.apache.axis2.deployment.DeploymentException */ public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException { try { String path = deploymentFileData.getAbsolutePath(); if (!deployedExecutionPlanFilePaths.contains(path)) { try { processDeploy(deploymentFileData); } catch (ExecutionPlanConfigurationException e) { throw new DeploymentException("Execution plan not deployed properly.", e); } } else { log.debug("Execution plan file is already deployed :" + path); deployedExecutionPlanFilePaths.remove(path); } } catch (Throwable t) { log.error("Can't deploy the execution plan: " + deploymentFileData.getName(), t); throw new DeploymentException("Can't deploy the execution plan: " + deploymentFileData.getName(), t); } }
public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException { if (AnalyticsEventSinkServerStartupObserver.getInstance().isServerStarted()) { log.info("Deploying analytics event store: " + deploymentFileData.getName()); int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); try { AnalyticsEventStore eventStoreConfiguration = AnalyticsEventStoreManager.getInstance() .getAnalyticsEventStore(deploymentFileData.getFile()); if (AnalyticsEventSinkUtil.getAnalyticsEventStoreName(deploymentFileData.getName()). equalsIgnoreCase(eventStoreConfiguration.getName())) { addEventStore(tenantId, eventStoreConfiguration); } else { throw new AnalyticsEventStoreDeploymentException("Invalid configuration provided! File name: " + AnalyticsEventSinkUtil.getAnalyticsEventStoreName(deploymentFileData.getName() + " should be " + "matched with deduced table name: " + eventStoreConfiguration.getName() + " for the streams")); } } catch (AnalyticsEventStoreException e) { String errMsg = "Error while deploying file: " + deploymentFileData.getName() + " for tenant id: " + tenantId; log.error(errMsg, e); throw new AnalyticsEventStoreDeploymentException(errMsg, e); } catch (Exception e) { String errorMsg = "Unable to deploy the event store: " + deploymentFileData.getName() + ". " + e.getMessage(); log.error(errorMsg, e); throw new AnalyticsEventStoreDeploymentException(errorMsg, e); } log.info("Deployed successfully analytics event store: " + deploymentFileData.getName()); } else { pausedDeployments.add(deploymentFileData); } }
module.setModuleClassLoader(deploymentClassLoader); module.setParent(axisConfig); module.setArchiveName(DescriptionBuilder.getShortFileName(deploymentFileData.getName())); populateModule(module, fileUrl); module.setFileName(fileUrl); log.error( Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), e.getMessage()), e); PrintWriter error_ptintWriter = new PrintWriter(errorWriter); e.printStackTrace(error_ptintWriter); log.error( Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), axisFault.getMessage()), axisFault); PrintWriter error_ptintWriter = new PrintWriter(errorWriter); axisFault.printStackTrace(error_ptintWriter); log.error( Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), t.getMessage()), t); PrintWriter error_ptintWriter = new PrintWriter(errorWriter); t.printStackTrace(error_ptintWriter); if (moduleStatus.startsWith("Error:")) { axisConfig.getFaultyModules().put( DeploymentEngine.getAxisServiceName(deploymentFileData.getName()), moduleStatus);
module.setModuleClassLoader(deploymentClassLoader); module.setParent(axisConfig); module.setArchiveName(DescriptionBuilder.getShortFileName(deploymentFileData.getName())); populateModule(module, fileUrl); module.setFileName(fileUrl); log.error( Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), e.getMessage()), e); PrintWriter error_ptintWriter = new PrintWriter(errorWriter); e.printStackTrace(error_ptintWriter); log.error( Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), axisFault.getMessage()), axisFault); PrintWriter error_ptintWriter = new PrintWriter(errorWriter); axisFault.printStackTrace(error_ptintWriter); log.error( Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), t.getMessage()), t); PrintWriter error_ptintWriter = new PrintWriter(errorWriter); t.printStackTrace(error_ptintWriter); if (moduleStatus.startsWith("Error:")) { axisConfig.getFaultyModules().put( DeploymentEngine.getAxisServiceName(deploymentFileData.getName()), moduleStatus);
if (isDirectory && deploymentFileData.getName().startsWith(".")) { // Ignore special meta directories starting with . return; } catch (DeploymentException e) { log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), e.getMessage()), e); } catch (AxisFault axisFault) { log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), axisFault.getMessage()), axisFault); } catch (MalformedURLException e) { log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), e.getMessage()), e); t.printStackTrace(pw); log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), t.getMessage()), t); if (moduleStatus.startsWith("Error:")) { axisConfig.getFaultyModules().put(DeploymentEngine.getAxisServiceName(
if (isDirectory && deploymentFileData.getName().startsWith(".")) { // Ignore special meta directories starting with . return; } catch (DeploymentException e) { log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), e.getMessage()), e); } catch (AxisFault axisFault) { log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), axisFault.getMessage()), axisFault); } catch (MalformedURLException e) { log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), e.getMessage()), e); t.printStackTrace(pw); log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, deploymentFileData.getName(), t.getMessage()), t); if (moduleStatus.startsWith("Error:")) { axisConfig.getFaultyModules().put(DeploymentEngine.getAxisServiceName(
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); } }
populateService(serviceGroup, servicesURL, DescriptionBuilder.getShortFileName(deploymentFileData.getName())); try { DeploymentEngine.addServiceGroup(serviceGroup, servicelist, servicesURL, null, log.error( Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE, deploymentFileData.getName(), axisFault.getMessage()), axisFault); PrintWriter error_ptintWriter = new PrintWriter(errorWriter); axisFault.printStackTrace(error_ptintWriter);
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); } }
public void run() { try { AnalyticsEventStoreDeployer deployer = (AnalyticsEventStoreDeployer) CarbonUtils.getDeployer(AnalyticsEventStoreDeployer.class.getName()); if (AnalyticsEventStoreDeployer.getPausedDeployments() != null) { List<DeploymentFileData> pausedDeployment = AnalyticsEventStoreDeployer.getPausedDeployments(); started.set(true); PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID); for (DeploymentFileData deploymentFileData : pausedDeployment) { try { deployer.deploy(deploymentFileData); } catch (DeploymentException e) { log.error("Error while deploying analytics event store the file : " + deploymentFileData.getName(), e); } } AnalyticsEventStoreDeployer.clearPausedDeployments(); PrivilegedCarbonContext.endTenantFlow(); } } catch (CarbonException e) { log.error("Error when getting the deployer for evn store to proceed the initialization of deployments. ", e); } } }
populateService(serviceGroup, servicesURL, DescriptionBuilder.getShortFileName(deploymentFileData.getName())); try { DeploymentEngine.addServiceGroup(serviceGroup, servicelist, servicesURL, null, log.error( Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE, deploymentFileData.getName(), axisFault.getMessage()), axisFault); PrintWriter error_ptintWriter = new PrintWriter(errorWriter); axisFault.printStackTrace(error_ptintWriter);
String shortFileName = DescriptionBuilder.getShortFileName(deploymentFile.getName()); if (!explodedDir) { ZipInputStream zin;
String shortFileName = DescriptionBuilder.getShortFileName(deploymentFile.getName()); if (!explodedDir) { ZipInputStream zin;
if (deploymentFileData.getName().startsWith("FEDERATED")) { throw new DeploymentException("'FEDERATED' is a reserved user store domain prefix. " + "Please start the file name with a different domain name.");
public static void addServiceGroup(AxisServiceGroup serviceGroup, ArrayList<AxisService> serviceList, URL serviceLocation, DeploymentFileData currentDeploymentFile, AxisConfiguration axisConfiguration) throws AxisFault { if (isServiceGroupReadyToDeploy(serviceGroup, serviceList, serviceLocation, currentDeploymentFile, axisConfiguration)) { fillServiceGroup(serviceGroup, serviceList, serviceLocation, axisConfiguration); axisConfiguration.addServiceGroup(serviceGroup); if (currentDeploymentFile != null) { addAsWebResources(currentDeploymentFile.getFile(), serviceGroup.getServiceGroupName(), serviceGroup); // let the system have hidden services if (!JavaUtils.isTrueExplicitly(serviceGroup.getParameterValue( Constants.HIDDEN_SERVICE_PARAM_NAME))) { log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS, currentDeploymentFile.getName(), serviceLocation.toString())); } } else if (!JavaUtils.isTrueExplicitly(serviceGroup.getParameterValue( Constants.HIDDEN_SERVICE_PARAM_NAME))) { log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS, serviceGroup.getServiceGroupName(), "")); } } }
public static void addServiceGroup(AxisServiceGroup serviceGroup, ArrayList<AxisService> serviceList, URL serviceLocation, DeploymentFileData currentDeploymentFile, AxisConfiguration axisConfiguration) throws AxisFault { if (isServiceGroupReadyToDeploy(serviceGroup, serviceList, serviceLocation, currentDeploymentFile, axisConfiguration)) { fillServiceGroup(serviceGroup, serviceList, serviceLocation, axisConfiguration); axisConfiguration.addServiceGroup(serviceGroup); if (currentDeploymentFile != null) { addAsWebResources(currentDeploymentFile.getFile(), serviceGroup.getServiceGroupName(), serviceGroup); // let the system have hidden services if (!JavaUtils.isTrueExplicitly(serviceGroup.getParameterValue( Constants.HIDDEN_SERVICE_PARAM_NAME))) { log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS, currentDeploymentFile.getName(), serviceLocation.toString())); } } else if (!JavaUtils.isTrueExplicitly(serviceGroup.getParameterValue( Constants.HIDDEN_SERVICE_PARAM_NAME))) { log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS, serviceGroup.getServiceGroupName(), "")); } } }
executionPlanConfigurationFile.setStatus(ExecutionPlanConfigurationFile.Status.DEPLOYED); executionPlanConfigurationFile.setExecutionPlanName(executionPlanName); executionPlanConfigurationFile.setFileName(deploymentFileData.getName()); executionPlanConfigurationFile.setFilePath(deploymentFileData.getAbsolutePath()); carbonEventProcessorService.addExecutionPlanConfigurationFile(executionPlanConfigurationFile); executionPlanConfigurationFile.setStatus(ExecutionPlanConfigurationFile.Status.WAITING_FOR_DEPENDENCY); executionPlanConfigurationFile.setExecutionPlanName(executionPlanName); executionPlanConfigurationFile.setFileName(deploymentFileData.getName()); executionPlanConfigurationFile.setFilePath(deploymentFileData.getAbsolutePath()); carbonEventProcessorService.addExecutionPlanConfigurationFile(executionPlanConfigurationFile); executionPlanConfigurationFile.setStatus(ExecutionPlanConfigurationFile.Status.ERROR); executionPlanConfigurationFile.setExecutionPlanName(executionPlanName); executionPlanConfigurationFile.setFileName(deploymentFileData.getName()); executionPlanConfigurationFile.setFilePath(deploymentFileData.getAbsolutePath()); carbonEventProcessorService.addExecutionPlanConfigurationFile(executionPlanConfigurationFile);