Package play
Class Play
- java.lang.Object
-
- play.Play
-
public class Play extends java.lang.ObjectMain framework class
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPlay.Mode
-
Field Summary
Fields Modifier and Type Field Description static java.io.FileapplicationPathstatic ApplicationClassesclassesstatic java.util.PropertiesconfigurationThe app configuration (already resolved from the framework id)static java.nio.charset.CharsetdefaultWebEncodingThis is used as default encoding everywhere related to the web: request, response, WSstatic java.lang.Stringidstatic Invokerinvokerstatic java.util.List<java.lang.String>langsThe list of supported localesstatic Play.Modemodestatic java.util.Map<java.lang.String,VirtualFile>modulesModulesstatic java.util.Map<java.lang.String,VirtualFile>modulesRoutesPlugin routes filesstatic PluginCollectionpluginCollectionpluginCollection that holds all loaded plugins and all enabled plugins..static java.util.List<VirtualFile>rootsAll paths to search for filesstatic VirtualFileroutesMain routes filestatic java.lang.StringsecretKeyThe very secret keystatic booleanstartedstatic longstartedAtThe last time than the application has startedstatic java.util.List<VirtualFile>templatesPathAll paths to search for templates filesstatic java.io.FiletmpDirstatic booleanusePrecompiled
-
Constructor Summary
Constructors Constructor Description Play()Play(ConfLoader confLoader, BeanSource beanSource, SessionStore sessionStore)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionInvokergetActionInvoker()static java.io.FilegetFile(java.lang.String path)Search a File in the current applicationstatic VirtualFilegetVirtualFile(java.lang.String path)Search a VirtualFile in all loaded applications and pluginsvoidinit(java.lang.String id)Init the frameworkstatic <T extends PlayPlugin>
Tplugin(java.lang.Class<T> clazz)static booleanrunningInTestMode()Returns true if application is running in test-mode.voidstart()Start the applicationstatic booleanuseDefaultMockMailSystem()
-
-
-
Field Detail
-
started
public static boolean started
-
id
public static java.lang.String id
-
mode
public static Play.Mode mode
-
applicationPath
public static java.io.File applicationPath
-
tmpDir
public static java.io.File tmpDir
-
classes
public static final ApplicationClasses classes
-
roots
public static java.util.List<VirtualFile> roots
All paths to search for files
-
templatesPath
public static java.util.List<VirtualFile> templatesPath
All paths to search for templates files
-
routes
public static VirtualFile routes
Main routes file
-
modulesRoutes
public static java.util.Map<java.lang.String,VirtualFile> modulesRoutes
Plugin routes files
-
configuration
public static java.util.Properties configuration
The app configuration (already resolved from the framework id)
-
startedAt
public static long startedAt
The last time than the application has started
-
langs
public static java.util.List<java.lang.String> langs
The list of supported locales
-
secretKey
public static java.lang.String secretKey
The very secret key
-
pluginCollection
public static PluginCollection pluginCollection
pluginCollection that holds all loaded plugins and all enabled plugins..
-
modules
public static java.util.Map<java.lang.String,VirtualFile> modules
Modules
-
usePrecompiled
public static boolean usePrecompiled
-
defaultWebEncoding
public static final java.nio.charset.Charset defaultWebEncoding
This is used as default encoding everywhere related to the web: request, response, WS
-
invoker
public static Invoker invoker
-
-
Constructor Detail
-
Play
public Play()
-
Play
public Play(ConfLoader confLoader, BeanSource beanSource, SessionStore sessionStore)
-
-
Method Detail
-
init
public void init(java.lang.String id)
Init the framework- Parameters:
id- The framework id to use
-
getActionInvoker
public ActionInvoker getActionInvoker()
-
start
public void start()
Start the application- Throws:
java.lang.IllegalArgumentException- if the application is already started
-
plugin
public static <T extends PlayPlugin> T plugin(java.lang.Class<T> clazz)
-
getVirtualFile
public static VirtualFile getVirtualFile(java.lang.String path)
Search a VirtualFile in all loaded applications and plugins- Parameters:
path- Relative path from the applications root- Returns:
- The virtualFile or null
-
getFile
public static java.io.File getFile(java.lang.String path)
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()
-
-