org.iso.mpeg.mpegj.resource
Class CapabilityManager

java.lang.Object
  |
  +--org.iso.mpeg.mpegj.resource.CapabilityManager

public class CapabilityManager
extends java.lang.Object
implements DynamicCapability, StaticCapability, DynamicCapabilityObserver, TerminalProfileManager

[Adaptive Audio-Visual Session Format ISO/IEC JTC1/SC29/WG11 - MPEG97/2566]

A CapabilityManager monitors latency and bandwidth of network connections and manages peripheral devices.

Functionality:

  1. Interacts with DMIF.
  2. Interacts with presentation devices.
  3. Throws profile exceptions.
  4. Interacts with input devices.
  5. Throws MPEG4Events.

The CapabilityManager class handles capability through the CapabilityManager. The CapabilityManager offers a simple and generic way to handle capabilities. The CapabilityManager implements some interfaces in order to simplify developers work when basic capabilities need to be managed. [An interface incapsulates a coherent set of services and attributes, i.e. a Role, without exlicitly binding this function to that of any particular object or code].
The interfaces are:

  1. DynamicCapability
    This interface is used to provide developers a simple way to access basic dynamic terminal capabilities. A capability is dynamic if it can change value/status at runtime. For instance memory usage is a dynamic capability.

  2. StaticCapability
    This interface is used to provide developers a simple way to access basic dynamic terminal capabilities. A capability is considered static if its value/static cannot change at runtime. For instance the audio card type is a static capability.

  3. CapabilityObserver
    This interface is used to provide developers a few methods that allow them to simply monitor the value of common capabilities such as memory and resource usage.


Fields inherited from interface org.iso.mpeg.mpegj.resource.TerminalProfileManager
AudioProfile_Main, AudioProfile_Scalable, AudioProfile_Speech, AudioProfile_Synthesis, Profile_Audio, Profile_Complete, Profile_Complete2D, Profile_Simple2D, VisualProfile_BasicAnimatedTexture, VisualProfile_Core, VisualProfile_Hybrid, VisualProfile_Main, VisualProfile_Nbit, VisualProfile_ScaleableTexture, VisualProfile_Simple, VisualProfile_SimpleFA, VisualProfile_SimpleScalable
 
Constructor Summary
CapabilityManager()
           
 
Method Summary
 void deleteObserver(java.util.Observer objToDeregister)
          deleteObserver
 java.lang.String[] getAudioDrivers()
          Terminal Audio Enc/Dec
 short getAudioProfile()
          This method returns the supported audio profile
 int getCPUSpeed(int cpuIdx)
          Terminal CPU Speed
 java.lang.String getCPUType(int cpuIdx)
          Terminal CPU type (Pentium for instance)
 int getDisplayColorDepth()
          Terminal Display Color Depth
 java.lang.String getDisplayType()
          Terminal Display Type (e.g.
 long getFreeApplicationMemory()
          Free application memory (RAM)
 long getFreeTerminalMemory()
          Terminal free memory (RAM)
 java.lang.String getKeyboardType()
          Terminal Keyboard Type
 java.lang.String[] getMIDIDrivers()
          Terminal MIDI Enc/Dec
 java.lang.String getModemType()
          Terminal modem type
 java.lang.String getMouseType()
          Terminal Mouse Type
 long getNetworkLoad()
          Terminal Network Load
 java.lang.String getNetworkType()
          Terminal Network Type
 int getNumCPUs()
          Number of Terminal CPUs
 int getNumParallelPorts()
          Terminal parallel IEEE-1284 port(s)
 int getNumSerialPorts()
          Terminal serial RS-232 port(s)
 java.lang.String getOSLanguage()
          Terminal OS language
 java.lang.String getOSType()
          Terminal OS type (for instance JavaPC, Windows, MacOS)
 short getSceneDescriptionProfile()
          Scene Description Profile
 short getScreenDepth()
          Terminal screen depth
 short getScreenResolution()
          Terminal screen resolution
 java.awt.Dimension getScreenSize()
          Terminal screen size
 java.lang.String getTerminalArchitecture()
          Terminal architecture (for instance Alpha, x86)
 long getTerminalLoad()
          Terminal CPU Load
 long getTotalApplicationMemory()
          Total application memory (RAM)
 long getTotalTerminalMemory()
          Terminal total memory (RAM)
 java.lang.String[] getVideoDrivers()
          Terminal Video Enc/Dec
 short getVisualProfile()
          This method returns the supported visual profile
 void notifyApplicationFreeMemory(long freeApplicationMemory, java.util.Observer objToNotify)
          notifyApplicationFreeMemory
 void notifyTerminalFreeMemory(long freeTerminalMemory, java.util.Observer objToNotify)
          notifyTerminalFreeMemory
 void notifyTerminalLoad(long cpuLoadPercentage, java.util.Observer objToNotify)
          notifyTerminalLoad
 void notifyTerminalNetworkLoad(long nwLoadPercentage, java.util.Observer objToNotify)
          notifyTerminalNetworkLoad
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapabilityManager

public CapabilityManager()
Method Detail

notifyApplicationFreeMemory

public void notifyApplicationFreeMemory(long freeApplicationMemory,
                                        java.util.Observer objToNotify)
                                 throws java.lang.IllegalArgumentException
notifyApplicationFreeMemory
Specified by:
notifyApplicationFreeMemory in interface DynamicCapabilityObserver
Parameters:
freeApplicationMemory - application memory threshold
objToNotify - object to notify when the specified threshold is exceeded
Throws:
java.lang.IllegalArgumentException - the freeApplicationMemory is either negative or out of range.

notifyTerminalFreeMemory

public void notifyTerminalFreeMemory(long freeTerminalMemory,
                                     java.util.Observer objToNotify)
                              throws java.lang.IllegalArgumentException
notifyTerminalFreeMemory
Specified by:
notifyTerminalFreeMemory in interface DynamicCapabilityObserver
Parameters:
freeTerminalMemory - terminal memory threshold
objToNotify - object to notify when the specified threshold is exceeded
Throws:
java.lang.IllegalArgumentException - the freeTerminalMemory is either negative or out of range.

notifyTerminalLoad

public void notifyTerminalLoad(long cpuLoadPercentage,
                               java.util.Observer objToNotify)
                        throws java.lang.IllegalArgumentException
notifyTerminalLoad
Specified by:
notifyTerminalLoad in interface DynamicCapabilityObserver
Parameters:
cpuLoadPercentage - terminal CPU load percentage threshold
objToNotify - object to notify when the specified threshold is exceeded
Throws:
java.lang.IllegalArgumentException - the cpuLoadPercentage is either negative or out of range.

notifyTerminalNetworkLoad

public void notifyTerminalNetworkLoad(long nwLoadPercentage,
                                      java.util.Observer objToNotify)
                               throws java.lang.IllegalArgumentException
notifyTerminalNetworkLoad
Specified by:
notifyTerminalNetworkLoad in interface DynamicCapabilityObserver
Parameters:
nwLoadPercentage - network load percentage threshold
objToNotify - object to notify when the specified threshold is exceeded
Throws:
java.lang.IllegalArgumentException - the nwLoadPercentage is either negative or out of range.

deleteObserver

public void deleteObserver(java.util.Observer objToDeregister)
deleteObserver
Specified by:
deleteObserver in interface DynamicCapabilityObserver
Parameters:
objToDeregister - observer object previously registered using registerXXX methods

getNumCPUs

public int getNumCPUs()
Number of Terminal CPUs
Specified by:
getNumCPUs in interface StaticCapability
Returns:
the number of CPUs that equip the terminal or -1 is an error occurs

getCPUSpeed

public int getCPUSpeed(int cpuIdx)
Terminal CPU Speed
Specified by:
getCPUSpeed in interface StaticCapability
Returns:
the speed of the 'idx' CPU or -1 is an error occurs

getCPUType

public java.lang.String getCPUType(int cpuIdx)
                            throws java.lang.IllegalArgumentException
Terminal CPU type (Pentium for instance)
Specified by:
getCPUType in interface StaticCapability
Parameters:
idx - the index of the CPU (idx >= 0)
Returns:
the type of CPU
Throws:
java.lang.IllegalArgumentException - the index is either negative or out of range.

getMouseType

public java.lang.String getMouseType()
Terminal Mouse Type
Specified by:
getMouseType in interface StaticCapability
Returns:
the mouse type or null if an error occurred

getDisplayColorDepth

public int getDisplayColorDepth()
Terminal Display Color Depth
Specified by:
getDisplayColorDepth in interface StaticCapability
Returns:
the display color depth (bits per pixel)

getDisplayType

public java.lang.String getDisplayType()
Terminal Display Type (e.g. VGA)
Specified by:
getDisplayType in interface StaticCapability
Returns:
the display type

getKeyboardType

public java.lang.String getKeyboardType()
Terminal Keyboard Type
Specified by:
getKeyboardType in interface StaticCapability
Returns:
the keyboard type, NULL if the keyboard is not present.

getNetworkType

public java.lang.String getNetworkType()
Terminal Network Type
Specified by:
getNetworkType in interface StaticCapability
Returns:
the network type or null if an error occurred.

getNumParallelPorts

public int getNumParallelPorts()
Terminal parallel IEEE-1284 port(s)
Specified by:
getNumParallelPorts in interface StaticCapability
Returns:
the number of parallel ports present on the terminal.

getNumSerialPorts

public int getNumSerialPorts()
Terminal serial RS-232 port(s)
Specified by:
getNumSerialPorts in interface StaticCapability
Returns:
the number of serial ports present on the terminal.

getScreenSize

public java.awt.Dimension getScreenSize()
Terminal screen size
Specified by:
getScreenSize in interface StaticCapability
Returns:
the screen size (pixel x pixel)

getScreenDepth

public short getScreenDepth()
Terminal screen depth
Specified by:
getScreenDepth in interface StaticCapability
Returns:
the screen depth (bits/inch)

getScreenResolution

public short getScreenResolution()
Terminal screen resolution
Specified by:
getScreenResolution in interface StaticCapability
Returns:
the screen resolution (dots/inch)

getOSLanguage

public java.lang.String getOSLanguage()
Terminal OS language
Specified by:
getOSLanguage in interface StaticCapability
Returns:
the language of the OS version installed on the terminal.

getOSType

public java.lang.String getOSType()
Terminal OS type (for instance JavaPC, Windows, MacOS)
Specified by:
getOSType in interface StaticCapability
Returns:
the OS type installed on the terminal.

getTerminalArchitecture

public java.lang.String getTerminalArchitecture()
Terminal architecture (for instance Alpha, x86)
Specified by:
getTerminalArchitecture in interface StaticCapability
Returns:
the terminal architecture type.

getAudioDrivers

public java.lang.String[] getAudioDrivers()
Terminal Audio Enc/Dec
Specified by:
getAudioDrivers in interface StaticCapability
Returns:
the available audio drivers.

getMIDIDrivers

public java.lang.String[] getMIDIDrivers()
Terminal MIDI Enc/Dec
Specified by:
getMIDIDrivers in interface StaticCapability
Returns:
the available MIDI drivers.

getVideoDrivers

public java.lang.String[] getVideoDrivers()
Terminal Video Enc/Dec
Specified by:
getVideoDrivers in interface StaticCapability
Returns:
the available video drivers.

getModemType

public java.lang.String getModemType()
Terminal modem type
Specified by:
getModemType in interface StaticCapability
Returns:
the modem speed ("28K", "56K" etc.) or "" is the modem is not installed.

getFreeTerminalMemory

public long getFreeTerminalMemory()
Terminal free memory (RAM)
Specified by:
getFreeTerminalMemory in interface DynamicCapability
Returns:
the amount of free memory (bytes) installed on the terminal.

getTotalTerminalMemory

public long getTotalTerminalMemory()
Terminal total memory (RAM)
Specified by:
getTotalTerminalMemory in interface DynamicCapability
Returns:
the total amount of memory (bytes) installed on the terminal.

getTotalApplicationMemory

public long getTotalApplicationMemory()
Total application memory (RAM)
Specified by:
getTotalApplicationMemory in interface DynamicCapability
Returns:
the total amount of memory (bytes).

getFreeApplicationMemory

public long getFreeApplicationMemory()
Free application memory (RAM)
Specified by:
getFreeApplicationMemory in interface DynamicCapability
Returns:
the amount of available (at application level e.g. JavaVM) free memory (bytes).

getTerminalLoad

public long getTerminalLoad()
Terminal CPU Load
Specified by:
getTerminalLoad in interface DynamicCapability
Returns:
the load (percentage) of the terminal CPUs

getNetworkLoad

public long getNetworkLoad()
Terminal Network Load
Specified by:
getNetworkLoad in interface DynamicCapability
Returns:
the network load (percentage).

getSceneDescriptionProfile

public short getSceneDescriptionProfile()
Scene Description Profile
Specified by:
getSceneDescriptionProfile in interface TerminalProfileManager
Returns:
the actual scene description profile.

getVisualProfile

public short getVisualProfile()
Description copied from interface: TerminalProfileManager
This method returns the supported visual profile
Specified by:
getVisualProfile in interface TerminalProfileManager
Tags copied from interface: TerminalProfileManager
Returns:
the supported visual profile.

getAudioProfile

public short getAudioProfile()
Description copied from interface: TerminalProfileManager
This method returns the supported audio profile
Specified by:
getAudioProfile in interface TerminalProfileManager
Tags copied from interface: TerminalProfileManager
Returns:
the audio description profile.