jview
Class SubComponentNotify

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by util.rmi.RmiPropertyContainer
                  extended by util.rmi.AbstractRmiCaster
                      extended by jview.SubComponentNotify
All Implemented Interfaces:
Cloneable, Remote, SubComponentCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing
Direct Known Subclasses:
JObjectDisplay.SubComponentHandler

public class SubComponentNotify
extends AbstractRmiCaster
implements SubComponentCaster

Skeleton implementation of a subcomponent caster. Allow registering of listeners and provides a method for notifying all of them.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  Class<?> casting
          The class of the subcomponent key.
private  List<SubComponentListener> ears
          The list of listeners.
 
Fields inherited from class util.rmi.AbstractRmiCaster
ALTERNATEHOST, ALTERNATEPORT, KEY_BINDNAME, KEY_EXPORTPORT, KEY_REGISTRYHOST, KEY_REGISTRYPORT
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
protected SubComponentNotify(Map<String,String> prop, Class<?> to)
          Constructs a new rmi-caster.
  SubComponentNotify(Map<String,String> prop, SubComponent to)
          Constructs a new rmi-caster.
 
Method Summary
 void addSubComponentListener(SubComponentListener notify)
          Registers a new sub-component listener.
protected  void fireKey(Object id)
          Called by the actual subcomponent if its view changed.
 void removeSubComponentListener(SubComponentListener notify)
          Deregisters a new sub-component listener.
 Class<?> respondTo()
          For clients to check if this listener supports the right keys.
 
Methods inherited from class util.rmi.AbstractRmiCaster
bindAlternate, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, exit, getBindName, getBindName, isValid, unbindFromRegistry, unbindFromRegistry
 
Methods inherited from class util.rmi.RmiPropertyContainer
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Field Detail

casting

private Class<?> casting
The class of the subcomponent key.


ears

private List<SubComponentListener> ears
The list of listeners.

Constructor Detail

SubComponentNotify

public SubComponentNotify(Map<String,String> prop,
                          SubComponent to)
                   throws RemoteException
Constructs a new rmi-caster. The object is exported.

Throws:
RemoteException

SubComponentNotify

protected SubComponentNotify(Map<String,String> prop,
                             Class<?> to)
                      throws RemoteException
Constructs a new rmi-caster. The object is exported.

Throws:
RemoteException
Method Detail

addSubComponentListener

public void addSubComponentListener(SubComponentListener notify)
                             throws RemoteException
Registers a new sub-component listener. On registering, the current view of the caster should be fired to the listener. Whenever the caster's component view changes, the listener is notified with its SubComponentListner#newKey method.

Specified by:
addSubComponentListener in interface SubComponentCaster
Throws:
RemoteException

removeSubComponentListener

public void removeSubComponentListener(SubComponentListener notify)
                                throws RemoteException
Deregisters a new sub-component listener. Is also done on dead references.

Specified by:
removeSubComponentListener in interface SubComponentCaster
Throws:
RemoteException

respondTo

public Class<?> respondTo()
                   throws RemoteException
For clients to check if this listener supports the right keys.

Specified by:
respondTo in interface SubComponentCaster
Throws:
RemoteException

fireKey

protected void fireKey(Object id)
Called by the actual subcomponent if its view changed.