Return-Path: Delivered-To: apmail-ws-tuscany-commits-archive@locus.apache.org Received: (qmail 66064 invoked from network); 3 Jul 2007 08:04:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2007 08:04:38 -0000 Received: (qmail 19166 invoked by uid 500); 3 Jul 2007 08:04:41 -0000 Delivered-To: apmail-ws-tuscany-commits-archive@ws.apache.org Received: (qmail 19140 invoked by uid 500); 3 Jul 2007 08:04:41 -0000 Mailing-List: contact tuscany-commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-commits@ws.apache.org Received: (qmail 19131 invoked by uid 99); 3 Jul 2007 08:04:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2007 01:04:41 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2007 01:04:37 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4D54A1A981A; Tue, 3 Jul 2007 01:04:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r552703 - in /incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml: OSGiImplementation.java OSGiImplementationProcessor.java Date: Tue, 03 Jul 2007 08:04:16 -0000 To: tuscany-commits@ws.apache.org From: antelder@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070703080417.4D54A1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: antelder Date: Tue Jul 3 01:04:16 2007 New Revision: 552703 URL: http://svn.apache.org/viewvc?view=rev&rev=552703 Log: TUSCANY-1406, apply patch from Rajini Sivaram to get impl-osgi working with the latest trunk code Modified: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java Modified: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java?view=diff&rev=552703&r1=552702&r2=552703 ============================================================================== --- incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java (original) +++ incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java Tue Jul 3 01:04:16 2007 @@ -24,6 +24,8 @@ import java.util.List; import org.apache.tuscany.sca.assembly.ComponentProperty; +import org.apache.tuscany.sca.assembly.ComponentType; +import org.apache.tuscany.sca.assembly.Implementation; import org.apache.tuscany.sca.assembly.impl.ComponentTypeImpl; import org.apache.tuscany.sca.implementation.osgi.OSGiImplementationInterface; import org.apache.tuscany.sca.scope.Scope; @@ -42,8 +44,9 @@ private Scope scope; private String[] allowsPassByRef; private boolean needsPropertyInjection; - Hashtable> referenceProperties; - Hashtable> serviceProperties; + private Hashtable> referenceProperties; + private Hashtable> serviceProperties; + public OSGiImplementation(String bundleName, String bundleLocation, @@ -126,6 +129,5 @@ public long getMaxIdleTime() { return Long.MAX_VALUE; } - } Modified: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java?view=diff&rev=552703&r1=552702&r2=552703 ============================================================================== --- incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java (original) +++ incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java Tue Jul 3 01:04:16 2007 @@ -186,9 +186,6 @@ serviceProperties, injectProperties); - - processComponentType(bundleName, implementation); - implementation.setUnresolved(true); return implementation; @@ -204,17 +201,9 @@ impl.setUnresolved(false); - // FIXME: Tuscany will only process the component type file if it is visible - // to its classloader. So it can't really be located anywhere in the - // directory structure like the bundle. So even though the bundle name - // is used to find the relative pathname of the component type file, - // its absolute location is obtained from the classloader. This doesn't - // seem right, since the bundle could potentially be located anywhere. - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - String bundleName = impl.getBundleName(); - String ctName = bundleName.replaceAll("\\.", "/") + ".componentType"; - String ctURI = cl.getResource(ctName).toString(); + String bundleName = impl.getBundleName(); + String ctURI = bundleName.replaceAll("\\.", "/") + ".componentType"; impl.setURI(ctURI); ComponentType componentType = resolver.resolveModel(ComponentType.class, impl); if (componentType.isUnresolved()) { @@ -302,17 +291,7 @@ public void write(OSGiImplementation model, XMLStreamWriter outputSource) throws ContributionWriteException { } - private void processComponentType(String bundleName, OSGiImplementation implementation) { - - // Form the URI of the expected .componentType file; - String ctName = bundleName.replaceAll("\\.", "/") + ".componentType"; - String uri = ctName; - - - implementation.setURI(uri); - implementation.setUnresolved(true); - } - + private QName getQNameValue(XMLStreamReader reader, String value) { if (value != null) { int index = value.indexOf(':'); --------------------------------------------------------------------- To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org For additional commands, e-mail: tuscany-commits-help@ws.apache.org