com.anabas.sharedlet
Interface Sharedlet

All Known Implementing Classes:
DefaultSharedletImpl

public interface Sharedlet

The client side representation of the sharedlet. From this, the sharedlet's views and session logic components can be accessed. This is a wrapper class from which sharedlet views & session logic instances will be extracted from.

This class is optional. If the sharedlet developer does not provide an implementation of this class, the DefaultSharedletImpl will be provided by the framework; however, storing and loading documents will not then be supported for this sharedlet.

The DefaultSharedletImpl implementation does a lazy instantiate whereby the views and session logic components are only instantiated when they are needed.

For convenience, the sharedlet developer may extend from DefaultSharedletImpl and override the functions necessary.


Method Summary
 SharedletSessionLogic getSessionLogic(java.lang.String id)
          Gets the session logic instance for a particular id.
 SharedletView getView(java.lang.String id)
          Gets the views instance for a particular view id.
 void loadDocument(java.net.URL url)
          A document that matches the data types supported by this sharedlet This document is guaranteed to be of a data type supported by the sharedlet.
 

Method Detail

loadDocument

public void loadDocument(java.net.URL url)
A document that matches the data types supported by this sharedlet This document is guaranteed to be of a data type supported by the sharedlet. The data type list is returned by SharedletInfo.getSupportedDocumentTypes().
Parameters:
url - The url of the document to load.

getView

public SharedletView getView(java.lang.String id)
Gets the views instance for a particular view id. Each sharedlet view has a unique name that distinguish it from other views as returned by SharedletViewInfo.getID().

Parameters:
id - The id returned by SharedletViewInfo.getID()
Returns:
The sharedlet view instance that corresponds to the id specified. null if no such view exists.

getSessionLogic

public SharedletSessionLogic getSessionLogic(java.lang.String id)
Gets the session logic instance for a particular id. Each sharedlet session logic has a unique name that distinguish it from session logic as returned by SharedletSessionLogicInfo.getID().

The session logic encapsulates the common state shared between distributed instances of the same sharedlet and normally resides on the server side.

Parameters:
id - The id returned by SharedletSessionLogicInfo.getID()
Returns:
The sharedlet session logic instance that corresponds to the id specified. null if no such logic exists.