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:

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

Variable Index

 o 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
 o HELP_SET
HelpSet is a String that points to a JavaHelp Help Set (.hs) file.
 o 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>.
 o LOADING_HELP
HostContext.loadingHelp is a String that is displayed in a dialog box if loading the help will take a while.
 o 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>.
 o REFRESH_ATTRIBUTES
Passed to getProductAttribute[s] to specify that the product attributes should be refreshed by reinvoking the SETTER.
 o 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.
 o STATIC_PRODUCT_ATTR
An array of system properties that are used to initialize product Attributes.

Constructor Index

 o HostContext()
Construct a HostContext.

Method Index

 o abort()
Exit all HostContexts in this JVM.
 o blockAllClients(Window)
Iterate through all of the clients and block input to them by raising their glass pane.
 o exit(int)
Exit the application or applet.
 o getAssociation(String, String, String)
Get an Association for a host.
 o getCategory(String)
Get a Category for a host.
 o getClients(String)
Get a Vector of clients that were registered with key.
 o getHostName()
Get the name of the host this HostContext represents.
 o getIconRenderer(String)
Returns an IconRenderer.
 o getNameRenderer(String)
Returns an NameRenderer.
 o getPrivBroker()
Get the PrivBroker instance for a host.
 o getProductAttribute(String, String, UIContext, boolean, Object, ResultListener)
Gets a product attribute.
 o getProductAttributeFromCache(String, String)
Gets product attributes from the cache.
 o getProductAttributes(String, AttrBundle, UIContext, boolean, Object, ResultListener)
Fills the AttributeBundle passed to the method with all known product attributes for the requested product.
 o getProductInfo()
Get the ProductInfo instance for a host.
 o getTaskRegistry()
Get the TaskRegistry instance for a host.
 o help(String, String)
Provide help to the user, using JavaHelp
 o monitorProductAttributes(String, AttrListener)
Monitor a set of product attributes for changes.
 o registerClient(Object)
Register a client that is sharing this HostContext.
 o registerClient(Object, String)
Register a client that is sharing this HostContext, and associate it with a key.
 o setExitHandler(HostContext. ExitHandler)
Set the ExitHandler which will handle requests to exit.
 o setProductAttribute(String, Attribute)
Sets a product Attribute
 o unblockAllClients()
Iterate through all of the clients and unblock input to them by dropping their glass pane.
 o unmonitorProductAttributes(String, AttrListener)
Stop monitoring a set of product attributes.
 o unregisterClient(Object)
Unregister a client that is sharing this HostContext.
 o unsetProductAttribute(String, String)
Unsets the specified product attribute.
 o unsetProductAttributes(String)
Unsets all the product attributes.

Variables

 o 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>.

 o 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>.

 o 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.

 o 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.

 o 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

 o 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.

 o 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.

 o 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>

Constructors

 o HostContext
 public HostContext()
Construct a HostContext.

Methods

 o 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.
 o 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.
 o 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
 o 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
 o unsetProductAttributes
 public void unsetProductAttributes(String product)
Unsets all the product attributes. Listeners are notified appropriately.

Parameters:
product - The product to unset
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.

 o exit
 public void exit(int status)
Exit the application or applet.

Parameters:
status - exit status.
 o setExitHandler
 public void setExitHandler(HostContext. ExitHandler exitHandler)
Set the ExitHandler which will handle requests to exit.

Parameters:
exitHandler - Handles requests to exit.
 o abort
 public static void abort()
Exit all HostContexts in this JVM.

 o getCategory
 public abstract Category getCategory(String name)
Get a Category for a host.

Parameters:
name - Name of Category to get.
Returns:
Category
 o 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
 o getPrivBroker
 public abstract PrivBroker getPrivBroker()
Get the PrivBroker instance for a host.

Returns:
PrivBroker instance.
 o getTaskRegistry
 public abstract TaskRegistry getTaskRegistry()
Get the TaskRegistry instance for a host.

Returns:
TaskRegistry instance.
 o getProductInfo
 public abstract ProductInfo getProductInfo()
Get the ProductInfo instance for a host.

Returns:
ProductInfo instance.
 o getHostName
 public abstract String getHostName()
Get the name of the host this HostContext represents.

Returns:
name of the host this HostContext represents.
 o getIconRenderer
 public IconRenderer getIconRenderer(String category)
Returns an IconRenderer. IconRenderers are shared.

Parameters:
category - The category of Items to be rendered.
 o 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