Java Code Examples for org.apache.axis2.deployment.DeploymentEngine#addDeployer()
The following examples show how to use
org.apache.axis2.deployment.DeploymentEngine#addDeployer() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AppDeployerServiceComponent.java From micro-integrator with Apache License 2.0 | 6 votes |
/** * Initialize and add the CappDeployer to the Deployment Engine. */ private void addCAppDeployer(DeploymentEngine deploymentEngine) { String artifactRepoPath = configCtx.getAxisConfiguration().getRepository().getPath(); // Initialize CApp deployer here CappDeployer cappDeployer = new CappDeployer(); cappDeployer.setDirectory(artifactRepoPath + DeploymentConstants.CAPP_DIR_NAME); cappDeployer.init(configCtx); // Register application deployment handlers cappDeployer.registerDeploymentHandler(new FileRegistryResourceDeployer( synapseEnvironmentService.getSynapseEnvironment().getSynapseConfiguration().getRegistry())); cappDeployer.registerDeploymentHandler(new DataSourceCappDeployer()); cappDeployer.registerDeploymentHandler(new DefaultAppDeployer()); cappDeployer.registerDeploymentHandler(new SynapseAppDeployer()); //Add the deployer to deployment engine. This should be done after registering the deployment handlers. deploymentEngine.addDeployer(cappDeployer, artifactRepoPath + DeploymentConstants.CAPP_DIR_NAME, DeploymentConstants.CAPP_TYPE_EXTENSION); if (log.isDebugEnabled()) { log.debug("Successfully registered CappDeployer"); } }
Example 2
Source File: AppDeployerServiceComponent.java From micro-integrator with Apache License 2.0 | 6 votes |
/** * Initialize and add the Data Service Deployer to the Deployment Engine. */ private void addDBDeployer(DeploymentEngine deploymentEngine) { String artifactRepoPath = configCtx.getAxisConfiguration().getRepository().getPath(); // Create data services deployer DBDeployer dbDeployer = new DBDeployer(); dbDeployer.setDirectory(artifactRepoPath + DeploymentConstants.DSS_DIR_NAME); dbDeployer.setExtension(DeploymentConstants.DSS_TYPE_EXTENSION); // Register deployer in DeploymentEngine deploymentEngine.addDeployer(dbDeployer, DeploymentConstants.DSS_DIR_NAME, DeploymentConstants.DSS_TYPE_DBS); if (log.isDebugEnabled()) { log.debug("Successfully registered Data Service Deployer"); } }
Example 3
Source File: LoadBalancerServiceComponent.java From attic-stratos with Apache License 2.0 | 6 votes |
/** * Registers the Endpoint deployer. * * @param axisConfig AxisConfiguration to which this deployer belongs * @param synapseEnvironment SynapseEnvironment to which this deployer belongs */ private void registerDeployer(AxisConfiguration axisConfig, SynapseEnvironment synapseEnvironment) throws TenantAwareLoadBalanceEndpointException { SynapseConfiguration synCfg = synapseEnvironment .getSynapseConfiguration(); DeploymentEngine deploymentEngine = (DeploymentEngine) axisConfig .getConfigurator(); SynapseArtifactDeploymentStore deploymentStore = synCfg .getArtifactDeploymentStore(); String synapseConfigPath = ServiceBusUtils .getSynapseConfigAbsPath(synapseEnvironment .getServerContextInformation()); String endpointDirPath = synapseConfigPath + File.separator + MultiXMLConfigurationBuilder.ENDPOINTS_DIR; for (Endpoint ep : synCfg.getDefinedEndpoints().values()) { if (ep.getFileName() != null) { deploymentStore.addRestoredArtifact(endpointDirPath + File.separator + ep.getFileName()); } } deploymentEngine.addDeployer(new EndpointDeployer(), endpointDirPath, ServiceBusConstants.ARTIFACT_EXTENSION); }
Example 4
Source File: StartupAdminServiceComponent.java From micro-integrator with Apache License 2.0 | 5 votes |
private void registerDeployer(AxisConfiguration axisConfig, SynapseEnvironment synEnv) { DeploymentEngine deploymentEngine = (DeploymentEngine) axisConfig.getConfigurator(); SynapseArtifactDeploymentStore deploymentStore = synEnv.getSynapseConfiguration().getArtifactDeploymentStore(); String synapseConfigPath = ServiceBusUtils.getSynapseConfigAbsPath(synEnv.getServerContextInformation()); String taskDirDirPath = synapseConfigPath + File.separator + MultiXMLConfigurationBuilder.TASKS_DIR; for (Startup stp : synEnv.getSynapseConfiguration().getStartups()) { if (stp.getFileName() != null) { deploymentStore.addRestoredArtifact(taskDirDirPath + File.separator + stp.getFileName()); } } synchronized (axisConfig) { deploymentEngine.addDeployer(new TaskDeployer(), taskDirDirPath, ServiceBusConstants.ARTIFACT_EXTENSION); } }
Example 5
Source File: SynapseAppDeployer.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * Get the deployer for the Synapse Library * * @param axisConfig AxisConfiguration instance * @return Deployer instance */ private Deployer getSynapseLibraryDeployer(AxisConfiguration axisConfig) { try { String synapseLibraryPath = axisConfig.getRepository().getPath() + SynapseAppDeployerConstants.SYNAPSE_LIBS; DeploymentEngine deploymentEngine = (DeploymentEngine) axisConfig.getConfigurator(); deploymentEngine.addDeployer(new LibraryArtifactDeployer(), synapseLibraryPath, ServiceBusConstants.SYNAPSE_LIBRARY_EXTENSION); return deploymentEngine. getDeployer(synapseLibraryPath, ServiceBusConstants.SYNAPSE_LIBRARY_EXTENSION); } catch (Exception e) { log.error("Error occured while getting the deployer"); return null; } }
Example 6
Source File: CarbonSynapseController.java From micro-integrator with Apache License 2.0 | 5 votes |
@Override public void init(ServerConfigurationInformation serverConfigurationInformation, ServerContextInformation serverContextInformation) { Object context = serverContextInformation.getServerContext(); if (context instanceof ConfigurationContext) { AxisConfiguration axisCfg = ((ConfigurationContext) context).getAxisConfiguration(); synchronized (axisCfg) { DeploymentEngine deploymentEngine = (DeploymentEngine) axisCfg.getConfigurator(); // File carbonHome = new File(System.getProperty(ServerConstants.CARBON_HOME)); // subjected to change String carbonRepoPath = axisCfg.getRepository().getPath(); String mediatorsPath = carbonRepoPath + File.separator + "mediators"; String extensionsPath = carbonRepoPath + File.separator + "extensions"; ExtensionDeployer deployer = new ExtensionDeployer(); deploymentEngine.addDeployer(deployer, mediatorsPath, "xar"); deploymentEngine.addDeployer(deployer, extensionsPath, "xar"); deploymentEngine.addDeployer(deployer, mediatorsPath, "jar"); deploymentEngine.addDeployer(deployer, extensionsPath, "jar"); // Register deployer for class mediators String classMediatorsPath = carbonRepoPath + File.separator + "class-mediators"; deploymentEngine.addDeployer(new ClassMediatorDeployer(), classMediatorsPath, ServiceBusConstants.CLASS_MEDIATOR_EXTENSION); } this.currentConfigurationName = ((ConfigurationContext) context). getAxisConfiguration().getParameterValue( ServiceBusConstants.SYNAPSE_CURRENT_CONFIGURATION).toString(); this.synapseXMLLocation = serverConfigurationInformation.getSynapseXMLLocation(); } super.init(serverConfigurationInformation, serverContextInformation); }
Example 7
Source File: SynapseAppDeployer.java From micro-integrator with Apache License 2.0 | 4 votes |
/** * Register synapse deployers to the deployment engine. * * @param axisConfig - axisConfiguration to which this deployer belongs * @param artifactType - type of the artifact * @param deployer - related deployer */ private void registerSynapseDeployer(AxisConfiguration axisConfig, String artifactType, Deployer deployer) { DeploymentEngine deploymentEngine = (DeploymentEngine) axisConfig.getConfigurator(); String artifactDirName = getArtifactDirName(artifactType); if (artifactDirName != null) { SynapseArtifactDeploymentStore deploymentStore = getSynapseConfiguration(axisConfig).getArtifactDeploymentStore(); SynapseConfiguration synCfg = getSynapseConfiguration(axisConfig); String artifactDir = getArtifactDirPath(axisConfig, artifactDirName); switch (artifactType) { case SynapseAppDeployerConstants.SEQUENCE_TYPE: for (SequenceMediator seq : synCfg.getDefinedSequences().values()) { if (seq.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + seq.getFileName()); } } break; case SynapseAppDeployerConstants.ENDPOINT_TYPE: for (Endpoint ep : synCfg.getDefinedEndpoints().values()) { if (ep.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + ep.getFileName()); } } break; case SynapseAppDeployerConstants.PROXY_SERVICE_TYPE: for (ProxyService proxyService : synCfg.getProxyServices()) { if (proxyService.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + proxyService.getFileName()); } } break; case SynapseAppDeployerConstants.LOCAL_ENTRY_TYPE: for (Entry entry : synCfg.getDefinedEntries().values()) { if (entry.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + entry.getFileName()); } } break; case SynapseAppDeployerConstants.TASK_TYPE: for (Startup stp : synCfg.getStartups()) { if (stp.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + stp.getFileName()); } } break; case SynapseAppDeployerConstants.MESSAGE_STORE_TYPE: for (MessageStore messageStore : synCfg.getMessageStores().values()) { if (messageStore.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + messageStore.getFileName()); } } break; case SynapseAppDeployerConstants.MESSAGE_PROCESSOR_TYPE: for (MessageProcessor processor : synCfg.getMessageProcessors().values()) { if (processor.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + processor.getFileName()); } } break; case SynapseAppDeployerConstants.API_TYPE: for (API api : synCfg.getAPIs()) { if (api.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + api.getFileName()); } } break; case SynapseAppDeployerConstants.TEMPLATE_TYPE: for (TemplateMediator seqTempl : synCfg.getSequenceTemplates().values()) { if (seqTempl.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + seqTempl.getFileName()); } } for (Template epTempl : synCfg.getEndpointTemplates().values()) { if (epTempl.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + epTempl.getFileName()); } } break; case SynapseAppDeployerConstants.INBOUND_ENDPOINT_TYPE: for (InboundEndpoint inboundEndpoint : synCfg.getInboundEndpoints()) { if (inboundEndpoint.getFileName() != null) { deploymentStore.addRestoredArtifact(artifactDir + File.separator + inboundEndpoint.getFileName()); } } break; default: // do nothing } deploymentEngine.addDeployer(deployer, artifactDir, ServiceBusConstants.ARTIFACT_EXTENSION); } }