public final class Latkes extends Object
init(),
shutdown(),
getServePath(),
getStaticServePath()| Modifier and Type | Class and Description |
|---|---|
static class |
Latkes.RuntimeCache
Latke runtime cache specified in the configuration file local.properties.
|
static class |
Latkes.RuntimeDatabase
Latke runtime JDBC database specified in the configuration file local.properties.
|
static class |
Latkes.RuntimeMode
Latke runtime mode.
|
| Modifier and Type | Field and Description |
|---|---|
static ExecutorService |
EXECUTOR_SERVICE
Executor service.
|
static long |
startupTimeMillis
Application startup time millisecond.
|
static String |
VERSION
Version.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
currentPID()
Gets the current process's id.
|
static String |
getContextPath()
Gets context path.
|
static File |
getFile(String path)
Gets a file with the specified path.
|
static String |
getLatkeProperty(String key)
Gets a property specified by the given key from file "latke.properties".
|
static Locale |
getLocale()
Gets the locale.
|
static String |
getLocalProperty(String key)
Gets a property specified by the given key from file "local.properties".
|
static String |
getOperatingSystemName()
Gets operating system name.
|
static String |
getPublicIP()
Gets public IP.
|
static Latkes.RuntimeCache |
getRuntimeCache()
Gets the runtime cache.
|
static Latkes.RuntimeDatabase |
getRuntimeDatabase()
Gets the runtime database.
|
static Latkes.RuntimeMode |
getRuntimeMode()
Gets the runtime mode.
|
static String |
getScanPath()
Gets IoC scan path.
|
static String |
getServePath()
Gets serve path.
|
static String |
getServer()
Gets server.
|
static String |
getServerHost()
Gets server host.
|
static String |
getServerPort()
Gets server port.
|
static String |
getServerScheme()
Gets server scheme.
|
static String |
getSkinName(String skinDirName)
Gets the skin name for the specified skin directory name.
|
static String |
getStaticPath()
Gets static path.
|
static String |
getStaticResourceVersion()
Gets static resource (JS, CSS files) version.
|
static String |
getStaticServePath()
Gets static serve path.
|
static String |
getStaticServer()
Gets static server.
|
static String |
getStaticServerHost()
Gets static server host.
|
static String |
getStaticServerPort()
Gets static server port.
|
static String |
getStaticServerScheme()
Gets static server scheme.
|
static void |
init()
Initializes Latke framework.
|
static void |
initPublicIP()
Init public IP.
|
static boolean |
isDocker()
Checks if process is running via docker.
|
static boolean |
isEnabledSession()
Is enabled HTTP session.
|
static List<String> |
listFiles(String path)
Lists file names under the specified path
|
static void |
setContextPath(String contextPath)
Sets context path with the specified context path.
|
static void |
setEnabledSession(boolean enabled)
Whether enables HTTP session.
|
static void |
setLakteProps(Properties props)
Sets latke.props with the specified props.
|
static void |
setLatkeProperty(String key,
String value)
Sets latke.props with the specified key and value.
|
static void |
setLocale(Locale locale)
Sets the locale with the specified locale.
|
static void |
setLocalProperty(String key,
String value)
Sets local.props with the specified key and value.
|
static void |
setLocalProps(Properties props)
Sets local.props with the specified props.
|
static void |
setRuntimeMode(Latkes.RuntimeMode runtimeMode)
Sets the runtime mode with the specified mode.
|
static void |
setScanPath(String scanPath)
Sets IoC scan path with the specified scan path.
|
static void |
setStaticPath(String staticPath)
Sets static path with the specified static path.
|
static void |
setStaticResourceVersion(String staticResourceVersion)
Sets static resource version with the specified static resource version.
|
static void |
shutdown()
Shutdowns Latke.
|
public static final ExecutorService EXECUTOR_SERVICE
public static final String VERSION
public static long startupTimeMillis
public static void setEnabledSession(boolean enabled)
enabled - true if enable itpublic static boolean isEnabledSession()
false otherwisepublic static boolean isDocker()
true it is, returns false otherwisepublic static long currentPID()
public static String getOperatingSystemName()
public static void setLocalProps(Properties props)
props - the specified propspublic static void setLocalProperty(String key, String value)
key - the specified keyvalue - the specified valuepublic static void setLakteProps(Properties props)
props - the specified propspublic static void setLatkeProperty(String key, String value)
key - the specified keyvalue - the specified valuepublic static String getStaticResourceVersion()
Returns the value of "staticResourceVersion" property in local.properties. Returns the
application startup millisecond if not found the "staticResourceVersion" property in
local.properties.
public static void setStaticResourceVersion(String staticResourceVersion)
staticResourceVersion - the specified static resource versionpublic static String getServerScheme()
public static String getServerHost()
public static String getPublicIP()
public static void initPublicIP()
public static String getServerPort()
public static String getServer()
public static String getServePath()
public static String getStaticServerScheme()
public static String getStaticServerHost()
public static String getStaticServerPort()
public static String getStaticServer()
public static String getStaticServePath()
public static String getContextPath()
public static void setContextPath(String contextPath)
contextPath - the specified context pathpublic static String getStaticPath()
public static void setStaticPath(String staticPath)
staticPath - the specified static pathpublic static String getScanPath()
public static void setScanPath(String scanPath)
scanPath - the specified scan pathpublic static void init()
public static Latkes.RuntimeMode getRuntimeMode()
public static void setRuntimeMode(Latkes.RuntimeMode runtimeMode)
runtimeMode - the specified modepublic static Latkes.RuntimeCache getRuntimeCache()
public static Latkes.RuntimeDatabase getRuntimeDatabase()
public static Locale getLocale()
public static void setLocale(Locale locale)
locale - the specified localepublic static String getLocalProperty(String key)
key - the given keynull if not foundpublic static String getLatkeProperty(String key)
key - the given keynull if not foundpublic static void shutdown()
public static String getSkinName(String skinDirName)
name as the key) under skin directory specified by the given skin directory name.skinDirName - the given skin directory namenull if not found or error occurspublic static File getFile(String path)
path - the specified pathCopyright © 2009–2019 B3log. All rights reserved.