Changeset 2152 for trunk/java-client
- Timestamp:
- 2001-03-09T23:26:57+13:00 (23 years ago)
- Location:
- trunk/java-client/org/nzdl/gsdl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java
r2150 r2152 246 246 Result result = (Result) resultsList.getSelectedValue(); 247 247 if (result.toString() == Result.FAKE_RESULT) { 248 dataTextArea.setText( null);248 dataTextArea.setText(""); 249 249 //System.err.println("no results"); 250 250 } -
trunk/java-client/org/nzdl/gsdl/service/NzdlResponse.java
r2108 r2152 51 51 public NzdlResponse( ) { 52 52 m_responseHolder = NzdlCorbaFactory.createFilterResponseHolder(); 53 m_response = m_responseHolder.value; 54 } 55 56 /** 57 * Create an empty instance of a NzdlResponse object. 58 */ 59 public void copyData(NzdlResponse old) { 60 m_responseHolder = old.m_responseHolder ; 61 m_response = old.m_response; 62 m_resultSet = old.m_resultSet; 63 m_frequencies = old.m_frequencies; 64 m_queryTerms = old.m_queryTerms; 65 } 66 67 /** 68 * Get the corbaFilterReponse. 69 */ 70 public corbaFilterResponse getResponse() { 71 return m_response; 72 } 73 74 /** 75 * Set the corbaFilterReponse. 76 */ 77 public void setResponse(corbaFilterResponse response) { 78 m_response = response; 79 m_responseHolder.value = response; 80 parseResponse(); 53 81 } 54 82 … … 128 156 m_resultSet = new NzdlResultSet(); 129 157 m_resultSet.setNumOfDocs( m_response.numDocs ); 158 if (m_response.isApprox == null) 159 throw new Error ("null m_response.isApprox in parseResponse"); 130 160 m_resultSet.setResultType( m_response.isApprox.value() ); 131 161 /** HAS SIDE EFFECT ! */ -
trunk/java-client/org/nzdl/gsdl/service/NzdlServiceCachingClient.java
r2151 r2152 25 25 26 26 public NzdlCollectionInfo getCollectionInfo( String _name ) { 27 //System.err.println("in NzdlServiceCachingClient::getCollectionInfo()"); 27 28 NzdlCollectionInfo info = null; 28 29 info = (NzdlCollectionInfo)_collectionInfo.get(_name); … … 31 32 info = super.getCollectionInfo(_name); 32 33 _collectionInfo.put(_name,info); 33 34 35 System.err.println("Cache miss (getCollectionInfo)"); 34 36 return info; 35 37 } … … 37 39 public String getDocument( String _name, String _docID ) { 38 40 String doc = null; 39 doc = (String)_collectionInfo.get(_name + _docID); 41 String key = "" + _name + _docID; 42 doc = (String)_docs.get(key); 40 43 if (doc != null) 41 44 return doc; 42 45 doc = super.getDocument(_name,_docID); 43 _docs.put(_name + _docID,doc); 46 _docs.put(key, doc); 47 48 System.err.println("Cache miss (getDocument) " + _name 49 + " " +_docID); 44 50 45 51 return doc; … … 47 53 48 54 public void service( String _name, NzdlRequest _request, NzdlResponse _response ) { 49 if (_name == null || _name.equals("")){ 50 throw new Error ("null or empty _name"); 55 56 String key = _name + corbaFilterRequestToString(_request); 57 58 if (_services.get(key) != null) { 59 _response.copyData((NzdlResponse) _services.get(key)); 60 return; 51 61 } 52 if (_request == null || _request.equals("")){53 throw new Error ("null or empty _request");54 }55 if (_response == null || _response.equals("")){56 throw new Error ("null or empty _response");57 }58 59 NzdlResponse info = null;60 _response.getHolder().value = (corbaFilterResponse)61 _services.get(_name + corbaFilterRequestToString(_request));62 63 if (info != null)64 return;65 62 66 63 super.service(_name, _request,_response); 67 _collectionInfo.put(_name +corbaFilterRequestToString(_request), 68 _response.getHolder().value); 64 65 _services.put(key, _response); 66 67 System.err.println("Cache miss (service)" + key); 69 68 return; 70 69 } … … 108 107 return buf.toString(); 109 108 } 110 111 112 109 } 113 110 -
trunk/java-client/org/nzdl/gsdl/util/NzdlIORs.java
r2141 r2152 57 57 import org.nzdl.gsdl.service.NzdlService; 58 58 import org.nzdl.gsdl.service.NzdlServiceClient; 59 import org.nzdl.gsdl.service.NzdlServiceCachingClient; 59 60 60 61 /** … … 98 99 }; 99 100 100 101 /** Are we using a caching NzdlService ? */ 102 static public boolean nzdlServiceCachingClass = true; 101 103 102 104 /** … … 128 130 if (knownIORs != null) 129 131 return; 130 132 131 133 Properties blarg = new Properties(); 132 134 … … 380 382 NzdlServiceClient nzdl = null; 381 383 try { 382 nzdl = new NzdlServiceClient( _args, _props, _IOR); 384 if (nzdlServiceCachingClass) 385 nzdl = new NzdlServiceCachingClient( _args, _props, _IOR); 386 else 387 nzdl = new NzdlServiceClient( _args, _props, _IOR); 383 388 } catch (Throwable t) { 384 389 System.err.println ("failed to initialise using:");
Note:
See TracChangeset
for help on using the changeset viewer.