public class Init
extends java.lang.Object
Entry to add, start and manage init flow.
Created by mark.zhai on 2015/10/2.| 构造器和说明 |
|---|
Init() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addFlow(Flow flow)
Add flow to let Init manage.
|
static void |
addFlow(java.util.Map<java.lang.String,Flow> flowMap)
Add flow map to let Init manage.
|
static void |
cancel(java.lang.String flowName)
Cancel the flow.
|
static void |
clearFlow()
Clear flow map.
|
static android.content.Context |
getContext()
Get application context for process information, package usage.
|
static Flow |
getFlow(java.lang.String flowName) |
static int |
getFlowStatus(java.lang.String flowName)
Get status of flow specified by given name, see
Status. |
static java.util.concurrent.ExecutorService |
getThreadPool()
Get thread pool used internally by Init library.
|
static void |
init(android.content.Context context)
Init with context.
|
static void |
init(android.content.Context context,
ILog logProxy)
Init with context and log class.
|
static void |
removeFlow(java.lang.String flowName)
Remove flow from Init.
|
static void |
setThreadPoolSize(int size)
Set thread pool size used by tasks.
|
static void |
start(Flow flow)
start flow.
|
static void |
start(java.lang.String flowName)
start flow.
|
static void |
startAndRemove(java.lang.String flowName)
start flow and remove from Init management.
|
public static void init(android.content.Context context)
context - application contextpublic static void init(android.content.Context context,
ILog logProxy)
context - application contextlogProxy - log class implements ILogpublic static void addFlow(Flow flow)
flow - flow which unique namepublic static void addFlow(java.util.Map<java.lang.String,Flow> flowMap)
flowMap - map which contains flow-name to flow mappingpublic static void removeFlow(java.lang.String flowName)
flowName - flow namepublic static void clearFlow()
public static android.content.Context getContext()
public static void setThreadPoolSize(int size)
size - thread pool size, value less or equal than 0 will produce a cached thread pool.public static Flow getFlow(java.lang.String flowName)
public static void start(java.lang.String flowName)
flowName - flow key, should be unique for each flow.public static void startAndRemove(java.lang.String flowName)
flowName - flow key, should be unique for each flow.public static void start(Flow flow)
public static void cancel(java.lang.String flowName)
flowName - flow key, should be unique for each flow.public static int getFlowStatus(java.lang.String flowName)
Status.flowName - flow key, should be unique for each flow.STATUS_UNKNOWN, STATUS_PENDING_START,
STATUS_EXECUTING and STATUS_DONE.public static java.util.concurrent.ExecutorService getThreadPool()