Extending Jigsaw and Cloning!

I am extending the class httpd to add the functionality I need and then I
want to use some clones of the new httpd class. But there are a few
problems:

1) the method initializeProperties() is private which doesn't allow the
subclass to use its own defined properties in a configuration file. This
method shall be protected.

2) Clones of httpd share some important resources: they only have one
indexer, one realm catalog and one logger. If the user is going to shutdown
one clone the method cleanup shuts down the indexer, the realm catalog and
the logger which is not really good for the remaining main-server.

I suggest the following solution to this problem:

protected static int clones = 0;

public ServerHandler clone(...) {
    ...
    clones++;
}

protected void cleanup(boolean restart) {
    ...
    if (logger != null && clones == 0)
        logger.shutdown();
    ...

    if (restart)
        ...
    else
        clones--;     // this clone never comes back
}

public void initialize(...) {

    ...
    if (clones == 0)        // otherwise a logger already extists
        initializeLogger();

    ...
}



The problems are the same in Jigsaw1beta2 and Jigsaw2alpha1.


Wolfgang Platzer

--
Dipl.-Ing. Wolfgang Platzer
Technische Universitaet Graz - University of Technology Graz
Institut für Angewandte Informationsverarbeitung
und Kommunikationstechnologien
Klosterwiesgasse 32/I, A-8010 Graz,
Tel: ++43 316 873-5527,Fax: ++43 316 873-5520
URL <http://www.iaik.tu-graz.ac.at/index.html>

Received on Monday, 9 February 1998 03:00:44 UTC