jaugment2.UI.UIManager
Class UIManagerBean

java.lang.Object
  |
  +--jaugment2.UI.UIManager.UIManagerBean

public class UIManagerBean
extends java.lang.Object

A Helper-class doing all the dirty work for a UI, so that new UIs can be written easily. It looks (among other things) for services that are representable by out UI. If a service is not yet representable for us you may write a representation for it and atach the representation looking for the services you can represent, use getAdmin (it has toi be Administratable) and atach yourself with net.jini.admin.JoinAdmin::addLookupAttributes(Entry[] attrSets) (if that interface is supported by the admin-object of the service) You meight find it usefull to atach thr actual UI as an EntryBean to the Entry instead of serializing it somehow without breaking all the references in it or creating it when it if used either by some magic (wrap all functions) or by requiring some special init()-function.


Inner Class Summary
private  class UIManagerBean.CommentParser
          Parse # "statements"
static class UIManagerBean.executeMacro
          data-type containing everything about an execute-macro that a UI needs to know
private  class UIManagerBean.IncludeParser
          Parse include-statements
private  class UIManagerBean.InstanciateThread
          Thread to start services asyncronously
private  class UIManagerBean.StartupBeanParser
          Parse "startup:bean"-statements
 
Field Summary
private  UIManagerBean.executeMacro[] executeMacros
           
private  java.lang.Object executeMacrosValidFor
           
(package private)  LookupEventListener listener
          React to services found/gone/changed from our JINI-registrars and the parseconfig-function
private  java.util.Hashtable localApps
           
private  LocalLoockup lookup
           
private  java.util.Hashtable runningApps
           
private  java.util.Vector UIManagerEventListeners
           
private  WatchTowerBean watchTower
           
 
Constructor Summary
UIManagerBean(net.jini.core.lookup.ServiceTemplate at, UIManagerEventListener l)
           
 
Method Summary
 boolean addService(java.lang.Object inst)
           
 void addUIManagerEventListener(UIManagerEventListener l)
           
 boolean execute(java.lang.String name)
          Given a classname or macro-name start the service localy
protected  void fireApplicationFound(LookupEventEvent e, java.lang.Object local)
           
protected  void fireApplicationFound(UIManagerEventEvent e, LookupEventEvent e2, java.lang.Object local)
          An application has been found/loaded by the config-parser and successfully instanciated
protected  void fireApplicationFound(UIManagerEventEvent e, java.lang.Object local)
           
protected  void fireApplicationVanished(UIManagerEventEvent e)
          A JINI-Application we used over a network has vanished
protected  void fireLocalProcessStarted(UIManagerEventEvent e)
          We started a local process due to a cmdln-startup-entry in the config-file
 UIManagerBean.executeMacro[] getExecuteMacros()
          Returns a list of all defines exec-macros
private  net.jini.core.lookup.ServiceID newServiceID()
           
private  void parseConfig()
          parses the jaugment2.conf -file and starts-up any processes/services mentioned in there.
 void removeUIManagerEventListener(UIManagerEventListener l)
           
private  void ServiceFoundEvent2(LookupEventEvent e, java.lang.Object local)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

watchTower

private WatchTowerBean watchTower

lookup

private LocalLoockup lookup

runningApps

private java.util.Hashtable runningApps

localApps

private java.util.Hashtable localApps

executeMacros

private UIManagerBean.executeMacro[] executeMacros

executeMacrosValidFor

private java.lang.Object executeMacrosValidFor

listener

LookupEventListener listener
React to services found/gone/changed from our JINI-registrars and the parseconfig-function

UIManagerEventListeners

private transient java.util.Vector UIManagerEventListeners
Constructor Detail

UIManagerBean

public UIManagerBean(net.jini.core.lookup.ServiceTemplate at,
                     UIManagerEventListener l)
              throws java.lang.Exception
Method Detail

removeUIManagerEventListener

public void removeUIManagerEventListener(UIManagerEventListener l)

addUIManagerEventListener

public void addUIManagerEventListener(UIManagerEventListener l)

newServiceID

private net.jini.core.lookup.ServiceID newServiceID()

getExecuteMacros

public UIManagerBean.executeMacro[] getExecuteMacros()
Returns a list of all defines exec-macros

execute

public boolean execute(java.lang.String name)
Given a classname or macro-name start the service localy

addService

public boolean addService(java.lang.Object inst)

parseConfig

private void parseConfig()
parses the jaugment2.conf -file and starts-up any processes/services mentioned in there. all config-entries are put into System.properties

ServiceFoundEvent2

private void ServiceFoundEvent2(LookupEventEvent e,
                                java.lang.Object local)

fireLocalProcessStarted

protected void fireLocalProcessStarted(UIManagerEventEvent e)
We started a local process due to a cmdln-startup-entry in the config-file

fireApplicationFound

protected void fireApplicationFound(UIManagerEventEvent e,
                                    java.lang.Object local)
                             throws java.beans.PropertyVetoException

fireApplicationFound

protected void fireApplicationFound(LookupEventEvent e,
                                    java.lang.Object local)
                             throws java.beans.PropertyVetoException

fireApplicationFound

protected void fireApplicationFound(UIManagerEventEvent e,
                                    LookupEventEvent e2,
                                    java.lang.Object local)
                             throws java.beans.PropertyVetoException
An application has been found/loaded by the config-parser and successfully instanciated

fireApplicationVanished

protected void fireApplicationVanished(UIManagerEventEvent e)
A JINI-Application we used over a network has vanished