|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.engine.EngineManager
public class EngineManager
EngineManager class is responsible for creating, handling and deletion of engines in the People client. The EngineManager determine when each engine should be run based on the engine's next run time or whether there is a waiting request for that engine. The EngineManager routes received responses to the appropriate engine.
Nested Class Summary | |
---|---|
static class |
EngineManager.EngineId
Identifiers for engines. |
Field Summary | |
---|---|
private static long |
ENGINE_RUN_TIME_THRESHOLD
Maximum time the run function for an engine is allowed to run before a warning message will be displayed (debug only) |
private ActivitiesEngine |
mActivitiesEngine
|
private ContactSyncEngine |
mContactSyncEngine
|
private ContentEngine |
mContentEngine
|
private java.util.HashMap<java.lang.Integer,BaseEngine> |
mEngineList
Engine manager maintains a list of all engines in the system. |
private GroupsEngine |
mGroupsEngine
|
private IdentityEngine |
mIdentityEngine
|
private LoginEngine |
mLoginEngine
|
private PresenceEngine |
mPresenceEngine
|
private RemoteService |
mService
Reference to the object which provides access to the WorkerThread . |
private SyncMeEngine |
mSyncMeEngine
|
private BaseEngine.IEngineEventCallback |
mUiEventCallback
Engines require access the BaseEngine.IEngineEventCallback interface. |
private UpgradeEngine |
mUpgradeEngine
|
private static EngineManager |
sEngineManager
EngineManager is a singleton, so this is the static reference |
Constructor Summary | |
---|---|
private |
EngineManager(RemoteService service,
BaseEngine.IEngineEventCallback uiCallback)
Engine Manager Constructor |
Method Summary | |
---|---|
private void |
addEngine(BaseEngine newEngine)
Add a new engine to the EngineManager. |
private void |
closeEngine(BaseEngine engine)
Closes an engine and removes it from the list. |
private void |
createActivitiesEngine()
Create instance of ActivitiesEngine. |
private void |
createContactSyncEngine()
|
private void |
createContentEngine()
Create instance of ContentEngine. |
static void |
createEngineManager(RemoteService service,
BaseEngine.IEngineEventCallback uiCallback)
Create instance of EngineManager. |
private void |
createGroupsEngine()
|
private void |
createIdentityEngine()
Create instance of IdentityEngine. |
private void |
createLoginEngine()
Create instance of LoginEngine. |
private void |
createPresenceEngine()
Create instance of PresenceEngine. |
private void |
createSyncMeEngine()
Create instance of ActivitiesEngine. |
private void |
createUpgradeEngine()
Create instance of UpgradeEngine. |
static void |
destroyEngineManager()
Destroy EngineManager. |
ActivitiesEngine |
getActivitiesEngine()
Fetch activities engine, starting it if necessary. |
ContactSyncEngine |
getContactSyncEngine()
Fetch contact sync engine, starting it if necessary. |
ContentEngine |
getContentEngine()
Fetch content engine, starting it if necessary. |
GroupsEngine |
getGroupsEngine()
Fetch contact sync engine, starting it if necessary. |
private static java.lang.String |
getHumanReadableTime(long absoluteTime,
long currentTime)
Display the Absolute Time in a human readable format (for testing only). |
IdentityEngine |
getIdentityEngine()
Fetch identity engine, starting it if necessary. |
static EngineManager |
getInstance()
Get single instance of EngineManager . |
LoginEngine |
getLoginEngine()
Fetch login engine, starting it if necessary. |
PresenceEngine |
getPresenceEngine()
Fetch presence engine, starting it if necessary. |
SyncMeEngine |
getSyncMeEngine()
Fetch activities engine, starting it if necessary. |
UpgradeEngine |
getUpgradeEngine()
Fetch upgrade engine, starting it if necessary. |
void |
onCommsInMessage(EngineManager.EngineId source)
Respond to incoming message received from Comms layer. |
private void |
onCreate()
Called immediately after manager has been created. |
private void |
onDestroy()
Called just before the service is stopped. |
void |
resetAllEngines()
Resets all the engines. |
long |
runEngines()
Run any waiting engines and return the time in milliseconds from now when this method needs to be called again. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static EngineManager sEngineManager
EngineManager
is a singleton, so this is the static reference
private final java.util.HashMap<java.lang.Integer,BaseEngine> mEngineList
private RemoteService mService
WorkerThread
.
private BaseEngine.IEngineEventCallback mUiEventCallback
BaseEngine.IEngineEventCallback
interface.
Implements several useful methods for engines such as UI request
complete.
private LoginEngine mLoginEngine
LoginEngine
private UpgradeEngine mUpgradeEngine
UpgradeEngine
private ActivitiesEngine mActivitiesEngine
ActivitiesEngine
private SyncMeEngine mSyncMeEngine
SyncMeEngine
private PresenceEngine mPresenceEngine
PresenceEngine
private IdentityEngine mIdentityEngine
IdentityEngine
private ContactSyncEngine mContactSyncEngine
ContactSyncEngine
private GroupsEngine mGroupsEngine
GroupsEngine
private ContentEngine mContentEngine
ContentEngine
private static final long ENGINE_RUN_TIME_THRESHOLD
Constructor Detail |
---|
private EngineManager(RemoteService service, BaseEngine.IEngineEventCallback uiCallback)
service
- RemoteService
referenceuiCallback
- Provides useful engine callback functionality.Method Detail |
---|
public static void createEngineManager(RemoteService service, BaseEngine.IEngineEventCallback uiCallback)
service
- RemoteService
referenceuiCallback
- Provides useful engine callback functionality.public static void destroyEngineManager()
public static EngineManager getInstance()
EngineManager
.
EngineManager
singleton instance.private void addEngine(BaseEngine newEngine)
newEngine
- Engine to be added.private void closeEngine(BaseEngine engine)
engine
- Reference of engine by base class BaseEngine
to
closeprivate void onCreate()
private void onDestroy()
public LoginEngine getLoginEngine()
private void createLoginEngine()
public UpgradeEngine getUpgradeEngine()
private void createUpgradeEngine()
public ActivitiesEngine getActivitiesEngine()
private void createActivitiesEngine()
public SyncMeEngine getSyncMeEngine()
private void createSyncMeEngine()
public PresenceEngine getPresenceEngine()
public IdentityEngine getIdentityEngine()
public ContentEngine getContentEngine()
public ContactSyncEngine getContactSyncEngine()
private void createContactSyncEngine()
public GroupsEngine getGroupsEngine()
private void createGroupsEngine()
private void createIdentityEngine()
private void createContentEngine()
private void createPresenceEngine()
public void onCommsInMessage(EngineManager.EngineId source)
EngineManager
will try to get the next response.
source
- EngineId associated with incoming message.public long runEngines()
private static java.lang.String getHumanReadableTime(long absoluteTime, long currentTime)
absoluteTime
- Time to convertcurrentTime
- Current time, for creating all relative times
public void resetAllEngines()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc