The com.sun.n1.sps.plugin.browse package contains five interfaces and four classes that specify browse functionality:
Browser – Any resource handler must use this base interface to support browsing functionality.
BrowserDisplay – This interface is used by the Browsing portion of the hierarchy manager to make the display more informative and correct.
BrowserFactory – This interface provides the interface for the loader to use to obtain an actual instance of the appropriate browser.
BrowserFilter – This interface describes how nodes can be filtered according to certain criteria.
BrowserNode – This interface defines the functionality for a browsable hierarchy node.
BrowserContext – This class provides a container for the client to set initial parameters for a browsing session.
BrowserInfo – This class describes the browser that is appropriate for display in the user interface and retrieval of actual instance from within the system.
BrowserNodeBase – This class provides a default implementation for the BrowserNode interface.
BrowserException – This class identifies typed exceptions to be thrown from within browsing sessions.
The Browser implementation includes the following key API segments:
Returns the different filters this browser supports. Use the BrowserFilter interface to filter BrowserNodes based on particular criteria, for example, filter all files to show just *.tmp files.
Gets the display properties object to be used with this browser.
Returns a node in the hierarchy this browser represents.
Specifies the filter to be used while browsing.
The BrowserNode class implements the entire hierarchy tree functionality. This functionality is segmented into four key areas:
Providing all the children of the node
Providing the parent if the node
Describing whether the node is a leaf node
Providing other descriptions and properties related to the node
The BrowserFactory interface provides the interface for the HierarchyBrowserLoader to obtain an actual instance of the appropriate HierarchyBrowser.
To define a class which implements the BrowserFactory interface, use an API call similar to the following example:
Browser getBrowser(BrowserContext bContext,AgentContext aContext)
where:
bContext is the context retrieved from the component exporter that specified this browser.
aContext is the context supplied for the agent in case native libraries must be loaded
The BrowserFactory implementation defines a getBrowser method with the system-supplied BrowserContext object and AgentContext objects as parameters.
In the backing component of the component type, declare the fully qualified class name of the browser factory in the browserClass variable. The following code fragment defines two browser factories for a backing component:
<var access="PRIVATE" name="EJBFileSystemBrowser" default="com.raplix.rolloutexpress.plugins.weblogic.hierarchies.ejb.EJBFileBrowserFactory" /> <var access="PRIVATE" name="EJBDomainBrowser" default="com.raplix.rolloutexpress.plugins.weblogic.hierarchies.ejb.EJBDomainBrowserFactory" />
The following example filters all files of the name *.tmp:
public class TmpFilter implements BrowserFilter, ExampleFilter { public String getName() { return "tmpFilter"; } public String getDescription() { return "show only *.tmp files"; } public boolean filter(ExampleBrowserNode node) { return node.getLocalName().endsWith(".tmp"); } }