Package com.vaadin.flow.server.startup
Class DefaultApplicationConfigurationFactory
- java.lang.Object
-
- com.vaadin.flow.server.startup.AbstractConfigurationFactory
-
- com.vaadin.flow.server.startup.DefaultApplicationConfigurationFactory
-
- All Implemented Interfaces:
ApplicationConfigurationFactory
,Serializable
public class DefaultApplicationConfigurationFactory extends AbstractConfigurationFactory implements ApplicationConfigurationFactory
Default implementation ofApplicationConfigurationFactory
.- Since:
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DefaultApplicationConfigurationFactory.ApplicationConfigurationImpl
-
Field Summary
-
Fields inherited from class com.vaadin.flow.server.startup.AbstractConfigurationFactory
DEV_FOLDER_MISSING_MESSAGE
-
-
Constructor Summary
Constructors Constructor Description DefaultApplicationConfigurationFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationConfiguration
create(VaadinContext context)
Creates a new instance ofApplicationConfiguration
for the givencontext
.protected DefaultApplicationConfigurationFactory.ApplicationConfigurationImpl
doCreate(VaadinContext context, FallbackChunk chunk, Map<String,String> properties)
Creates application configuration instance based on provided data.protected String
getTokenFileFromClassloader(VaadinContext context)
Gets token file from the classpath using the providedcontext
.-
Methods inherited from class com.vaadin.flow.server.startup.AbstractConfigurationFactory
getConfigParametersUsingTokenData, getTokenFileContent, setDevModePropertiesUsingTokenData, verifyFolderExists
-
-
-
-
Method Detail
-
create
public ApplicationConfiguration create(VaadinContext context)
Description copied from interface:ApplicationConfigurationFactory
Creates a new instance ofApplicationConfiguration
for the givencontext
.- Specified by:
create
in interfaceApplicationConfigurationFactory
- Parameters:
context
- the context to create a configuration for- Returns:
- the configuration created based on the
context
-
doCreate
protected DefaultApplicationConfigurationFactory.ApplicationConfigurationImpl doCreate(VaadinContext context, FallbackChunk chunk, Map<String,String> properties)
Creates application configuration instance based on provided data.- Parameters:
context
- the Vaadin context, notnull
chunk
- the fallback chunk, may benull
properties
- the context parameters, notnull
- Returns:
- a new application configuration instance
-
getTokenFileFromClassloader
protected String getTokenFileFromClassloader(VaadinContext context) throws IOException
Gets token file from the classpath using the providedcontext
.The
contextClass
may be a class which is defined in the Web Application module/bundle and in this case it may be used to get Web Application resources. Also aVaadinContext
context
instance may be used to get a context of the Web Application (since thecontextClass
may be a class not from Web Application module). In WAR case it doesn't matter which class is used to get the resources (Web Application classes or e.g. "flow-server" classes) since they are loaded by the sameClassLoader
. But in OSGi "flow-server" module classes can't be used to get Web Application resources since they are in different bundles.- Parameters:
context
- a VaadinContext which may provide information how to get token file for the web application- Returns:
- the token file content
- Throws:
IOException
- if I/O fails during access to the token file
-
-