org.backsource.xindice
Class XindicePool

java.lang.Object
  extended byorg.backsource.xindice.XindicePool

public class XindicePool
extends java.lang.Object

A simple Xindice pool.

This is a pool for a particular base xindice uri, such as xmldb:xindice:///db or xmldb:xindice://server:4080/db/. It pools XincdiceAdapter instances, which is actully an adapter for a connection to a specifyed Collection. It will only ever hold one connection for each collection. So for example: getting an adapter for the collection /latest, will create one new if it was never created or let the caller wait until the one created gets available.

Version:
$Revision: 1.1.1.1 $
Author:
Peter Antman

Constructor Summary
XindicePool(java.lang.String url)
          Construct a pool for the specifyed base xindice uri.
 
Method Summary
 void close()
           
 XindiceAdapter getAdapter(java.lang.String col)
          Get an adapter for the given collection name (relative to the base url), create a new one if newer created or wait until it gets available.
 void leaveAdapter(XindiceAdapter ad)
          Leave the adapter back to the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XindicePool

public XindicePool(java.lang.String url)
Construct a pool for the specifyed base xindice uri.

Method Detail

getAdapter

public XindiceAdapter getAdapter(java.lang.String col)
                          throws XindiceException
Get an adapter for the given collection name (relative to the base url), create a new one if newer created or wait until it gets available. Its verry important that a call to this os followed by a call to leaveAdapter(org.backsource.xindice.XindiceAdapter) in a finally when the method ends that uses the returned adapter.

Throws:
XindiceException

leaveAdapter

public void leaveAdapter(XindiceAdapter ad)
                  throws XindiceException
Leave the adapter back to the pool.

Throws:
XindiceException

close

public void close()
           throws XindiceException
Throws:
XindiceException


Copyright © 2003-2004 Backsource. All Rights Reserved.