Menu

#1 GenericPool constructor

open
nobody
None
5
2001-05-25
2001-05-25
No

using the GenericPool constructor:

Not sure what the String classname argument is for. At
first I thought it was the name of the class to be
constructed using the parms argument, but the code is
using the metad.getObject for that information.

And the parameter class name isn't used in the
definition. Something is awry here.

Also the documentation about xml doesn't describe this
usage.

Here is the code snippet shown below and you can see
what I mean.

/**
* Create a pool of Objects in which the Objects are
created using
* a specific constructor with the specified params.
*/
public GenericPool(GenericPoolMetaData metad, String
classname, Object[] params) {
this(metad);
this.oparams = params;
this.con = figureConstructor();
}

Discussion

  • PS Neville

    PS Neville - 2001-06-12

    Logged In: YES
    user_id=18491

    This code snip was used when the Generic pool supported
    pooling of objects that didn't have default no-args
    constructors. It currently isn't used at all -- meaning only
    objects with no-args constructors can be pooled using the
    generic pool. I hope to put this generic stuff back in at
    some point (please feel free to implement it and send me the
    source), which is why I didn't delete the method altogether.

     
  • Nobody/Anonymous

    Logged In: NO

    In order to resolve your problem you must replace
    GenericPool(GenericPoolMetaData metad, String classname,
    Object[] params) method by :
    public GenericPool(GenericPoolMetaData metad, String
    classname, Object[] params) {
    //source this(metad);
    //source this.oparams = params;
    //source this.con = figureConstructor();
    super(metad);
    this.oparams = params;
    this.info = (GenericPoolMetaData) metad;
    this.con = figureConstructor();
    try {
    init();
    } catch (Exception e) {
    log("GenericPool: Exception while initializing", e);
    }
    }

     
  • Darin DeForest

    Darin DeForest - 2002-09-26

    Logged In: YES
    user_id=197261

    This patch is basically what I did.

     

Log in to post a comment.

MongoDB Logo MongoDB