Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Mobile Tools for Java
Release 1.0

org.eclipse.mtj.core.sdk.device
Interface IDeviceRegistry

All Superinterfaces:
IPersistable

public interface IDeviceRegistry
extends IPersistable

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.

Since:
1.0
See Also:
IDevice, IPreverifier
Restriction:
This interface is not intended to be implemented by clients.

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

addDevice

void addDevice(
IDevice device)
               throws 
IllegalArgumentException,
                      
PersistenceException
Add a new device instance to the device registry.

Parameters:
device - the device instance to be added to the device registry.
Throws:
IllegalArgumentException - if the device is not well formed.
PersistenceException - if there is a problem doing the initial registry load.

addRegistryListener

void addRegistryListener(
IDeviceRegistryListener listener)
Adds the listener to the collection of listeners who will be notified when the registry state changes. The listener is notified by invoking one of methods defined in the IDeviceRegistryListener interface.

Parameters:
listener - the listener that should be notified when the registry state changes.

clear

void clear()
           throws 
PersistenceException
Clear the registry of all entries.

Throws:
PersistenceException - if there is a problem doing the initial registry load

enableDeviceAddedEvent

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.

By default, this event is enabled. Use the isDeviceAddedEventEnabled() to get current event firing status.

Parameters:
fire - flag indicating if the DeviceAdded Event should be fired or not.

getAllDevices

List<
IDevice> getAllDevices()
                            throws 
PersistenceException
Return the list of all of the devices in the registry.

Returns:
the list of all of the devices in the registry or an empty list if no device is registered.
Throws:
PersistenceException - if there is a problem doing the initial registry load

getDefaultDevice

IDevice getDefaultDevice()
Return the device set as the default.

Returns:
the device set as the default or null if none was not specified.

getDefaultPreferifier

IPreverifier getDefaultPreferifier()
Return the default preverifier to be used if no preverifier was available in a given device.

Returns:
the default preverifier or null if none was specified.

getDevice

IDevice getDevice(
String sdkName,
                  
String deviceName)
                  throws 
PersistenceException
Return the device from a given SDK with the specified name.

Parameters:
sdkName - the SDK name.
deviceName - the device name.
Returns:
the device from a given SDK with the specified name or null if no such device is found in the registry.
Throws:
PersistenceException - if there is a problem doing the initial registry load.

getDeviceCount

int getDeviceCount()
                   throws 
PersistenceException
Return the number of the registered devices.

Returns:
the number of the registered devices.
Throws:
PersistenceException - if there is a problem doing the initial registry load.

getSDKNames

List<
String> getSDKNames()
                         throws 
PersistenceException
Return the list of identifiers of all registered SDKs.

Returns:
the list of identifiers of all registered SDKs.
Throws:
PersistenceException - if there is a problem doing the initial registry load.

getDevices

List<
IDevice> getDevices(
String sdkName)
                         throws 
PersistenceException
Return the list of devices associated to the given SDK name.

Parameters:
sdkName - the SDK name.
Returns:
the list of devices associated to the given SDK name or null if the specified group cannot be found.
Throws:
PersistenceException - if there is a problem doing the initial registry load.

isDeviceAddedEventEnabled

boolean isDeviceAddedEventEnabled()
Checks if the DeviceAdded Event will be fired to all IDeviceRegistryListener instances registered using addRegistryListener(IDeviceRegistryListener) or not when invoking addDevice(IDevice).

Returns:
true is DeviceAdded Event will be fired when addDevice(IDevice) is invoked, false otherwise.

load

void load()
          throws 
PersistenceException
Load the contents of the device registry from the storage file in the plug-in state location.

Throws:
PersistenceException - if there is a problem doing the initial registry load.

removeDevice

void removeDevice(
IDevice device)
                  throws 
PersistenceException
Remove the specified device from the registry if it exists.

Parameters:
device - the device to be removed from the registry.
Throws:
PersistenceException - if there is a problem doing the initial registry load

removeRegistryListener

void removeRegistryListener(
IDeviceRegistryListener listener)
Removes the listener from the collection of listeners who will be notified when the registry state changes.

Parameters:
listener - the listener that should no longer be notified when the registry state changes.

setDefaultDevice

void setDefaultDevice(
IDevice device)
Set the default device.

Parameters:
device - the device to be set as default.

setDefaultPreverifer

void setDefaultPreverifer(
IPreverifier preverifier)
Set the default preverifier.

Parameters:
preverifier - the default preverifier.

store

void store()
           throws 
PersistenceException,
                  
TransformerException,
                  
IOException
Store out the contents of the registry into the standard device storage file in the plug-in state location.

Throws:
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


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire