Class CustomOrDefaultApplicationInstaller
- java.lang.Object
-
- org.bonitasoft.engine.api.impl.application.installer.CustomOrDefaultApplicationInstaller
-
@Component @ConditionalOnSingleCandidate(CustomOrDefaultApplicationInstaller.class) public class CustomOrDefaultApplicationInstaller extends java.lang.Object
Install custom application if one exists under a specific folder. If none, install default provided applications.
This installer listens to the eventPlatformStartedEvent
to ensure the platform is started before launching any application installation.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
addDefaultPages
protected ApplicationInstaller
applicationInstaller
protected java.lang.String
applicationInstallFolder
protected org.springframework.core.io.support.ResourcePatternResolver
cpResourceResolver
static java.lang.String
CUSTOM_APPLICATION_DEFAULT_FOLDER
-
Constructor Summary
Constructors Constructor Description CustomOrDefaultApplicationInstaller()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
autoDeployDetectedCustomApplication(PlatformStartedEvent event)
protected ApplicationArchive
getApplicationArchive(java.io.InputStream applicationZipFileStream)
protected static org.springframework.core.io.Resource
getResourceFromClasspath(org.springframework.core.io.Resource[] resources, java.lang.String type)
protected void
installCustomApplication(org.springframework.core.io.Resource customApplication)
-
-
-
Field Detail
-
CUSTOM_APPLICATION_DEFAULT_FOLDER
public static final java.lang.String CUSTOM_APPLICATION_DEFAULT_FOLDER
- See Also:
- Constant Field Values
-
applicationInstallFolder
@Value("${bonita.runtime.custom-application.install-folder:my-application}") protected java.lang.String applicationInstallFolder
-
addDefaultPages
@Value("${bonita.runtime.custom-application.install-provided-pages:false}") protected boolean addDefaultPages
-
applicationInstaller
protected final ApplicationInstaller applicationInstaller
-
cpResourceResolver
protected final org.springframework.core.io.support.ResourcePatternResolver cpResourceResolver
-
-
Method Detail
-
autoDeployDetectedCustomApplication
@EventListener public void autoDeployDetectedCustomApplication(PlatformStartedEvent event) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getResourceFromClasspath
protected static org.springframework.core.io.Resource getResourceFromClasspath(org.springframework.core.io.Resource[] resources, java.lang.String type) throws java.io.IOException, org.bonitasoft.engine.exception.ApplicationInstallationException
- Throws:
java.io.IOException
org.bonitasoft.engine.exception.ApplicationInstallationException
-
installCustomApplication
protected void installCustomApplication(org.springframework.core.io.Resource customApplication) throws java.lang.Exception
- Parameters:
customApplication
- custom application resource- Throws:
org.bonitasoft.engine.exception.ApplicationInstallationException
- if unable to install the applicationjava.lang.Exception
-
getApplicationArchive
protected ApplicationArchive getApplicationArchive(java.io.InputStream applicationZipFileStream) throws org.bonitasoft.engine.exception.ApplicationInstallationException
- Throws:
org.bonitasoft.engine.exception.ApplicationInstallationException
-
-