Package play
Class Play
java.lang.Object
play.Play
Main framework class
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Filestatic BeanSourceNot recommended to use directly.static final ApplicationClassesstatic ConfPropertiesThe app configuration (already resolved from the framework id)static final CharsetThis is used as default encoding everywhere related to the web: request, response, WSstatic Stringstatic InvokerThe list of supported localesstatic Play.Modestatic PluginCollectionpluginCollection that holds all loaded plugins and all enabled pluginsstatic ClasspathResourceThe routes filestatic StringThe very secret keystatic booleanstatic longThe last time than the application has startedAll paths to search for templates filesstatic Filestatic boolean -
Constructor Summary
ConstructorsConstructorDescriptionPlay()Play(ConfLoader confLoader, BeanSource beanSource, SessionStore sessionStore) Play(BeanSource beanSource) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable FileSearch a File in the applicationstatic FileSearch a File in the current applicationvoidInit the frameworkvoidminimalInit(String id) Minimalistic initialization of the framework; allowing DIY-initialization (no modules, no plugins from .plugins file, no routes from routes file, no config file)static <T extends PlayPlugin>
Tstatic StringrelativePath(File file) This logic was implemented intill v2.3.1and got refactored toPlay.relativePathin v2.4.0.static booleanReturns true if application is running in test-mode.voidstart()Start the applicationstatic boolean
-
Field Details
-
started
public static boolean started -
id
-
mode
-
appRoot
-
tmpDir
-
classes
-
templatesPath
All paths to search for templates files -
routes
The routes file -
configuration
The app configuration (already resolved from the framework id) -
startedAt
public static long startedAtThe last time than the application has started -
langs
The list of supported locales -
secretKey
The very secret key -
pluginCollection
pluginCollection that holds all loaded plugins and all enabled plugins -
usePrecompiled
public static boolean usePrecompiled -
defaultWebEncoding
This is used as default encoding everywhere related to the web: request, response, WS -
invoker
-
beanSource
Not recommended to use directly. Instead, you should use @Inject annotation to inject your dependencies (either constructor or field injection).
-
-
Constructor Details
-
Play
public Play() -
Play
-
Play
-
-
Method Details
-
init
Init the framework- Parameters:
id- The framework id to use
-
minimalInit
Minimalistic initialization of the framework; allowing DIY-initialization (no modules, no plugins from .plugins file, no routes from routes file, no config file)- Parameters:
id- The framework id to use
-
getActionInvoker
-
start
public void start()Start the application- Throws:
IllegalArgumentException- if the application is already started
-
plugin
-
file
Search a File in the application- Parameters:
path- Relative path from the applications root- Returns:
- The virtualFile or null
-
getFile
Search a File in the current application- Parameters:
path- Relative path from the application root- Returns:
- The file even if it doesn't exist
-
runningInTestMode
public static boolean runningInTestMode()Returns true if application is running in test-mode. Test-mode is resolved from the framework id.Your app is running in test-mode if the framework id (Play.id) is 'test' or 'test-?.*'
- Returns:
- true if test mode
-
useDefaultMockMailSystem
public static boolean useDefaultMockMailSystem() -
relativePath
This logic was implemented intill v2.3.1and got refactored toPlay.relativePathin v2.4.0. In versions 2.4.0 - 2.6.3, it didn't work properly on Windows. :) Does not support special characters like spaces and backslashes in the path.- Parameters:
file- any local file in the application- Returns:
- path to the file starting from application root (with slashes)
-