|
Mobile Tools for Java Release 1.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDeviceRegistry
The device registry is the main entry point that is used to manage the devices that are currently supported on a MTJ installation.
When a SDK is imported it will return a list of devices that will be added to the registry in order to have them available to MTJ clients.
Clients may access the IDeviceRegistry implementation through the
MTJCore.getDeviceRegistry()
method.
IDevice
,
IPreverifier
Field Summary |
---|
Fields inherited from interface org.eclipse.mtj.core.persistence.IPersistable |
---|
CLASS_PERSISTABLE_ATTRIBUTE, ID_PERSISTABLE_ATTRIBUTE, KEY_PERSISTABLE_ATTRIBUTE, PROPERTY_PERSISTABLE_ELEMENT, REFID_PERSISTABLE_ATTRIBUTE, VALUE_PERSISTABLE_ATTRIBUTE |
Method Summary | |
---|---|
void |
addDevice(IDevice device)
Add a new device instance to the device registry. |
void |
addRegistryListener(IDeviceRegistryListener listener)
Adds the listener to the collection of listeners who will be notified when the registry state changes. |
void |
clear()
Clear the registry of all entries. |
void |
enableDeviceAddedEvent(boolean fire)
Enable the DeviceAdded Event to be fired to all IDeviceRegistryListener instances registered using
addRegistryListener(IDeviceRegistryListener) when the
addDevice(IDevice) is invoked. |
List<IDevice> |
getAllDevices()
Return the list of all of the devices in the registry. |
IDevice |
getDefaultDevice()
Return the device set as the default. |
IPreverifier |
getDefaultPreferifier()
Return the default preverifier to be used if no preverifier was available in a given device. |
IDevice |
getDevice(String sdkName,
String deviceName)
Return the device from a given SDK with the specified name. |
int |
getDeviceCount()
Return the number of the registered devices. |
List<IDevice> |
getDevices(String sdkName)
Return the list of devices associated to the given SDK name. |
List<String> |
getSDKNames()
Return the list of identifiers of all registered SDKs. |
boolean |
isDeviceAddedEventEnabled()
Checks if the DeviceAdded Event will be fired to all IDeviceRegistryListener instances registered using
addRegistryListener(IDeviceRegistryListener) or not when
invoking addDevice(IDevice) . |
void |
load()
Load the contents of the device registry from the storage file in the plug-in state location. |
void |
removeDevice(IDevice device)
Remove the specified device from the registry if it exists. |
void |
removeRegistryListener(IDeviceRegistryListener listener)
Removes the listener from the collection of listeners who will be notified when the registry state changes. |
void |
setDefaultDevice(IDevice device)
Set the default device. |
void |
setDefaultPreverifer(IPreverifier preverifier)
Set the default preverifier. |
void |
store()
Store out the contents of the registry into the standard device storage file in the plug-in state location. |
Methods inherited from interface org.eclipse.mtj.core.persistence.IPersistable |
---|
loadUsing, storeUsing |
Method Detail |
---|
void addDevice(IDevice device) throws IllegalArgumentException, PersistenceException
device
- the device instance to be added to the device registry.
IllegalArgumentException
- if the device is not well formed.
PersistenceException
- if there is a problem doing the initial
registry load.void addRegistryListener(IDeviceRegistryListener listener)
IDeviceRegistryListener
interface.
listener
- the listener that should be notified when the registry
state changes.void clear() throws PersistenceException
PersistenceException
- if there is a problem doing the initial
registry loadvoid enableDeviceAddedEvent(boolean fire)
IDeviceRegistryListener
instances registered using
addRegistryListener(IDeviceRegistryListener)
when the
addDevice(IDevice)
is invoked.
By default, this event is enabled. Use the
isDeviceAddedEventEnabled()
to get current event firing status.
fire
- flag indicating if the DeviceAdded Event should be fired or
not.List<IDevice> getAllDevices() throws PersistenceException
PersistenceException
- if there is a problem doing the initial
registry loadIDevice getDefaultDevice()
null
if none was
not specified.IPreverifier getDefaultPreferifier()
null
if none was
specified.IDevice getDevice(String sdkName, String deviceName) throws PersistenceException
sdkName
- the SDK name.deviceName
- the device name.
null
if no such device is found in the registry.
PersistenceException
- if there is a problem doing the initial
registry load.int getDeviceCount() throws PersistenceException
PersistenceException
- if there is a problem doing the initial
registry load.List<String> getSDKNames() throws PersistenceException
PersistenceException
- if there is a problem doing the initial
registry load.List<IDevice> getDevices(String sdkName) throws PersistenceException
sdkName
- the SDK name.
null
if the specified group cannot be found.
PersistenceException
- if there is a problem doing the initial
registry load.boolean isDeviceAddedEventEnabled()
IDeviceRegistryListener
instances registered using
addRegistryListener(IDeviceRegistryListener)
or not when
invoking addDevice(IDevice)
.
true
is DeviceAdded Event will be fired when
addDevice(IDevice)
is invoked, false
otherwise.void load() throws PersistenceException
PersistenceException
- if there is a problem doing the initial
registry load.void removeDevice(IDevice device) throws PersistenceException
device
- the device to be removed from the registry.
PersistenceException
- if there is a problem doing the initial
registry loadvoid removeRegistryListener(IDeviceRegistryListener listener)
listener
- the listener that should no longer be notified when the
registry state changes.void setDefaultDevice(IDevice device)
device
- the device to be set as default.void setDefaultPreverifer(IPreverifier preverifier)
preverifier
- the default preverifier.void store() throws PersistenceException, TransformerException, IOException
PersistenceException
- if any error occur while saving the
persistable information.
TransformerException
- if any error occur while saving the
persistable information.
IOException
- if any error occur while saving the persistable
information.
|
Mobile Tools for Java Release 1.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |