@ApplicationScoped public class DeploymentScanner extends Object implements Startable
This class implements the deployment scanner for dashbuilder webapp.
This class reads the files present in a given folder at startup and import all the assets found, such as:
datasource
kpis
workspace
The default directory to scan at startup is WEB-INF/deployments
.
You can change the default directory to scan by the system property -DdeploymentFolder
.
Modifier and Type | Field and Description |
---|---|
protected File |
baseAppDirectory |
protected String |
deploymentFolder |
protected static String |
INITIAL_MODULES_NAMESPACE_DATASOURCE |
protected static String |
INITIAL_MODULES_NAMESPACE_KPI |
protected static String |
INITIAL_MODULES_NAMESPACE_WORKSPACE |
protected InitialModuleRegistry |
initialModuleRegistry |
protected org.slf4j.Logger |
log |
protected static int |
VERSION |
Constructor and Description |
---|
DeploymentScanner() |
Modifier and Type | Method and Description |
---|---|
protected void |
doDeployDataSources()
Look into the deployment directory and processes any datasource definition file found.
|
protected void |
doDeployKPIs()
Look into the deployment directory and processes any kpi or datasource definition file found.
|
protected void |
doDeployWorkspaces()
Look into the deployment directory and processes any workspace definition file found.
|
Priority |
getPriority() |
protected String |
getRelativePathtoWebappBase(String path)
Given an absolute path returns the relative path from the webapp base path.
|
void |
init() |
protected String |
removeExtension(String fileName)
Return the file name without the extension suffix.
|
void |
start() |
protected static final String INITIAL_MODULES_NAMESPACE_KPI
protected static final String INITIAL_MODULES_NAMESPACE_WORKSPACE
protected static final String INITIAL_MODULES_NAMESPACE_DATASOURCE
protected static final int VERSION
@Inject protected transient org.slf4j.Logger log
@Inject protected String deploymentFolder
protected File baseAppDirectory
@Inject protected InitialModuleRegistry initialModuleRegistry
@PostConstruct public void init()
public Priority getPriority()
getPriority
in interface Startable
public void start() throws Exception
protected void doDeployDataSources()
protected void doDeployKPIs()
protected void doDeployWorkspaces()
protected String removeExtension(String fileName)
fileName
- The file name.Copyright © 2012–2016 JBoss by Red Hat. All rights reserved.