Forum Discussion

Jerome_O_Neil_1's avatar
Jerome_O_Neil_1
Icon for Nimbostratus rankNimbostratus
Jan 05, 2006

LBPool.create Parameters

I'm having problems understanding the call syntax for LBPool.create.

 

 

The javadoc says:

 

 

stub.create(String [], LBMethod [], IPPortDefinition [][]);

 

 

Why the two dimensional array for the IPPortDefinition, and what should go in the array columns? The method just gets wrapped up into the Call.invoke(Object []) method in the stub, so there isn't much clue there.

 

 

Any clues for the clueless? How do I populate the port definition array?

 

 

Thanks!

 

 

-J

 

  • This allows you to create more than one pool for each request.

    The easiest way to think of this is as if we defined the API for a single pool

    LocalLB::Pool::create(string, LBMethod, IPPortDefinition[]);

    That makes sense as you will more than likely want to add multiple members (IP, port combination) to the pool you create so you'll have to be able to pass in an array of them for your pool.

    Now, just expand each entry into an array to allow for multiple pools. Index 0 on each parameter is for the first pool, index 1 for the second, ....

    If you are only trying to create a single pool, then just use an array of size one for the first dimension in all the arrays.

    I know this is somewhat harder to create an array for each parameter but we made the decision in 9.x to convert all our methods to "bulk" to avoid users having to make many methods calls just to do the same operation on multiple "like" objects.

    Make sense???

    -Joe

  • Ahhhh, that does make more sense.

     

     

    \writes some code....

     

     

    Works, too!

     

     

    Thanks!

     

     

    -Jerome