Package org.appng.core.model
Class ApplicationProvider
- java.lang.Object
-
- org.appng.core.domain.SiteApplication
-
- org.appng.core.model.ApplicationProvider
-
- All Implemented Interfaces:
Serializable
,Application
,Identifiable<Integer>
,Identifier
,Nameable
,Named<Integer>
,Versionable<Date>
,AccessibleApplication
public class ApplicationProvider extends SiteApplication implements AccessibleApplication
AnApplicationProvider
actually processes theApplicationRequest
by building and executingCallableAction
s andCallableDataSource
s.- Author:
- Matthias Müller
- See Also:
process(ApplicationRequest, MarshallService, Path, PlatformConfig)
,CallableAction.perform()
,CallableDataSource.perform(String, boolean, boolean)
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApplicationProvider(Site site, Application application)
ApplicationProvider(Site site, Application application, boolean monitorPerformance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeContext()
boolean
containsBean(String beanName)
Checks whether a bean with the given name exists for thisApplication
.boolean
equals(Object o)
Application
getApplication()
ApplicationConfigProvider
getApplicationConfig()
ApplicationRequest
getApplicationRequest(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
ApplicationRequest
getApplicationRequest(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, boolean createNew)
List<ApplicationSubject>
getApplicationSubjects()
Returns theApplicationSubject
s for thisApplication
String
getAppNGVersion()
Returns the version of appNG theApplication
is compatible with.<T> T
getBean(Class<T> clazz)
Returns the single bean of the given type, if any.Object
getBean(String beanName)
Returns the single bean with the given name, if any.<T> T
getBean(String name, Class<T> clazz)
Retrieves the bean of the given name and type from the underlyingApplicationContext
, if any.String[]
getBeanNames(Class<?> clazz)
Returns the names for all beans of the given type.org.springframework.context.ConfigurableApplicationContext
getContext()
DatabaseConnection
getDatabaseConnection()
String
getDescription()
Returns the description.String
getDisplayName()
Returns the display name.FeatureProvider
getFeatureProvider()
Returns theFeatureProvider
for thisApplication
.Integer
getId()
Returns the id.List<JarInfo>
getJarInfos()
String
getLongDescription()
Returns the description.String
getMessage(Locale locale, String key, Object... args)
Retrieves a message from the underlyingMessageSource
.String
getName()
Returns the name.String
getPackageVersion()
Returns the version.Set<Permission>
getPermissions()
Returns thePermission
s for thisApplication
.Properties
getProperties()
Returns theProperties
s for thisApplication
.Resources
getResources()
theResources
for thisApplication
.Set<Resource>
getResourceSet()
Returns theResource
s for thisApplication
.Set<Role>
getRoles()
ReturnsRole
s for thisApplication
.String
getSessionParamKey(Site site)
Returns the key to retrieve the session-parameters for thisApplication
within the givenSite
from anEnvironment
.Map<String,String>
getSessionParams(Site site, Environment environment)
Retrieves the session-parameters for for thisApplication
within the givenSite
from the givenEnvironment
.Site
getSite()
String
getTimestamp()
Returns the timestamp theApplication
was build.Date
getVersion()
Returns the version.int
hashCode()
boolean
isFileBased()
Returnstrue
if thisApplication
is filebased, which means it's originalResource
s are stored on disk,false
if theResource
s are stored in the database.boolean
isHidden()
Returnstrue
if thisApplication
is hidden, which means it does not appear in the navigation menu.boolean
isInstalled()
Checks whether theApplication
is installed.boolean
isPrivileged()
Returnstrue
if thisApplication
is a privileged application, which means it has access to the platform's root context and the platform-scopedEnvironment
.boolean
isSnapshot()
Checks whether theApplication
has a SNAPSHOT-versionApplicationReference
process(ApplicationRequest applicationRequest, MarshallService marshallService, Path pathInfo, PlatformConfig platformConfig)
Action
processAction(javax.servlet.http.HttpServletResponse servletResponse, boolean applyPermissionsOnRef, ApplicationRequest applicationRequest, String actionId, String eventId, MarshallService marshallService)
Datasource
processDataSource(javax.servlet.http.HttpServletResponse servletResponse, boolean applyPermissionsOnRef, ApplicationRequest applicationRequest, String dataSourceId, MarshallService marshallService)
void
setApplicationConfig(ApplicationConfigProvider applicationConfig)
void
setContext(org.springframework.context.ConfigurableApplicationContext applicationContext)
void
setDatabaseConnection(DatabaseConnection databaseConnection)
void
setDescription(String description)
void
setFeatureProvider(FeatureProvider featureProvider)
void
setFileBased(boolean fileBased)
void
setId(Integer id)
void
setName(String name)
protected void
setParamValues(ApplicationRequest applicationRequest, Params params)
void
setPermissions(Set<Permission> permissions)
void
setPlatformScope()
void
setPlatformScope(boolean enabled)
void
setPrivileged(boolean isPrivileged)
void
setProperties(Properties properties)
void
setResources(Resources applicationResourceHolder)
void
setRoles(Set<Role> roles)
void
setVersion(Date version)
String
toString()
-
Methods inherited from class org.appng.core.domain.SiteApplication
getGrantedSites, getSiteApplicationId, isActive, isMarkedForDeletion, isReloadRequired, setActive, setApplication, setGrantedSites, setMarkedForDeletion, setReloadRequired, setSite, setSiteApplicationId
-
-
-
-
Constructor Detail
-
ApplicationProvider
public ApplicationProvider(Site site, Application application, boolean monitorPerformance)
-
ApplicationProvider
public ApplicationProvider(Site site, Application application)
-
-
Method Detail
-
process
public ApplicationReference process(ApplicationRequest applicationRequest, MarshallService marshallService, Path pathInfo, PlatformConfig platformConfig)
- Parameters:
applicationRequest
- theApplicationRequest
to processmarshallService
- aMarshallService
pathInfo
- the currentPath
platformConfig
- the currentPlatformConfig
- Returns:
- the
ApplicationReference
to be used for theContent
of thePlatform
-
setApplicationConfig
public void setApplicationConfig(ApplicationConfigProvider applicationConfig) throws InvalidConfigurationException
- Throws:
InvalidConfigurationException
-
getId
public Integer getId()
Description copied from interface:Identifiable
Returns the id.- Specified by:
getId
in interfaceIdentifiable<Integer>
- Returns:
- the id
-
setId
public void setId(Integer id)
- Specified by:
setId
in interfaceAccessibleApplication
-
setName
public void setName(String name)
- Specified by:
setName
in interfaceAccessibleApplication
-
getDescription
public String getDescription()
Description copied from interface:Nameable
Returns the description.- Specified by:
getDescription
in interfaceNameable
- Returns:
- the description
-
setDescription
public void setDescription(String description)
- Specified by:
setDescription
in interfaceAccessibleApplication
-
getDisplayName
public String getDisplayName()
Description copied from interface:Identifier
Returns the display name.- Specified by:
getDisplayName
in interfaceIdentifier
- Returns:
- the display name
-
getPackageVersion
public String getPackageVersion()
Description copied from interface:Identifier
Returns the version.- Specified by:
getPackageVersion
in interfaceIdentifier
- Returns:
- the version
-
getTimestamp
public String getTimestamp()
Description copied from interface:Identifier
Returns the timestamp theApplication
was build.- Specified by:
getTimestamp
in interfaceIdentifier
- Returns:
- the timestamp the
Application
was build
-
getLongDescription
public String getLongDescription()
Description copied from interface:Identifier
Returns the description.- Specified by:
getLongDescription
in interfaceIdentifier
- Returns:
- the description
-
getAppNGVersion
public String getAppNGVersion()
Description copied from interface:Identifier
Returns the version of appNG theApplication
is compatible with.- Specified by:
getAppNGVersion
in interfaceIdentifier
- Returns:
- the version of appNG the
Application
is compatible with
-
isInstalled
public boolean isInstalled()
Description copied from interface:Identifier
Checks whether theApplication
is installed.- Specified by:
isInstalled
in interfaceIdentifier
- Returns:
true
if theApplication
is installed,false
otherwise
-
isSnapshot
public boolean isSnapshot()
Description copied from interface:Identifier
Checks whether theApplication
has a SNAPSHOT-version- Specified by:
isSnapshot
in interfaceIdentifier
- Returns:
true
if theApplication
has a SNAPSHOT-version,false
otherwise
-
isFileBased
public boolean isFileBased()
Description copied from interface:Application
Returnstrue
if thisApplication
is filebased, which means it's originalResource
s are stored on disk,false
if theResource
s are stored in the database.- Specified by:
isFileBased
in interfaceApplication
- Returns:
true
if thisApplication
is filebased,false
otherwise
-
setFileBased
public void setFileBased(boolean fileBased)
- Specified by:
setFileBased
in interfaceAccessibleApplication
-
getVersion
public Date getVersion()
Description copied from interface:Versionable
Returns the version.- Specified by:
getVersion
in interfaceVersionable<Date>
- Returns:
- the version
-
setVersion
public void setVersion(Date version)
- Specified by:
setVersion
in interfaceAccessibleApplication
-
getPermissions
public Set<Permission> getPermissions()
Description copied from interface:Application
Returns thePermission
s for thisApplication
.- Specified by:
getPermissions
in interfaceApplication
- Returns:
- the
Permission
s
-
setPermissions
public void setPermissions(Set<Permission> permissions)
- Specified by:
setPermissions
in interfaceAccessibleApplication
-
getRoles
public Set<Role> getRoles()
Description copied from interface:Application
ReturnsRole
s for thisApplication
.- Specified by:
getRoles
in interfaceApplication
- Returns:
- the
Role
s
-
setRoles
public void setRoles(Set<Role> roles)
- Specified by:
setRoles
in interfaceAccessibleApplication
-
getProperties
public Properties getProperties()
Description copied from interface:Application
Returns theProperties
s for thisApplication
.- Specified by:
getProperties
in interfaceApplication
- Returns:
- the
Properties
s
-
setProperties
public void setProperties(Properties properties)
- Specified by:
setProperties
in interfaceAccessibleApplication
-
setContext
public void setContext(org.springframework.context.ConfigurableApplicationContext applicationContext)
- Specified by:
setContext
in interfaceAccessibleApplication
-
getBean
public <T> T getBean(String name, Class<T> clazz)
Description copied from interface:Application
Retrieves the bean of the given name and type from the underlyingApplicationContext
, if any.- Specified by:
getBean
in interfaceApplication
- Parameters:
name
- the name of the bean to retrieveclazz
- the type of the bean to retrieve- Returns:
- the bean with the given name of the given type, if any.
-
getBean
public <T> T getBean(Class<T> clazz)
Description copied from interface:Application
Returns the single bean of the given type, if any.- Specified by:
getBean
in interfaceApplication
- Parameters:
clazz
- the type of the bean- Returns:
- the bean of the given type, or
null
if no such bean exists.
-
getBean
public Object getBean(String beanName)
Description copied from interface:Application
Returns the single bean with the given name, if any.- Specified by:
getBean
in interfaceApplication
- Parameters:
beanName
- the name of the bean- Returns:
- the bean with the given name, or
null
if no such bean exists.
-
getBeanNames
public String[] getBeanNames(Class<?> clazz)
Description copied from interface:Application
Returns the names for all beans of the given type.- Specified by:
getBeanNames
in interfaceApplication
- Parameters:
clazz
- the type to get the bean names for- Returns:
- the bean names
-
isPrivileged
public boolean isPrivileged()
Description copied from interface:Application
Returnstrue
if thisApplication
is a privileged application, which means it has access to the platform's root context and the platform-scopedEnvironment
.- Specified by:
isPrivileged
in interfaceApplication
- Returns:
true
if thisApplication
is a privileged application,false
otherwise
-
setPrivileged
public void setPrivileged(boolean isPrivileged)
- Specified by:
setPrivileged
in interfaceAccessibleApplication
-
getMessage
public String getMessage(Locale locale, String key, Object... args)
Description copied from interface:Application
Retrieves a message from the underlyingMessageSource
.- Specified by:
getMessage
in interfaceApplication
- Parameters:
locale
- theLocale
for the messagekey
- the message-keyargs
- the arguments for the message- Returns:
- the message
- See Also:
ResourceType.DICTIONARY
-
closeContext
public void closeContext()
- Specified by:
closeContext
in interfaceAccessibleApplication
-
setResources
public void setResources(Resources applicationResourceHolder)
- Specified by:
setResources
in interfaceAccessibleApplication
-
getResources
public Resources getResources()
Description copied from interface:Application
theResources
for thisApplication
.- Specified by:
getResources
in interfaceAccessibleApplication
- Specified by:
getResources
in interfaceApplication
- Returns:
- the
Resources
for thisApplication
-
isHidden
public boolean isHidden()
Description copied from interface:Application
Returnstrue
if thisApplication
is hidden, which means it does not appear in the navigation menu.- Specified by:
isHidden
in interfaceApplication
- Returns:
true
if thisApplication
is hidden
-
containsBean
public boolean containsBean(String beanName)
Description copied from interface:Application
Checks whether a bean with the given name exists for thisApplication
.- Specified by:
containsBean
in interfaceApplication
- Parameters:
beanName
- the name of the bean to check existence- Returns:
true
if such a bean exists,false
otherwise
-
getApplicationConfig
public ApplicationConfigProvider getApplicationConfig()
-
getSessionParamKey
public String getSessionParamKey(Site site)
Description copied from interface:Application
Returns the key to retrieve the session-parameters for thisApplication
within the givenSite
from anEnvironment
.- Specified by:
getSessionParamKey
in interfaceApplication
- Parameters:
site
- theSite
to retrieve the key for- Returns:
- the key to retrieve the session-parameters
- See Also:
Application.getSessionParams(Site, Environment)
-
getSessionParams
public Map<String,String> getSessionParams(Site site, Environment environment)
Description copied from interface:Application
Retrieves the session-parameters for for thisApplication
within the givenSite
from the givenEnvironment
.- Specified by:
getSessionParams
in interfaceApplication
- Parameters:
site
- theSite
to retrieve the session parameters forenvironment
- the currentEnvironment
- Returns:
- the session-parameters for this
Application
within the givenSite
- See Also:
Application.getSessionParamKey(Site)
-
getFeatureProvider
public FeatureProvider getFeatureProvider()
Description copied from interface:Application
Returns theFeatureProvider
for thisApplication
.- Specified by:
getFeatureProvider
in interfaceApplication
- Returns:
- the
FeatureProvider
-
setFeatureProvider
public void setFeatureProvider(FeatureProvider featureProvider)
- Specified by:
setFeatureProvider
in interfaceAccessibleApplication
-
getApplicationSubjects
public List<ApplicationSubject> getApplicationSubjects()
Description copied from interface:Application
Returns theApplicationSubject
s for thisApplication
- Specified by:
getApplicationSubjects
in interfaceApplication
- Returns:
- the
ApplicationSubject
s
-
getApplicationRequest
public ApplicationRequest getApplicationRequest(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
-
getApplicationRequest
public ApplicationRequest getApplicationRequest(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, boolean createNew)
-
processAction
public Action processAction(javax.servlet.http.HttpServletResponse servletResponse, boolean applyPermissionsOnRef, ApplicationRequest applicationRequest, String actionId, String eventId, MarshallService marshallService) throws InvalidConfigurationException, ProcessingException
-
setParamValues
protected void setParamValues(ApplicationRequest applicationRequest, Params params)
-
processDataSource
public Datasource processDataSource(javax.servlet.http.HttpServletResponse servletResponse, boolean applyPermissionsOnRef, ApplicationRequest applicationRequest, String dataSourceId, MarshallService marshallService) throws InvalidConfigurationException, ProcessingException
-
getContext
public org.springframework.context.ConfigurableApplicationContext getContext()
- Specified by:
getContext
in interfaceAccessibleApplication
-
getApplication
public Application getApplication()
- Overrides:
getApplication
in classSiteApplication
-
getSite
public Site getSite()
- Overrides:
getSite
in classSiteApplication
-
getResourceSet
public Set<Resource> getResourceSet()
Description copied from interface:Application
Returns theResource
s for thisApplication
.- Specified by:
getResourceSet
in interfaceApplication
- Returns:
- the
Resource
s
-
setDatabaseConnection
public void setDatabaseConnection(DatabaseConnection databaseConnection)
- Overrides:
setDatabaseConnection
in classSiteApplication
-
getDatabaseConnection
public DatabaseConnection getDatabaseConnection()
- Overrides:
getDatabaseConnection
in classSiteApplication
-
setPlatformScope
public void setPlatformScope()
-
setPlatformScope
public void setPlatformScope(boolean enabled)
-
-