From: <wol...@us...> - 2004-03-08 11:45:38
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22257/src/org/exist/xmldb Modified Files: RemoteResourceSet.java LocalResourceSet.java Log Message: * class BrokerPool now detects if a thread does already hold a broker object and increments a reference count instead of returning a new object. Otherwise, deadlock situations could occurr. * documentCache in RpcConnection should be cleared if changes have been made to the database. * implemented missing getMembersAsResource method in RemoteResourceSet. Index: RemoteResourceSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/RemoteResourceSet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RemoteResourceSet.java 5 Mar 2004 16:15:48 -0000 1.3 --- RemoteResourceSet.java 8 Mar 2004 11:21:22 -0000 1.4 *************** *** 3,9 **** --- 3,12 ---- import java.io.IOException; + import java.io.UnsupportedEncodingException; import java.util.Properties; import java.util.Vector; + import javax.xml.transform.OutputKeys; + import org.apache.xmlrpc.XmlRpcClient; import org.apache.xmlrpc.XmlRpcException; *************** *** 48,53 **** public Resource getMembersAsResource() throws XMLDBException { ! // TODO: implement this ! throw new XMLDBException( ErrorCodes.NOT_IMPLEMENTED ); } --- 51,75 ---- public Resource getMembersAsResource() throws XMLDBException { ! Vector params = new Vector(); ! params.addElement(new Integer(handle)); ! params.addElement(outputProperties); ! try { ! byte[] data = (byte[]) collection.getClient().execute("retrieveAll", params); ! String content; ! try { ! content = new String(data, outputProperties.getProperty(OutputKeys.ENCODING, "UTF-8")); ! } catch (UnsupportedEncodingException ue) { ! content = new String(data); ! } ! RemoteXMLResource res = new RemoteXMLResource( collection, handle, 0, ! "", null ); ! res.setContent( content ); ! res.setProperties(outputProperties); ! return res; ! } catch (XmlRpcException xre) { ! throw new XMLDBException(ErrorCodes.INVALID_RESOURCE, xre.getMessage(), xre); ! } catch (IOException ioe) { ! throw new XMLDBException(ErrorCodes.VENDOR_ERROR, ioe.getMessage(), ioe); ! } } Index: LocalResourceSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalResourceSet.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** LocalResourceSet.java 3 Feb 2004 08:33:51 -0000 1.16 --- LocalResourceSet.java 8 Mar 2004 11:21:22 -0000 1.17 *************** *** 18,21 **** --- 18,22 ---- import org.exist.xquery.value.AtomicValue; import org.exist.xquery.value.Item; + import org.exist.xquery.value.NodeValue; import org.exist.xquery.value.Sequence; import org.exist.xquery.value.SequenceIterator; *************** *** 117,127 **** "exist:result", attribs); ! Object current; char[] value; for(Iterator i = resources.iterator(); i.hasNext(); ) { ! current = (Object)i.next(); ! if(current instanceof NodeProxy) ! serializer.toSAX((NodeProxy)current); ! else { value = current.toString().toCharArray(); handler.characters(value, 0, value.length); --- 118,128 ---- "exist:result", attribs); ! Item current; char[] value; for(Iterator i = resources.iterator(); i.hasNext(); ) { ! current = (Item)i.next(); ! if(Type.subTypeOf(current.getType(), Type.NODE)) { ! ((NodeValue)current).toSAX(broker, handler); ! } else { value = current.toString().toCharArray(); handler.characters(value, 0, value.length); |