Working With Additional Libraries

Several add-on libraries are available for the Echo framework, such as EchoPoint, NextApp's Sierra toolkit, and the File Transfer Library. These libraries are often used alongside Echo to provide additional functionality.

There are two steps which must be taken in order to use a third-party library with Echo:

  • As is the case with any Java library, any Echo add-on libraries must be specified in the CLASSPATH of the compiler or VM when they are being used.
  • The library must be registered with Echo. This is necessary such that Echo will be able to identify the renderers that will be used to provide the HTML and JavaScript representations of components found in the library.

Registering a Library

Information on how to register a library should be available from the library's documentation. Generally speaking, however, registration is accomplished by invoking a static method within the library which will notify Echo about its existence. This method should be invoked in a static block within an application's EchoServer class. Figure 1 shows an EchoServer class of an application which will make use of the EchoPoint, Sierra, and Echo File Transfer libraries.

public class JustAnotherEchoServlet extends EchoServer {

    static {
        // Register EchoPoint components.
        echopoint.ui.Installer.register();
        
        // Register NextApp Sierra components.
        nextapp.sierraui.Installer.register();
        
        // Register Echo File Transfer Library components.
        nextapp.echoservlet.filetransferui.Installer.register();
    }
        
    public EchoInstance newInstance() {
        return new Application();
    }
}

Figure 1: Registering additional libraries.