The interface IInternalFacetCache in the util package allows the same thing but caches the facets. This is more efficient than getting an internal facet ordinarily because only the first fetch makes a network connection to grab the facet--after that it's cached.
public interface IInternalFacetCache
{
    /** Fetch a facet from a particular netlet.
     * The facet will be pulled from a cache if possible, or
     * else will be retrieved and added to the cache.
     * @param h  The netlet the facet is to come from.
     * @param facet   The facet name to retrieve.
     * @param argument Arbitrary argument to pass to the facet.
     * @param cachable Flag whether the cache is to be used.
     *                 If false, the cache is ignored, both for
     *                 retrieving the facet and storing it. */
    public IRemote getInternalFacet(INetletHandle h, String facet,
                                    Serializable argument, boolean cachable)
        throws BeatrixFacetException; 
}
This interface is implemented by the InternalFacetCache class
in the same package. See Section ![[*]](crossref.png) , next, for how
to get netlet handles.
, next, for how
to get netlet handles.
Here's how to use it. We add the plugin by class but retrieve it by interface:
    // First add the plugin.
    // _pm is this netlet's IPluginManager.
    _pm.add(InternalFacetCache.class);
    // ...Then later on we can use it to, say, get our diary interface.
    // Notice its getInternalFacet signature is different.
    // n1 is a handle to the netlet. The boolean is to say whether
    // to use caching.
    Object[] fc = _pm.lookup(IInternalFacetCache.class);
    IInternalFacetCache c = (IInternalFacetCache)fc[0];
    IDiary d = (IDiary)c.getInternalFacet(n1, IDiary.class.getName(), "Bob Jones", true);
Nik Silver 2002-03-09