public class Play extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Play.Mode
2 modes
|
Modifier and Type | Field and Description |
---|---|
static File |
applicationPath
The application root
|
static ApplicationClasses |
classes
All loaded application classes
|
static ApplicationClassloader |
classloader
The application classLoader
|
static Properties |
configuration
The app configuration (already resolved from the framework id)
|
static Set<VirtualFile> |
confs
The loaded configuration files
|
static String |
ctxPath
Context path (when several application are deployed on the same host)
|
static String |
defaultWebEncoding
This is used as default encoding everywhere related to the web: request, response, WS
|
static boolean |
forceProd |
static File |
frameworkPath
The framework root
|
static String |
id
The framework ID
|
static boolean |
initialized
Is the application initialized
|
static List<VirtualFile> |
javaPath
All paths to search for Java files
|
static List<String> |
langs
The list of supported locales
|
static boolean |
lazyLoadTemplates
Lazy load the templates on demand
|
static Play.Mode |
mode
The application mode
|
static Map<String,VirtualFile> |
modules
Modules
|
static Map<String,VirtualFile> |
modulesRoutes
Plugin routes files
|
static PluginCollection |
pluginCollection
pluginCollection that holds all loaded plugins and all enabled plugins..
|
static List<PlayPlugin> |
plugins
Deprecated.
|
static boolean |
readOnlyTmp
tmp dir is readOnly
|
static List<VirtualFile> |
roots
All paths to search for files
|
static VirtualFile |
routes
Main routes file
|
static String |
secretKey
The very secret key
|
static boolean |
standalonePlayServer
This flag indicates if the app is running in a standalone Play server or
as a WAR in an applicationServer
|
static boolean |
started
Is the application started
|
static long |
startedAt
The last time than the application has started
|
static List<VirtualFile> |
templatesPath
All paths to search for templates files
|
static File |
tmpDir
tmp dir
|
static boolean |
usePrecompiled |
static String |
version
Framework version
|
Constructor and Description |
---|
Play() |
Modifier and Type | Method and Description |
---|---|
static void |
addModule(String name,
File path)
Add a play application (as plugin)
|
static void |
addModule(VirtualFile appRoot,
String name,
File path)
Add a play application (as plugin)
|
static void |
detectChanges()
Detect sources modifications
|
static void |
fatalServerErrorOccurred()
Call this method when there has been a fatal error that Play cannot recover from
|
static File |
getFile(String path)
Search a File in the current application
|
static VirtualFile |
getVirtualFile(String path)
Search a VirtualFile in all loaded applications and plugins
|
static void |
guessFrameworkPath() |
static void |
init(File root,
String id)
Init the framework
|
static void |
initStaticStuff()
Allow some code to run very early in Play - Use with caution !
|
static void |
loadModules()
Load all modules.
|
static void |
loadModules(VirtualFile appRoot)
Load all modules.
|
static <T> T |
plugin(Class<T> clazz) |
static void |
readConfiguration()
Read application.conf and resolve overridden key using the play id mechanism.
|
static boolean |
runingInTestMode()
Returns true if application is runing in test-mode.
|
static void |
start()
Start the application.
|
static void |
stop()
Stop the application
|
static boolean |
useDefaultMockMailSystem() |
public static boolean initialized
public static boolean started
public static String id
public static Play.Mode mode
public static File applicationPath
public static File tmpDir
public static boolean readOnlyTmp
public static File frameworkPath
public static ApplicationClasses classes
public static ApplicationClassloader classloader
public static List<VirtualFile> roots
public static List<VirtualFile> javaPath
public static List<VirtualFile> templatesPath
public static VirtualFile routes
public static Map<String,VirtualFile> modulesRoutes
public static Set<VirtualFile> confs
public static Properties configuration
public static long startedAt
public static String secretKey
public static PluginCollection pluginCollection
@Deprecated public static List<PlayPlugin> plugins
public static Map<String,VirtualFile> modules
public static String version
public static String ctxPath
public static boolean usePrecompiled
public static boolean forceProd
public static boolean lazyLoadTemplates
public static String defaultWebEncoding
public static boolean standalonePlayServer
public static void init(File root, String id)
root
- The application pathid
- The framework id to usepublic static void guessFrameworkPath()
public static void readConfiguration()
public static void start()
public static void stop()
public static void detectChanges()
public static <T> T plugin(Class<T> clazz)
public static void initStaticStuff()
public static void loadModules()
public static void loadModules(VirtualFile appRoot)
appRoot
- : the application path virtual filepublic static void addModule(String name, File path)
name
- : the module namepath
- The application pathpublic static void addModule(VirtualFile appRoot, String name, File path)
appRoot
- : the application path virtual filename
- : the module namepath
- The application pathpublic static VirtualFile getVirtualFile(String path)
path
- Relative path from the applications rootpublic static File getFile(String path)
path
- Relative path from the application rootpublic static boolean runingInTestMode()
public static void fatalServerErrorOccurred()
public static boolean useDefaultMockMailSystem()
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly