diff options
author | adrianocrestani <adrianocrestani@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-28 06:38:34 +0000 |
---|---|---|
committer | adrianocrestani <adrianocrestani@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-28 06:38:34 +0000 |
commit | aaea9a7255e72725634af9f46bb59c4f61418776 (patch) | |
tree | 4ca00006ac9373cf7a85f358abe2df47dcf0510e /branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany | |
parent | e14097e558d803c2b22a92ec3484330ffebf1459 (diff) |
applying patch tuscany_2552_phillipe_ramalho_09_30_2009.patch from TUSCANY-2552
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@830448 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany')
4 files changed, 26 insertions, 17 deletions
diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java index ef23b1b4cd..3e17ae007b 100644 --- a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java @@ -75,6 +75,7 @@ import org.apache.tuscany.sca.data.collection.LocalItemCollection; import org.apache.tuscany.sca.data.collection.NotFoundException; import org.apache.tuscany.sca.domain.manager.impl.ContributionCollectionImpl.Cache.ContributionCache; import org.apache.tuscany.sca.domain.search.DomainSearch; +import org.apache.tuscany.sca.domain.search.IndexException; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.MonitorFactory; import org.apache.tuscany.sca.monitor.Problem; @@ -225,7 +226,14 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl // add it to the search index, contributionUpdated is called to guarantee // only one contribution with the same URI in the index if (domainSearch != null) { // can be null in unit tests - domainSearch.contributionUpdated(contribution, contribution); + + try { + domainSearch.updateContribution(contribution, contribution); + + } catch (IndexException e) { + logger.warning("Could not update contribution on index: " + contribution.getURI()); + } + } return key; @@ -274,7 +282,13 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl // delete it from the search index if (domainSearch != null) { // can be null in unit tests - domainSearch.contributionRemoved(contribution); + + try { + domainSearch.removeContribution(contribution); + } catch (IndexException e) { + logger.warning("Could not remove contribution from index: " + contribution.getURI()); + } + } return; diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java index 069cc9f5ae..c015689cf1 100644 --- a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java @@ -23,7 +23,6 @@ import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; -import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java index 04c807cba8..d68cfa3786 100644 --- a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java @@ -39,7 +39,6 @@ import org.apache.tuscany.sca.data.collection.Item; import org.apache.tuscany.sca.data.collection.ItemCollection; import org.apache.tuscany.sca.data.collection.LocalItemCollection; import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.apache.tuscany.sca.domain.search.DomainSearch; import org.osoa.sca.ServiceRuntimeException; import org.osoa.sca.annotations.Init; import org.osoa.sca.annotations.Reference; diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/Searcher.java b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/Searcher.java index 6937a848c1..38a23f9023 100644 --- a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/Searcher.java +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/Searcher.java @@ -17,6 +17,7 @@ import org.apache.tuscany.sca.data.collection.ItemCollection; import org.apache.tuscany.sca.data.collection.LocalItemCollection; import org.apache.tuscany.sca.data.collection.NotFoundException; import org.apache.tuscany.sca.domain.search.DomainSearch; +import org.apache.tuscany.sca.domain.search.IndexException; import org.apache.tuscany.sca.domain.search.Result; import org.apache.tuscany.sca.domain.search.impl.DomainSearchFormatter; import org.apache.tuscany.sca.domain.search.impl.HighlightingUtil; @@ -52,7 +53,7 @@ public class Searcher implements ItemCollection, LocalItemCollection { private int elementCounter; public void delete(String key) throws NotFoundException { - System.out.println("delete"); + } private static void startIndentation(int size, StringWriter writer) { @@ -159,7 +160,13 @@ public class Searcher implements ItemCollection, LocalItemCollection { for (Contribution contribution : contributions) { if (!contribution.getURI().equals(DomainManagerUtil.DEPLOYMENT_CONTRIBUTION_URI)) { - this.domainSearch.contributionUpdated(contribution, contribution); + + try { + this.domainSearch.updateContribution(contribution, contribution); + } catch (IndexException e) { + + } + } } } @@ -194,7 +201,7 @@ public class Searcher implements ItemCollection, LocalItemCollection { item.setContents("No results match: <u>" + query + "</u>"); } - System.out.println(item.getContents()); + // System.out.println(item.getContents()); return item; @@ -234,16 +241,6 @@ public class Searcher implements ItemCollection, LocalItemCollection { } } - // - // System.out.println("set-size: " + set.size()); - // for (char character : set) { - // System.out.print(","); - // System.out.print((int) character); - // System.out.print("/*" + character + "*/"); - // - // } - // - // System.out.println(); return sb.toString(); |