play
Class Play

java.lang.Object
  extended by play.Play

public class Play
extends java.lang.Object

Main framework class


Nested Class Summary
static class Play.Mode
          2 modes
 
Field Summary
static java.io.File applicationPath
          The application root
static ApplicationClasses classes
          All loaded application classes
static ApplicationClassloader classloader
          The application classLoader
static VirtualFile conf
          The main application.conf
static java.util.Properties configuration
          The app configuration (already resolved from the framework id)
static java.lang.String ctxPath
          Context path (when several application are deployed on the same host)
static boolean forceProd
           
static java.io.File frameworkPath
          The framework root
static java.lang.String id
          The framework ID
static java.util.List<VirtualFile> javaPath
          All paths to search for Java files
static java.util.List<java.lang.String> langs
          The list of supported locales
static boolean lazyLoadTemplates
          Lazy load the templates on demand
static Play.Mode mode
          The application mode
static java.util.Map<java.lang.String,VirtualFile> modules
          Modules
static java.util.Map<java.lang.String,VirtualFile> modulesRoutes
          Plugin routes files
static java.util.List<PlayPlugin> plugins
          Play plugins
static boolean readOnlyTmp
          tmp dir is readOnly
static java.util.List<VirtualFile> roots
          All paths to search for files
static VirtualFile routes
          Main routes file
static java.lang.String secretKey
          The very secret key
static boolean started
          Is the application started
static long startedAt
          The last time than the application has started
static java.util.List<VirtualFile> templatesPath
          All paths to search for templates files
static java.io.File tmpDir
          tmp dir
static boolean usePrecompiled
           
static java.lang.String version
          Framework version
 
Constructor Summary
Play()
           
 
Method Summary
static void addModule(java.lang.String name, java.io.File path)
          Add a play application (as plugin)
static void detectChanges()
          Detect sources modifications
static java.io.File getFile(java.lang.String path)
          Search a File in the current application
static VirtualFile getVirtualFile(java.lang.String path)
          Search a VirtualFile in all loaded applications and plugins
static void init(java.io.File root, java.lang.String id)
          Init the framework
static void initStaticStuff()
          Allow some code to run very eraly in Play! - Use with caution !
static void loadModules()
          Load all modules.
static void loadPlugins()
          Enable found plugins
static
<T> T
plugin(java.lang.Class<T> clazz)
           
static void start()
          Start the application.
static void stop()
          Stop the application
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

started

public static boolean started
Is the application started


id

public static java.lang.String id
The framework ID


mode

public static Play.Mode mode
The application mode


applicationPath

public static java.io.File applicationPath
The application root


tmpDir

public static java.io.File tmpDir
tmp dir


readOnlyTmp

public static boolean readOnlyTmp
tmp dir is readOnly


frameworkPath

public static java.io.File frameworkPath
The framework root


classes

public static ApplicationClasses classes
All loaded application classes


classloader

public static ApplicationClassloader classloader
The application classLoader


roots

public static java.util.List<VirtualFile> roots
All paths to search for files


javaPath

public static java.util.List<VirtualFile> javaPath
All paths to search for Java 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


conf

public static VirtualFile conf
The main application.conf


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


plugins

public static java.util.List<PlayPlugin> plugins
Play plugins


modules

public static java.util.Map<java.lang.String,VirtualFile> modules
Modules


version

public static java.lang.String version
Framework version


ctxPath

public static java.lang.String ctxPath
Context path (when several application are deployed on the same host)


usePrecompiled

public static boolean usePrecompiled

forceProd

public static boolean forceProd

lazyLoadTemplates

public static boolean lazyLoadTemplates
Lazy load the templates on demand

Constructor Detail

Play

public Play()
Method Detail

init

public static void init(java.io.File root,
                        java.lang.String id)
Init the framework

Parameters:
root - The application path
id - The framework id to use

start

public static void start()
Start the application. Recall to restart !


stop

public static void stop()
Stop the application


detectChanges

public static void detectChanges()
Detect sources modifications


plugin

public static <T> T plugin(java.lang.Class<T> clazz)

loadPlugins

public static void loadPlugins()
Enable found plugins


initStaticStuff

public static void initStaticStuff()
Allow some code to run very eraly in Play! - Use with caution !


loadModules

public static void loadModules()
Load all modules. You can even specify the list using the MODULES environement variable.


addModule

public static void addModule(java.lang.String name,
                             java.io.File path)
Add a play application (as plugin)

Parameters:
path - The application path

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


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly