Multivalent API

multivalent
Class Multivalent

java.lang.Object
  extended by multivalent.Multivalent

public final class Multivalent
extends java.lang.Object

Execute application startup, and act as a central repository for resources shared among all browser windows.

Specification and implementation versions are available from the Package.

Version:
$Revision: 1.20 $ $Date: 2005/10/10 02:15:28 $

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String FILENAME_PREFERENCES
           
static java.net.URI HOME_SITE
          URI of Multivalent home WWW site.
static java.lang.String MSG_EXIT
          Safely destroy browsers and all their documents, and Destroy .
static java.lang.String PREF_CACHEDIR
           
static java.lang.String VERSION
           
 
Method Summary
 java.util.Iterator<Browser> browsersIterator()
           
 Browser getBrowser(java.lang.String name)
          Convenience method for creating a standalone browser, as if getBrowser(name, "System", true).
 Browser getBrowser(java.lang.String name, java.lang.String systemHub, boolean standalone)
          Returns Browser with given name, with passed URL to system behaviors hub.
 com.pt.io.Cache getCache()
           
 java.lang.String getGenre(java.lang.String contenttype, java.lang.String path)
          Maps MIME Content-Type and path to Multivalent genre.
 java.util.Map<java.lang.String,java.lang.String> getGenreMap()
           
static Multivalent getInstance()
          Returns singleton instance, from which preferences and other state can be accessed.
static java.util.logging.Logger getLogger()
          Returns main logger (subsystems can use own logger).
 java.lang.String getPreference(java.lang.String key, java.lang.String defaultval)
          Returns preference under passed key, or if it doesn't exists sets value with defaultval and establishes this as the future preference value.
 java.util.Timer getTimer()
          Heartbeat timer calls observers every 100 ms
static void main(java.lang.String[] argv)
           
 java.util.Iterator<java.lang.String> prefKeyIterator()
           
 void putPreference(java.lang.String key, java.lang.String val)
           
 java.lang.String remapBehavior(java.lang.String bename)
          Returns preferred behavior according to substitution map in Preferences.txt.
 void removePreference(java.lang.String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION

MSG_EXIT

public static final java.lang.String MSG_EXIT
Safely destroy browsers and all their documents, and Destroy .

"EXIT": arg= HashMap attributes, in= INode root of tree, out=unused.

See Also:
Constant Field Values

FILENAME_PREFERENCES

public static final java.lang.String FILENAME_PREFERENCES
See Also:
Constant Field Values

PREF_CACHEDIR

public static final java.lang.String PREF_CACHEDIR
See Also:
Constant Field Values

HOME_SITE

public static final java.net.URI HOME_SITE
URI of Multivalent home WWW site.

Method Detail

getInstance

public static Multivalent getInstance()
Returns singleton instance, from which preferences and other state can be accessed.


getCache

public com.pt.io.Cache getCache()

getGenre

public java.lang.String getGenre(java.lang.String contenttype,
                                 java.lang.String path)
Maps MIME Content-Type and path to Multivalent genre. Genre can be mapped to a Java class via Behavior.getInstance(String,String,ESISNode,Map,Layer).


getGenreMap

public java.util.Map<java.lang.String,java.lang.String> getGenreMap()

getLogger

public static java.util.logging.Logger getLogger()
Returns main logger (subsystems can use own logger).

Conventions for use of logging levels by behaviors:


getTimer

public java.util.Timer getTimer()
Heartbeat timer calls observers every 100 ms.


remapBehavior

public java.lang.String remapBehavior(java.lang.String bename)
Returns preferred behavior according to substitution map in Preferences.txt. Clients can ask for the preferred "Hyperlink" and get the lastest-greatest, which was written after the client. Replacements must subclass what they replace and should generally recognize as many attributes as applicable. Behavior.getInstance(String, String, Map, Layer) remaps all behavior names.


getPreference

public final java.lang.String getPreference(java.lang.String key,
                                            java.lang.String defaultval)
Returns preference under passed key, or if it doesn't exists sets value with defaultval and establishes this as the future preference value. Keys are case insensitive.


putPreference

public final void putPreference(java.lang.String key,
                                java.lang.String val)

removePreference

public final void removePreference(java.lang.String key)

prefKeyIterator

public final java.util.Iterator<java.lang.String> prefKeyIterator()

getBrowser

public Browser getBrowser(java.lang.String name)
Convenience method for creating a standalone browser, as if getBrowser(name, "System", true).


getBrowser

public Browser getBrowser(java.lang.String name,
                          java.lang.String systemHub,
                          boolean standalone)
Returns Browser with given name, with passed URL to system behaviors hub. If no such browser, create new one. This, not Browser's constructor, is the way to create new instances.


browsersIterator

public java.util.Iterator<Browser> browsersIterator()

main

public static void main(java.lang.String[] argv)

Multivalent API