All Packages Class Hierarchy This Package Previous Next Index
Class com.sgi.sysadm.ui.HostContext
java.lang.Object
|
+----com.sgi.sysadm.ui.HostContext
- public abstract class HostContext
- extends Object
HostContext provides the following services:
- Accessor methods for system administration services:
getAssociation,
getCategory,
getHostName,
getPrivBroker,
getTaskRegistry.
- Keeping track of client windows, for the purposes of blocking
input to all clients when an application-modal dialog is needed
and for determining when the application should exit:
blockAllClients,
registerClient,
unregisterClient,
unblockAllClients.
- Exit handling: abort, exit,
setExitHandler.
- Providing help to the user: help
- Getting and setting product attributes:
getProductAttribute,
getProductAttributeFromCache,
getProductAttributes,
monitorProductAttributes,
setProductAttribute,
unmonitorProductAttributes,
unsetProductAttributes.
- Shared renderers: getIconRenderer,
getNameRenderer.
registerClient, getClients, and
unregisterClient may be used to implement run-once
behavior. When the user requests that a Component be launched,
clients of HostContext can use getClients to determine
whether an appropriate Component already exists and raise it to the
front of the window stacking order (using RFrame.toFront).
If no clients are running yet, the Component is created and
registered.
Product attributes are key/value pairs shared by components within
a product that share a HostContext. When a client calls
getProductAttribute or getProductAttributes and
the Attributes need to be set, HostContext will create an instance
of ProductAttributeSetter and call its setProductAttributes
method. The ProductAttributeSetter can display a user interface to
prompt the user for information necessary to determine product
Attributes, if necessary.
- See Also:
- ProductAttributeSetter, RFrame
-
DONT_REFRESH_ATTRIBUTES
- Passed to getProductAttribute[s] to specify that the product
attributes should be used as is, unless they havn't been
retrieved yet, in which case the SETTER will be invoked
-
HELP_SET
- HelpSet is a String that points to a JavaHelp Help Set
(.hs) file.
-
ICON_RENDERER
- A resource <package-qualified Category
name>.iconRenderer is a resource that specifies the
IconRenderer subclass to use for the Category
<package-qualified Category name>.
-
LOADING_HELP
- HostContext.loadingHelp is a String that is displayed in
a dialog box if loading the help will take a while.
-
NAME_RENDERER
- A resource <package-qualified Category
name>.nameRenderer is a resource that specifies the
NameRenderer subclass to use for the Category
<package-qualified Category name>.
-
REFRESH_ATTRIBUTES
- Passed to getProductAttribute[s] to specify that the product
attributes should be refreshed by reinvoking the SETTER.
-
SETTER
- A resource ProductAttributeSetter is a resource that
can be in the PackageP resource file corresponding to the
product that is passed to getProductAttribute or
getProductAttributes.
-
STATIC_PRODUCT_ATTR
- An array of system properties that are used to initialize product
Attributes.
-
HostContext()
- Construct a HostContext.
-
abort()
- Exit all HostContexts in this JVM.
-
blockAllClients(Window)
- Iterate through all of the clients and block input to them by
raising their glass pane.
-
exit(int)
- Exit the application or applet.
-
getAssociation(String, String, String)
- Get an Association for a host.
-
getCategory(String)
- Get a Category for a host.
-
getClients(String)
- Get a Vector of clients that were registered with
key.
-
getHostName()
- Get the name of the host this HostContext represents.
-
getIconRenderer(String)
- Returns an IconRenderer.
-
getNameRenderer(String)
- Returns an NameRenderer.
-
getPrivBroker()
- Get the PrivBroker instance for a host.
-
getProductAttribute(String, String, UIContext, boolean, Object, ResultListener)
- Gets a product attribute.
-
getProductAttributeFromCache(String, String)
- Gets product attributes from the cache.
-
getProductAttributes(String, AttrBundle, UIContext, boolean, Object, ResultListener)
- Fills the AttributeBundle passed to the method with all known
product attributes for the requested product.
-
getProductInfo()
- Get the ProductInfo instance for a host.
-
getTaskRegistry()
- Get the TaskRegistry instance for a host.
-
help(String, String)
- Provide help to the user, using JavaHelp
-
monitorProductAttributes(String, AttrListener)
- Monitor a set of product attributes for changes.
-
registerClient(Object)
- Register a client that is sharing this HostContext.
-
registerClient(Object, String)
- Register a client that is sharing this HostContext, and
associate it with a key.
-
setExitHandler(HostContext. ExitHandler)
- Set the ExitHandler which will handle requests to exit.
-
setProductAttribute(String, Attribute)
- Sets a product Attribute
-
unblockAllClients()
- Iterate through all of the clients and unblock input to them by
dropping their glass pane.
-
unmonitorProductAttributes(String, AttrListener)
- Stop monitoring a set of product attributes.
-
unregisterClient(Object)
- Unregister a client that is sharing this HostContext.
-
unsetProductAttribute(String, String)
- Unsets the specified product attribute.
-
unsetProductAttributes(String)
- Unsets all the product attributes.
ICON_RENDERER
public static final String ICON_RENDERER
- A resource <package-qualified Category
name>.iconRenderer is a resource that specifies the
IconRenderer subclass to use for the Category
<package-qualified Category name>.
NAME_RENDERER
public static final String NAME_RENDERER
- A resource <package-qualified Category
name>.nameRenderer is a resource that specifies the
NameRenderer subclass to use for the Category
<package-qualified Category name>.
SETTER
public static final String SETTER
- A resource ProductAttributeSetter is a resource that
can be in the PackageP resource file corresponding to the
product that is passed to getProductAttribute or
getProductAttributes. If the resource exists, it is used as
the name of a class that implements the ProductAttributeSetter
interface.
REFRESH_ATTRIBUTES
public static final boolean REFRESH_ATTRIBUTES
- Passed to getProductAttribute[s] to specify that the product
attributes should be refreshed by reinvoking the SETTER. If
the SETTER fails, then the old values will be retained.
DONT_REFRESH_ATTRIBUTES
public static final boolean DONT_REFRESH_ATTRIBUTES
- Passed to getProductAttribute[s] to specify that the product
attributes should be used as is, unless they havn't been
retrieved yet, in which case the SETTER will be invoked
LOADING_HELP
public static final String LOADING_HELP
- HostContext.loadingHelp is a String that is displayed in
a dialog box if loading the help will take a while.
HELP_SET
public static final String HELP_SET
- HelpSet is a String that points to a JavaHelp Help Set
(.hs) file. It should be of the format
/com/sgi/simgr/help/simgr.hs
. Typically, this
constant is used to look up the Help Set in a Resource Stack
and pass it to the help method.
STATIC_PRODUCT_ATTR
public static final String STATIC_PRODUCT_ATTR
- An array of system properties that are used to initialize product
Attributes. The format of the value should be:
HostContext.productAttr<n>=<product>:<attribute
key>:<attribute value>
HostContext
public HostContext()
- Construct a HostContext.
help
public static void help(String helpSetPath,
String key)
- Provide help to the user, using JavaHelp
- Parameters:
- helpSetPath - The path to the HelpSet (.hs) file to use.
- key - help tag of help content.
getProductAttribute
public void getProductAttribute(String product,
String key,
UIContext uic,
boolean refresh,
Object context,
ResultListener listener)
- Gets a product attribute.
- Parameters:
- product - The product that contains the desired Attribute
- key - The key of the desired attribute
- uic - The UIContext that will be passed to the
ProductAttributeSetter
- refresh - Should be either REFRESH_ATTRIBUTES or
DONT_REFRESH_ATTRIBUTES.
- context - An object that will be sent to the
ProductAttributeSetter
- listener - The listener to return the Attribute to. The
result sent to the listener should be cast to
an Attribute. If the host context is unable to
get the Attribute requested, the failed method of the
listener will be called.
getProductAttributeFromCache
public Attribute getProductAttributeFromCache(String product,
String attribute)
- Gets product attributes from the cache. This will not force a
load of the product if the product or attribute is not found.
It will just return null. Useful for loaders that need to know
about the previous state of the attributes.
- Parameters:
- product - The product that contains the Attribute
- attribute - The Attribute to get
setProductAttribute
public void setProductAttribute(String product,
Attribute attribute)
- Sets a product Attribute
- Parameters:
- product - The product that contains the Attribute
- attribute - The Attribute to set
unsetProductAttributes
public void unsetProductAttributes(String product)
- Unsets all the product attributes. Listeners are notified
appropriately.
- Parameters:
- product - The product to unset
unsetProductAttribute
public void unsetProductAttribute(String product,
String key)
- Unsets the specified product attribute. Listeners are notified
appropriately.
- Parameters:
- product - The product of the Attribute to unset
- key - The key of the Attribute to unset.
getProductAttributes
public void getProductAttributes(String product,
AttrBundle bundle,
UIContext uic,
boolean refresh,
Object context,
ResultListener listener)
- Fills the AttributeBundle passed to the method with all known
product attributes for the requested product.
- Parameters:
- product - The product that contains the desired Attribute
- bundle - The bundle to fill with the Attributes
- uic - The UIContext that will be passed to the
ProductAttributeSetter
- refresh - Should be either REFRESH_ATTRIBUTES or
DONT_REFRESH_ATTRIBUTES.
- context - An object that will be sent to the
ProductAttributeSetter
- listener - The listener to notify when the bundle is
filled and ready to be read.
monitorProductAttributes
public void monitorProductAttributes(String product,
AttrListener listener)
- Monitor a set of product attributes for changes.
- Parameters:
- product - The product to monitor.
- listener - The AttrListener that will be added to the
product AttrBundle.
unmonitorProductAttributes
public void unmonitorProductAttributes(String product,
AttrListener listener)
- Stop monitoring a set of product attributes.
- Parameters:
- product - The product to stop monitoring.
- listener - The AttrListener to remove from the product
AttrBundle.
registerClient
public void registerClient(Object client)
- Register a client that is sharing this HostContext. When the
last client sharing this HostContext calls
unregisterClient,
exit will be called. Otherwise the JVM will
continue running.
- Parameters:
- client - Object that is sharing this HostContext.
registerClient
public void registerClient(Object client,
String key)
- Register a client that is sharing this HostContext, and
associate it with a key. When the
last client sharing this HostContext calls
unregisterClient,
exit will be called. Otherwise the JVM will
continue running. This version of registerClient
associates a key with the client, so that the client can later
be retrieved using the getClients method. This
mechanism can be used to implement run-once behavior.
If this client has already been registered, the new key replaces
any previous key associated with this client.
- Parameters:
- client - Object that is sharing this HostContext.
- key - Key to be used for subsequent retrieval of client.
getClients
public Vector getClients(String key)
- Get a Vector of clients that were registered with
key. The returned Vector contains the set of Objects
that have been registered by registerClient using
key.
- Parameters:
- key - Specifies which clients we're interested in.
- Returns:
- Vector of clients registered with key.
unregisterClient
public void unregisterClient(Object client)
- Unregister a client that is sharing this HostContext. If this
is the only client left, exit, otherwise keep the
JVM running.
- Parameters:
- client - Object that will no longer be sharing this HostContext.
blockAllClients
public void blockAllClients(Window topWindow)
- Iterate through all of the clients and block input to them by
raising their glass pane. This will only work for clients that
are JComponents or RootPaneContainers; other client types will
be ignored.
- Parameters:
- topWindow - The Window which should be brought to the
front if the user attempts to click on a
blocked client. May be null.
unblockAllClients
public void unblockAllClients()
- Iterate through all of the clients and unblock input to them by
dropping their glass pane. This will only work for clients
that are JComponents or RootPaneContainers; other client types
will be ignored.
exit
public void exit(int status)
- Exit the application or applet.
- Parameters:
- status - exit status.
setExitHandler
public void setExitHandler(HostContext. ExitHandler exitHandler)
- Set the ExitHandler which will handle requests to exit.
- Parameters:
- exitHandler - Handles requests to exit.
abort
public static void abort()
- Exit all HostContexts in this JVM.
getCategory
public abstract Category getCategory(String name)
- Get a Category for a host.
- Parameters:
- name - Name of Category to get.
- Returns:
- Category
getAssociation
public abstract Association getAssociation(String parentCategory,
String parentSelector,
String childCategory)
- Get an Association for a host.
- Parameters:
- parentCategory - The type of the parent Item.
- parentSelector - The selector of the parent Item.
- childCategory - The type of the related Item(s).
- Returns:
- Association
getPrivBroker
public abstract PrivBroker getPrivBroker()
- Get the PrivBroker instance for a host.
- Returns:
- PrivBroker instance.
getTaskRegistry
public abstract TaskRegistry getTaskRegistry()
- Get the TaskRegistry instance for a host.
- Returns:
- TaskRegistry instance.
getProductInfo
public abstract ProductInfo getProductInfo()
- Get the ProductInfo instance for a host.
- Returns:
- ProductInfo instance.
getHostName
public abstract String getHostName()
- Get the name of the host this HostContext represents.
- Returns:
- name of the host this HostContext represents.
getIconRenderer
public IconRenderer getIconRenderer(String category)
- Returns an IconRenderer. IconRenderers are shared.
- Parameters:
- category - The category of Items to be rendered.
getNameRenderer
public NameRenderer getNameRenderer(String category)
- Returns an NameRenderer. NameRenderers are shared.
- Parameters:
- category - The category of Items to be rendered.
All Packages Class Hierarchy This Package Previous Next Index