|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.maemo.mica.common.core.sdk.SDKManager
public class SDKManager
The SDK manager manages the SDKs and targets known to Mica through the org.maemo.mica.common.core.sdk_provider extension point.
The providers are queried lazily when the first client asks for ISDK
or
ISDKTarget
instances through this manager. The first access to the
manager will yield empty content and spawn a refreshing job. Usually,
ISDK and ISDKTarget instances based on BaseSDK
and BaseSDKTarget
will use caching so that the initial refreshing job in a new Eclipse instance
will be fast.
Clients using this interface should use waitForRefreshComplete(IProgressMonitor)
if they want to ensure that a successive call to fetch SDKs or targets will be
up-to-date.
ISDKProvider
Field Summary | |
---|---|
static java.lang.String |
SDK_CLASS
|
Constructor Summary | |
---|---|
SDKManager()
|
Method Summary | ||
---|---|---|
void |
addListener(ISDKFactoryListener listener)
Add a listener to respond to changes to the SDKs |
|
void |
cancelRefresh()
Cancel any ongoing refresh job. |
|
ISDKTarget |
findSDKTarget(java.lang.String sdkName,
java.lang.String sdkTargetName,
java.lang.String sdkDisplayName)
Find the ISDKTarget with the given SDK name, display name, and target name. |
|
void |
fireListeners()
Force listeners to be fired. |
|
ISDK[] |
getAllSDKs()
Get an array of all the SDKs known to the IDE |
|
ISDKTarget[] |
getAllSDKTargets()
Get an array of all the SDK targets known to the IDE |
|
static ISDKManager |
getInstance()
Get the singleton instance of the SDKFactory. |
|
java.util.List<ISDKProvider> |
getSDKProviders()
Get access to the SDK provider list. |
|
java.util.List<ISDK> |
getSDKs()
|
|
|
getSDKsOfType(java.lang.Class<T> klass)
Get a list of the currently available SDKs which implement or extend the given class. |
|
|
getSDKTargetsOfType(java.lang.Class<T> klass)
Get a list of the currently available SDK targets which implement or extend the given class. |
|
boolean |
hasScannedYet()
Tell if the factory has scanned any of its SDKs yet (until then, any polling of SDKs/targets will fail). |
|
boolean |
isRefreshing()
Tell if the SDK factory is refreshing. |
|
void |
lock()
Lock the factory so it will not refresh in the meantime. |
|
void |
refresh(boolean force)
Refresh the SDKs by re-querying all the SDK providers. |
|
void |
refresh(IProgressMonitor monitor)
Refresh the SDKs by re-querying all the SDK providers, reading from cache if possible. |
|
void |
refreshFull(IProgressMonitor monitor)
Refresh the SDKs by re-querying all the SDK providers, not using a cache. |
|
void |
removeListener(ISDKFactoryListener listener)
Remove a listener to respond to changes to the SDKs |
|
void |
setSDKs(java.util.List<ISDK> sdks)
Set the array of SDKs |
|
protected org.maemo.mica.internal.api.common.core.sdk.RefreshSDKManagerJob |
spawnRefreshJob(boolean force)
Create and schedule a refreshing job. |
|
void |
unlock()
Unlock a previous lock() call. |
|
void |
waitForRefreshComplete(IProgressMonitor monitor)
Wait for the SDK factory to be initialized. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String SDK_CLASS
Constructor Detail |
---|
public SDKManager()
Method Detail |
---|
public static ISDKManager getInstance()
public java.util.List<ISDKProvider> getSDKProviders()
public java.util.List<ISDK> getSDKs()
public boolean isRefreshing()
public void waitForRefreshComplete(IProgressMonitor monitor)
ISDKManager
waitForRefreshComplete
in interface ISDKManager
monitor
- optional progress monitorpublic void refresh(boolean force)
force
- true throw away any cached statepublic void refreshFull(IProgressMonitor monitor)
monitor
- unused!public void refresh(IProgressMonitor monitor)
monitor
- unused!protected org.maemo.mica.internal.api.common.core.sdk.RefreshSDKManagerJob spawnRefreshJob(boolean force)
public void fireListeners()
ISDKManager
fireListeners
in interface ISDKManager
public ISDK[] getAllSDKs()
ISDKManager
getAllSDKs
in interface ISDKManager
null
public ISDKTarget[] getAllSDKTargets()
ISDKManager
getAllSDKTargets
in interface ISDKManager
public void addListener(ISDKFactoryListener listener)
ISDKManager
addListener
in interface ISDKManager
public void removeListener(ISDKFactoryListener listener)
ISDKManager
removeListener
in interface ISDKManager
public void setSDKs(java.util.List<ISDK> sdks)
public <T extends ISDK> java.util.List<T> getSDKsOfType(java.lang.Class<T> klass)
ISDKManager
getSDKsOfType
in interface ISDKManager
klass
- a class each SDK must implement or extend
null
public <T extends ISDKTarget> java.util.List<T> getSDKTargetsOfType(java.lang.Class<T> klass)
ISDKManager
getSDKTargetsOfType
in interface ISDKManager
klass
- a class each SDK target implement or extend
null
public void cancelRefresh()
public void lock()
Any refreshes (automatically or manually triggered) will be queued.
This must be unlock()
ed once for each lock().
public void unlock()
lock()
call. Once the matching
number of unlocks have been executed, the factory will refresh
if there were any refresh requests in the meantime.
public ISDKTarget findSDKTarget(java.lang.String sdkName, java.lang.String sdkTargetName, java.lang.String sdkDisplayName)
ISDKManager
findSDKTarget
in interface ISDKManager
sdkDisplayName
- name, or null
if unknown
ISDKTarget
or null
public boolean hasScannedYet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |