|
Mobile Tools for Java Release 1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.mtj.core.model.device.DeviceRegistry
public class DeviceRegistry
The device registry provides a place to store and retrieve devices by name.
This registry is implemented as a multi-level registry in which the top-level device groups reference lower-level devices.
| Field Summary | |
|---|---|
static DeviceRegistry |
singleton
Singleton instance of the device registry |
| Method Summary | |
|---|---|
void |
addDevice(IDevice device,
boolean fireDeviceAddedEvent)
Add a new device instance to the device registry. |
void |
addRegistryListener(IDeviceRegistryListener listener)
Add the specified listener to the list of listeners for changes in this registry. |
void |
clear()
Clear the registry of all entries. |
List<IDevice> |
getAllDevices()
Return a list of all of the devices in the registry. |
IDevice |
getDefaultDevice()
Return the default device or null if one is not specified. |
IPreverifier |
getDefaultPreferifier()
Return the default preverifier or null if one is not
specified. |
IDevice |
getDevice(String groupName,
String deviceName)
Return the device with the specified key or null if no such
device is found in the registry. |
int |
getDeviceCount()
Return the number of devices registered. |
List<String> |
getDeviceGroups()
Return the registered device groups. |
List<IDevice> |
getDevices(String groupName)
Return the devices found in the specified group or null if
the specified group cannot be found. |
void |
load()
Load the contents of the device registry from the storage file in the plug-in state location. |
void |
loadUsing(IPersistenceProvider persistenceProvider)
Load the state of this object using the specified persistence state information. |
void |
removeDevice(IDevice device)
Remove the specified device from the registry if it exists. |
void |
removeRegistryListener(IDeviceRegistryListener listener)
Remove the specified listener to the list of listeners for changes in this registry. |
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. |
void |
storeUsing(IPersistenceProvider persistenceProvider)
Save the state of this object using the specified persistence state information. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final DeviceRegistry singleton
| Method Detail |
|---|
public void addDevice(IDevice device,
boolean fireDeviceAddedEvent)
throws IllegalArgumentException,
PersistenceException
device - fireDeviceAddedEvent - TODO
IllegalArgumentException - if the device is not well formed.
PersistenceException - if there is a problem doing the initial registry loadpublic void addRegistryListener(IDeviceRegistryListener listener)
listener -
public void clear()
throws PersistenceException
PersistenceException - if there is a problem doing the initial registry load
public List<IDevice> getAllDevices()
throws PersistenceException
PersistenceException - if there is a problem doing the initial registry loadpublic IDevice getDefaultDevice()
null if one is not specified.
public IDevice getDevice(String groupName,
String deviceName)
throws PersistenceException
null if no such
device is found in the registry.
groupName - deviceName -
PersistenceException - if there is a problem doing the initial registry load
public int getDeviceCount()
throws PersistenceException
PersistenceException - if there is a problem doing the initial registry load
public List<String> getDeviceGroups()
throws PersistenceException
PersistenceException - if there is a problem doing the initial registry load
public List<IDevice> getDevices(String groupName)
throws PersistenceException
null if
the specified group cannot be found.
groupName -
PersistenceException
public void load()
throws PersistenceException
PersistenceException
public void loadUsing(IPersistenceProvider persistenceProvider)
throws PersistenceException
IPersistable
loadUsing in interface IPersistablePersistenceExceptionIPersistable.loadUsing(org.eclipse.mtj.core.persistence.IPersistenceProvider)
public void removeDevice(IDevice device)
throws PersistenceException
device -
PersistenceException - if there is a problem doing the initial registry loadpublic void removeRegistryListener(IDeviceRegistryListener listener)
listener - public void setDefaultDevice(IDevice device)
device -
public void store()
throws PersistenceException,
TransformerException,
IOException
PersistenceException
TransformerException
IOException
public void storeUsing(IPersistenceProvider persistenceProvider)
throws PersistenceException
IPersistable
storeUsing in interface IPersistablePersistenceExceptionIPersistable.storeUsing(org.eclipse.mtj.core.persistence.IPersistenceProvider)public void setDefaultPreverifer(IPreverifier preverifier)
device - public IPreverifier getDefaultPreferifier()
null if one is not
specified.
|
Mobile Tools for Java Release 1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||