You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by kw...@apache.org on 2008/04/03 23:01:26 UTC
svn commit: r644490 - in
/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src:
main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/
main/resources/
test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/
Author: kwilliams
Date: Thu Apr 3 14:01:25 2008
New Revision: 644490
URL: http://svn.apache.org/viewvc?rev=644490&view=rev
Log:
Applying Gilbert's updates for TUSCANY-2188
Added:
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java (with props)
Modified:
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java?rev=644490&r1=644489&r2=644490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java Thu Apr 3 14:01:25 2008
@@ -20,13 +20,18 @@
package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.FService;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.annotations.Context;
import org.osoa.sca.annotations.Service;
@Service(org.apache.tuscany.sca.vtest.javaapi.annotations.service.FService.class)
public class FServiceImpl implements FService {
+ @Context
+ public RequestContext requestContext;
+
public String getName() {
- return "FService";
+ return requestContext.getServiceName();
}
}
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java?rev=644490&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java Thu Apr 3 14:01:25 2008
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
+
+import org.osoa.sca.annotations.Service;
+
+@Service(FServiceImpl2.class)
+public class FServiceImpl2 extends FServiceImpl {
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite?rev=644490&r1=644489&r2=644490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite Thu Apr 3 14:01:25 2008
@@ -50,6 +50,11 @@
class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl" />
</component>
+ <component name="FComponent2">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl2" />
+ </component>
+
<component name="GComponent">
<implementation.java
class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.GServiceImpl" />
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java?rev=644490&r1=644489&r2=644490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java Thu Apr 3 14:01:25 2008
@@ -32,6 +32,8 @@
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.EService;
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.FService;
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl2;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -99,19 +101,16 @@
/**
* Lines 222 to 224:<br>
- * A remotable service is defined using the
- *
- * @Remotable annotation on the Java interface that defines the service.
- * Remotable services are intended to be used for coarse grained
- * services, and the parameters are passed by-value.<br>
- * <p>
- * Lines 321 to 323:<br>
- * The
- * @Remotable annotation on a Java interface indicates that the interface is
- * designed to be used for remote communication. Remotable
- * interfaces are intended to be used for coarse grained
- * services. Operations parameters and return values are passed
- * by-value.<br>
+ * A remotable service is defined using the "@Remotable" annotation on the
+ * Java interface that defines the service. Remotable services are intended
+ * to be used for coarse grained services, and the parameters are passed
+ * by-value.<br>
+ * <p>
+ * Lines 321 to 323:<br>
+ * The "@Remotable" annotation on a Java interface indicates that the
+ * interface is designed to be used for remote communication. Remotable
+ * interfaces are intended to be used for coarse grained services.
+ * Operations parameters and return values are passed by-value.<br>
*/
@Test
public void atService3() throws Exception {
@@ -138,12 +137,10 @@
/**
* Line 1624 to 1627:<br>
* A class used as the implementation of a service is not required to have
- * an
- *
- * @Service annotation. If a class has no
- * @Service annotation, then the rules determining which services are
- * offered and what interfaces those services have are determined
- * by the specific implementation type.<br>
+ * an "@Service" annotation. If a class has no "@Service" annotation, then
+ * the rules determining which services are offered and what interfaces
+ * those services have are determined by the specific implementation type.
+ * <br>
*/
@Test
public void atService5() throws Exception {
@@ -177,10 +174,8 @@
/**
* Line 1635 to 1636:<br>
- * A
- *
- * @Service annotation with no attributes is meaningless, it is the same as
- * not having the annotation there at all.<br>
+ * A "@Service" annotation with no attributes is meaningless, it is the
+ * same as not having the annotation there at all.<br>
*/
@Test
@Ignore
@@ -195,15 +190,15 @@
* Line 1637 to 1638:<br>
* The service names of the defined services default to the names of the
* interfaces or class, without the package name.<br>
- * <p>
- * This test tests
- *
- * @Service with the full package name.
*/
@Test
public void atService8() throws Exception {
FService fService = domain.getService(FService.class, "FComponent");
Assert.assertEquals("FService", fService.getName());
+ FServiceImpl2 fServiceImpl2 = domain.getService(FServiceImpl2.class, "FComponent2");
+ Assert.assertEquals("FServiceImpl2", fServiceImpl2.getName());
+ fService = domain.getService(FService.class, "FComponent2");
+ Assert.assertEquals("FServiceImpl2", fService.getName());
}
/**
@@ -211,9 +206,7 @@
* If a Java implementation needs to realize two services with the same
* interface, then this is achieved through subclassing of the interface.
* The subinterface must not add any methods. Both interfaces are listed in
- * the
- *
- * @Service annotation of the Java implementation class. <br>
+ * the "@Service" annotation of the Java implementation class. <br>
*/
@Test
public void atService9() throws Exception {
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org