Package org.appng.api.model
Interface Application
-
- All Superinterfaces:
Identifiable<Integer>
,Identifier
,Nameable
,Named<Integer>
,Serializable
,Versionable<Date>
- All Known Subinterfaces:
AccessibleApplication
- All Known Implementing Classes:
ApplicationImpl
,ApplicationProvider
,TestBase.SimpleApplication
public interface Application extends Identifier
AApplication
is a component that adds certain functionality to the platform. It owns severalResource
s of different types. For eachApplication
, an ownApplicationContext
is build, based upon theApplication
's "beans.xml".- Author:
- Matthias Müller
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
containsBean(String beanName)
Checks whether a bean with the given name exists for thisApplication
.List<ApplicationSubject>
getApplicationSubjects()
Returns theApplicationSubject
s for thisApplication
<T> T
getBean(Class<T> type)
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> type)
Retrieves the bean of the given name and type from the underlyingApplicationContext
, if any.String[]
getBeanNames(Class<?> type)
Returns the names for all beans of the given type.FeatureProvider
getFeatureProvider()
Returns theFeatureProvider
for thisApplication
.String
getMessage(Locale locale, String key, Object... args)
Retrieves a message from the underlyingMessageSource
.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
.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
isPrivileged()
Returnstrue
if thisApplication
is a privileged application, which means it has access to the platform's root context and the platform-scopedEnvironment
.-
Methods inherited from interface org.appng.api.model.Identifiable
getId
-
Methods inherited from interface org.appng.api.model.Identifier
getAppNGVersion, getDisplayName, getLongDescription, getPackageVersion, getTimestamp, isInstalled, isSnapshot
-
Methods inherited from interface org.appng.api.model.Nameable
getDescription, getName
-
Methods inherited from interface org.appng.api.model.Versionable
getVersion
-
-
-
-
Method Detail
-
getPermissions
Set<Permission> getPermissions()
Returns thePermission
s for thisApplication
.- Returns:
- the
Permission
s
-
getRoles
Set<Role> getRoles()
ReturnsRole
s for thisApplication
.- Returns:
- the
Role
s
-
getResources
Resources getResources()
theResources
for thisApplication
.- Returns:
- the
Resources
for thisApplication
-
getResourceSet
Set<Resource> getResourceSet()
Returns theResource
s for thisApplication
.- Returns:
- the
Resource
s
-
getProperties
Properties getProperties()
Returns theProperties
s for thisApplication
.- Returns:
- the
Properties
s
-
getBean
<T> T getBean(String name, Class<T> type)
Retrieves the bean of the given name and type from the underlyingApplicationContext
, if any.- Parameters:
name
- the name of the bean to retrievetype
- the type of the bean to retrieve- Returns:
- the bean with the given name of the given type, if any.
-
getBeanNames
String[] getBeanNames(Class<?> type)
Returns the names for all beans of the given type.- Parameters:
type
- the type to get the bean names for- Returns:
- the bean names
-
getBean
<T> T getBean(Class<T> type)
Returns the single bean of the given type, if any.- Parameters:
type
- the type of the bean- Returns:
- the bean of the given type, or
null
if no such bean exists.
-
getBean
Object getBean(String beanName)
Returns the single bean with the given name, if any.- Parameters:
beanName
- the name of the bean- Returns:
- the bean with the given name, or
null
if no such bean exists.
-
containsBean
boolean containsBean(String beanName)
Checks whether a bean with the given name exists for thisApplication
.- Parameters:
beanName
- the name of the bean to check existence- Returns:
true
if such a bean exists,false
otherwise
-
isFileBased
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.- Returns:
true
if thisApplication
is filebased,false
otherwise
-
isPrivileged
boolean isPrivileged()
Returnstrue
if thisApplication
is a privileged application, which means it has access to the platform's root context and the platform-scopedEnvironment
.- Returns:
true
if thisApplication
is a privileged application,false
otherwise
-
isHidden
boolean isHidden()
Returnstrue
if thisApplication
is hidden, which means it does not appear in the navigation menu.- Returns:
true
if thisApplication
is hidden
-
getMessage
String getMessage(Locale locale, String key, Object... args)
Retrieves a message from the underlyingMessageSource
.- Parameters:
locale
- theLocale
for the messagekey
- the message-keyargs
- the arguments for the message- Returns:
- the message
- See Also:
ResourceType.DICTIONARY
-
getSessionParamKey
String getSessionParamKey(Site site)
Returns the key to retrieve the session-parameters for thisApplication
within the givenSite
from anEnvironment
.- Parameters:
site
- theSite
to retrieve the key for- Returns:
- the key to retrieve the session-parameters
- See Also:
getSessionParams(Site, Environment)
-
getSessionParams
Map<String,String> getSessionParams(Site site, Environment environment)
Retrieves the session-parameters for for thisApplication
within the givenSite
from the givenEnvironment
.- Parameters:
site
- theSite
to retrieve the session parameters forenvironment
- the currentEnvironment
- Returns:
- the session-parameters for this
Application
within the givenSite
- See Also:
getSessionParamKey(Site)
-
getFeatureProvider
FeatureProvider getFeatureProvider()
Returns theFeatureProvider
for thisApplication
.- Returns:
- the
FeatureProvider
-
getApplicationSubjects
List<ApplicationSubject> getApplicationSubjects()
Returns theApplicationSubject
s for thisApplication
- Returns:
- the
ApplicationSubject
s
-
-