org.jtrix.base.FacetHandle

A FacetHandle wrapper should be created to return a facet in response to a request for one. E.g. in response a bindFacet() call.


public class FacetHandle implements IRemote
{
    /** Create a facet handle.
     * @param impl  The implementation for the facet.
     * @param facet  The class name of the facet.
     */
    public FacetHandle(IRemote impl,String facet)

    // Other methods omitted
}

The FacetHandle is quite trivial but very important. If ever we need to return a facet we should wrap it in a FacetHandle. It helps the node understand what we're passing back, so it can proxy it properly through its mediator.

So this is a facet implementation plus a hint to the node as to how it should be proxied across the mediator to the requester. If we didn't return a FacetHandle and instead passed the actual implementation then the node's mediator wouldn't have enough information to create the proxy which the requester receives.

For example of its use, see the method FacetProvider.bindNodeFacet() in Section [*].

Nik Silver 2002-03-09