ist.palcom.base
Class System

java.lang.Object
  extended by ist.palcom.base.System

public class System
extends java.lang.Object


Method Summary
 void addExceptionMapping(java.lang.String s, java.lang.Object o)
           
 void addLookupPath(java.lang.String path)
          Add a (file system) path where classes are looked up on calls to newInstance(String, Object[]).
 java.lang.Object createStackTrace()
          JVM creates its stack traces in a different way
 java.net.URL[] getClassPathURLs()
           
 java.lang.String getDeviceID()
          Return the deviceID for this device.
 java.lang.Object getExceptionPlaceholder()
           
 java.lang.Object getHmapRoot()
           
 java.lang.String getRootPath(java.lang.String deviceID, java.lang.String rootFolder)
          Return the PalCom root path including a rootFolder last
static java.util.ArrayList getUDPNetworkInterfaces()
          Get list with UDPNetworkInterfaces with IP and subnet masks in String format from all network interfaces.
static System instance()
           
 java.lang.Object newInstance(java.lang.String className, java.lang.Object[] params)
          Construct an object of a class, given by a class name, and return it.
 void removeLookupPath(java.lang.String path)
          Remove a path added by addLookupPath(String).
 int select(Channel[] channels, int numberOfChannels, int[] results, long timeout)
          Block for at most timeout milliseconds, or until data is available on at least one of the first numberOfChannels Channels in channels.
 int selectNow(Channel[] channels, int numberOfChannels, int[] results)
          Check if data is available on at least one of the first numberOfChannels Channels in channels, and return without blocking.
 void sleep(int milliseconds)
          Suspend entire service for the indicated duration.
 int time()
           
 void yield()
          Yield - this is a no-op in java
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static System instance()

sleep

public void sleep(int milliseconds)
Suspend entire service for the indicated duration.


time

public int time()

select

public int select(Channel[] channels,
                  int numberOfChannels,
                  int[] results,
                  long timeout)
Block for at most timeout milliseconds, or until data is available on at least one of the first numberOfChannels Channels in channels. A negative timeout will block indefinitely.

Parameters:
channels - The Channels.
numberOfChannels - The first numberOfChannels channels in channels are used.
results - The result for each channel is put into this array (in the same order). A positive value means that data is available.
timeout - The timeout.
Returns:
The number of channels, possibly zero, that are now ready to read from.

selectNow

public int selectNow(Channel[] channels,
                     int numberOfChannels,
                     int[] results)
Check if data is available on at least one of the first numberOfChannels Channels in channels, and return without blocking.

Parameters:
channels - The Channels.
numberOfChannels - The first numberOfChannels channels in channels are used.
results - The result for each channel is put into this array (in the same order). A positive value means that data is available.
Returns:
The number of channels, possibly zero, that are now ready to read from.

yield

public void yield()
Yield - this is a no-op in java


createStackTrace

public java.lang.Object createStackTrace()
JVM creates its stack traces in a different way


getHmapRoot

public java.lang.Object getHmapRoot()

getExceptionPlaceholder

public java.lang.Object getExceptionPlaceholder()

addExceptionMapping

public void addExceptionMapping(java.lang.String s,
                                java.lang.Object o)

newInstance

public java.lang.Object newInstance(java.lang.String className,
                                    java.lang.Object[] params)
                             throws java.lang.Exception
Construct an object of a class, given by a class name, and return it. It is platform dependent how classes are looked up. The lookup process can be configured through calls to addLookupPath(String) and removeLookupPath(String).

Parameters:
className - The class name
params - Parameters to the constructor
Returns:
The created object.
Throws:
java.lang.Exception - if the object cannot be created.

getClassPathURLs

public java.net.URL[] getClassPathURLs()

addLookupPath

public void addLookupPath(java.lang.String path)
Add a (file system) path where classes are looked up on calls to newInstance(String, Object[]). It is platform dependent how the search is performed at the path.

Parameters:
path - The path

removeLookupPath

public void removeLookupPath(java.lang.String path)
Remove a path added by addLookupPath(String).


getRootPath

public java.lang.String getRootPath(java.lang.String deviceID,
                                    java.lang.String rootFolder)
Return the PalCom root path including a rootFolder last


getDeviceID

public java.lang.String getDeviceID()
                             throws java.io.IOException
Return the deviceID for this device. It is stored in the PalCom file system root.

Throws:
java.io.IOException

getUDPNetworkInterfaces

public static java.util.ArrayList getUDPNetworkInterfaces()
Get list with UDPNetworkInterfaces with IP and subnet masks in String format from all network interfaces. Should work for Windows XP (Swedish, Finnish, Spanish, French and English), Mac OS X Tiger and Linux