|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
jview.ApplicationJoiner
public class ApplicationJoiner
An application joiner is the receiving edge of an sub component and forwards
this to an application switcher. This means, that this class is a
SubComponentListener that registers at the
SubComponentCasters that are bound with names provided in
KEY_COMPONENTCASTERS, or, if this list is empty, the local registry
is scanned for SubComponentCasters. Casters are distinguished
by their SubComponentCaster.respondTo() class returned, which
means that multiple casters, responding to the same class, cannot be
supported.
The other end is a RemoteSwitching instance. This is determined
either by the KEY_APPLICATION key or, if this is not accessible,
by scanning the registries on the KEY_APPLICATIONHOSTS list,
or, if this,
too, is not given or unsuccessful, by a scan through the local host.
The first RemoteSwitching instance found is the one served.
When a remote switching instance has been found, it is scanned for all
components via its RemoteSwitching.knownSwitches() method. Only the
names (i.e. the keys in the mapping) are used by this application, but
the entire mapping is available after initialization to subclasses.
For all switches found, the RemoteSwitching instance is asked if
this name links to a SubComponent by calling
RemoteSwitching.getSubResponse(java.lang.String). Classes retrieved here are matched
with the caster's classes. Matches found result in caching of the
current subcomponent state to allow later #switchTo with the
appropriate state.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private RemoteSwitching |
application
The remote switching instance served. |
static String |
KEY_APPLICATION
The RemoteSwitching bindname, if known. |
static String |
KEY_APPLICATIONHOSTS
If the name of the server is not known, try these hosts. |
static String |
KEY_COMPONENTCASTERS
The list of component casters, if known. |
static String |
KEY_COMPONENTHOSTS
The hosts of component casters, if known. |
private Map<String,Icon> |
names
If the application was found, this are the names/icons. |
private Map<String,Class<?>> |
subkeys
Mapping of application names that are subcomponents to their keys. |
private Map<Class<?>,Object> |
substates
Mapping of caster class keys to caster current configuration. |
| Fields inherited from class util.rmi.AbstractRmiListener |
|---|
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAY |
| 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 | |
|---|---|
ApplicationJoiner(Map<String,String> prop)
Construct a new ApplicationJoiner. |
|
| Method Summary | |
|---|---|
protected boolean |
deregisterAtCaster(RmiCaster caster,
Class reference)
Deregisters from this caster. |
private RemoteSwitching |
getApplication(String bindname)
Looks up the name and returns a RemoteSwitching instance
if successful. |
protected Map<String,Icon> |
getApplications()
Returns the mapping of names to icons for subclasses. |
private Object |
getApplicationState(String id)
Returns the current substate to this named component served in the RemoteSwitching we are connected to. |
void |
init()
On init, retrieve the references to the RemoteSwitching
application server and register to all SubComponentCasters. |
static void |
main(String[] arg)
|
void |
newKey(Object id)
This method is called by the casters if any state changed. |
protected boolean |
registerAtCaster(RmiCaster caster,
Class reference)
Registers at this caster. |
private boolean |
scanNeeded(List<String> binds,
Collection<Class<?>> keys)
Scans a list of binding names for casters of the appropriate keys. |
private List<String> |
scanRegistry(String host,
Class<? extends Remote> id)
Scans the registry on the given host for entries that are instances of the stated class or subclass. |
boolean |
visible(String id)
We make the remote switching application to show its subcomponent. |
| Methods inherited from class util.rmi.AbstractRmiListener |
|---|
allBound, blockBinding, blockBinding, disconnect, exit, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBinding |
| 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, 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, 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 |
| Field Detail |
|---|
public static final String KEY_APPLICATION
public static final String KEY_APPLICATIONHOSTS
public static final String KEY_COMPONENTCASTERS
public static final String KEY_COMPONENTHOSTS
private RemoteSwitching application
private Map<String,Icon> names
private Map<String,Class<?>> subkeys
private Map<Class<?>,Object> substates
| Constructor Detail |
|---|
public ApplicationJoiner(Map<String,String> prop)
throws RemoteException
RemoteException| Method Detail |
|---|
public void init()
RemoteSwitching
application server and register to all SubComponentCasters.
init in interface Initializableinit in class PropertyResources
public void newKey(Object id)
throws RemoteException
newKey in interface SubComponentListenerRemoteExceptionpublic boolean visible(String id)
protected Map<String,Icon> getApplications()
private Object getApplicationState(String id)
RemoteSwitching we are connected to. We first look-up the ID in
the subcomponent list, if it is not found there we retrun null. If this
ID points to a known subcomponent, we query further and see, if we
also know its state. If not, we return null.
protected boolean registerAtCaster(RmiCaster caster,
Class reference)
registerAtCaster in class AbstractRmiListener
protected boolean deregisterAtCaster(RmiCaster caster,
Class reference)
deregisterAtCaster in class AbstractRmiListenerprivate RemoteSwitching getApplication(String bindname)
RemoteSwitching instance
if successful.
private List<String> scanRegistry(String host,
Class<? extends Remote> id)
private boolean scanNeeded(List<String> binds,
Collection<Class<?>> keys)
public static void main(String[] arg)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||