summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/sca-api/src/main/java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-09-22 12:22:20 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-09-22 12:22:20 +0000
commit8fa39d402acf47d516f6af27bc9bfec164d7e9c6 (patch)
tree01e4e8f3d03ecaa5fc1c4e7a9af8aadc01e2cf6e /sca-java-2.x/trunk/modules/sca-api/src/main/java
parent8fba4a1b6f3a3699307fb653e5c7a78135b07208 (diff)
TUSCANY-3950 - Catch up with some differences in the OASIS SCA API classes. Tuscany now matches OASIS svn r286
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1174086 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/sca-api/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java2
-rw-r--r--sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java13
-rw-r--r--sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java4
-rw-r--r--sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactory.java3
-rw-r--r--sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactoryFinder.java3
-rw-r--r--sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java36
6 files changed, 39 insertions, 22 deletions
diff --git a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java
index f32289dcb1..294b254229 100644
--- a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java
+++ b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java
@@ -11,7 +11,7 @@ package org.oasisopen.sca;
* <p> The serialized QNames are used with the @Requires annotation
* to specify a policy intent. The policy intent strings in this
* interface do not have a corresponding Java annotation, so these
- * policy intents have ot be specified through the use of the
+ * policy intents have to be specified through the use of the
* @Requires annotation.
*/
public interface Constants {
diff --git a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java
index c1c99de683..0b068febd3 100644
--- a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java
+++ b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java
@@ -1,22 +1,23 @@
/*
- * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
+ * Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca.annotation;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
- * Used to indicate the constructor the runtime is to use when instantiating a component implementation instance
- *
- * @version $Rev$ $Date$
+ * The @Constructor annotation is used to mark a particular
+ * constructor to use when instantiating a Java component
+ * implementation. If this constructor has parameters, each
+ * of these parameters MUST have either a @Property annotation
+ * or a @Reference annotation.
*/
@Target(CONSTRUCTOR)
@Retention(RUNTIME)
public @interface Constructor {
- String[] value() default "";
+
}
diff --git a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java
index 6fca1ab5df..db28ea043c 100644
--- a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java
+++ b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java
@@ -33,12 +33,12 @@ public @interface ManagedTransaction {
* The serialized QName of the managedTransaction.local policy intent,
* for use with the SCA @Requires annotation.
*/
- String MANAGEDTRANSACTION_MESSAGE = MANAGEDTRANSACTION + ".local";
+ String MANAGEDTRANSACTION_LOCAL = MANAGEDTRANSACTION + ".local";
/**
* The serialized QName of the managedTransaction.global policy intent,
* for use with the SCA @Requires annotation.
*/
- String MANAGEDTRANSACTION_TRANSPORT = MANAGEDTRANSACTION + ".global";
+ String MANAGEDTRANSACTION_GLOBAL = MANAGEDTRANSACTION + ".global";
/**
* List of managedTransaction qualifiers (such as "global" or "local").
diff --git a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactory.java b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactory.java
index 9e25d407a5..0922bf3e64 100644
--- a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactory.java
+++ b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactory.java
@@ -145,8 +145,7 @@ public abstract class SCAClientFactory {
* @return a proxy to the target service, in the specified SCA Domain
* that implements the business interface <B>.
* @throws NoSuchServiceException Service requested was not found
- * @throws NoSuchDomainException Domain requested was not found
*/
public abstract <T> T getService(Class<T> interfaze, String serviceURI)
- throws NoSuchServiceException, NoSuchDomainException;
+ throws NoSuchServiceException;
}
diff --git a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactoryFinder.java b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactoryFinder.java
index 54a73fc023..c6bcfd6c28 100644
--- a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactoryFinder.java
+++ b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/SCAClientFactoryFinder.java
@@ -10,7 +10,8 @@ import java.util.Properties;
import org.oasisopen.sca.NoSuchDomainException;
-/* A Service Provider Interface representing a SCAClientFactory finder.
+/**
+ * A Service Provider Interface representing a SCAClientFactory finder.
* SCA provides a default reference implementation of this interface.
* SCA runtime vendors can create alternative implementations of this
* interface that use different class loading or lookup mechanisms.
diff --git a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
index 398360813d..14a02c8b8f 100644
--- a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
+++ b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
@@ -4,6 +4,8 @@
*/
package org.oasisopen.sca.client.impl;
+import org.oasisopen.sca.client.SCAClientFactoryFinder;
+
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
@@ -19,7 +21,6 @@ import java.util.Properties;
import org.oasisopen.sca.NoSuchDomainException;
import org.oasisopen.sca.ServiceRuntimeException;
import org.oasisopen.sca.client.SCAClientFactory;
-import org.oasisopen.sca.client.SCAClientFactoryFinder;
/**
* This is a default implementation of an SCAClientFactoryFinder which is
@@ -61,6 +62,7 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
* instance of the SCAClient
* @param classLoader ClassLoader that may be used when creating a new
* instance of the SCAClient
+ * @param domainURI URI for the Domain to which this client instance is connected
* @return new instance of the SCAClientFactory
* @throws ServiceRuntimeException Failed to create SCAClientFactory
* Implementation.
@@ -79,7 +81,7 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
classLoader);
final SCAClientFactory factory =
instantiateSCAClientFactoryClass(factoryImplClass,
- domainURI );
+ domainURI, properties );
return factory;
}
@@ -89,11 +91,12 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
* @return The Context ClassLoader for the current Thread.
*/
private static ClassLoader getThreadContextClassLoader () {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return Thread.currentThread().getContextClassLoader();
- }
- });
+ return AccessController.doPrivileged(
+ new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
}
/**
@@ -101,6 +104,10 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
* implementation from the specified Properties, the System Properties
* or the specified ClassLoader.
*
+ * @param properties Properties that may be used when creating a new
+ * instance of the SCAClient
+ * @param classLoader ClassLoader that may be used when creating a new
+ * instance of the SCAClient
* @return The class name of the SCAClientFactorySPI implementation
* @throw ServiceRuntimeException Failed to find implementation for
* SCAClientFactorySPI.
@@ -134,6 +141,8 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
* Attempts to find the class name for the SCAClientFactorySPI
* implementation from the specified Properties.
*
+ * @param properties Properties that may be used when creating a new
+ * instance of the SCAClient
* @return The class name for the SCAClientFactorySPI implementation
* or <code>null</code> if not found.
*/
@@ -156,6 +165,8 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
* Attempts to find the class name for the SCAClientFactorySPI
* implementation from the META-INF/services directory
*
+ * @param cl ClassLoader that may be used when creating a new
+ * instance of the SCAClient
* @return The class name for the SCAClientFactorySPI implementation or
* <code>null</code> if not found.
*/
@@ -218,6 +229,8 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
*
* @param factoryImplClassName The name of the SCAClientFactory
* Implementation class to load
+ * @param classLoader ClassLoader that may be used when creating a new
+ * instance of the SCAClient
* @return The specified SCAClientFactory Implementation class
* @throws ServiceRuntimeException Failed to load the SCAClientFactory
* Implementation class
@@ -252,20 +265,23 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
*
* @param factoryImplClass The SCAClientFactorySPI Implementation
* class to instantiate.
+ * @param domainURI URI for the Domain to which this client instance is connected
+ * @param properties Properties that may be used when creating a new
+ * instance of the SCAClient
* @return An instance of the SCAClientFactorySPI Implementation class
* @throws ServiceRuntimeException Failed to instantiate the specified
* specified SCAClientFactorySPI Implementation class
*/
private static SCAClientFactory instantiateSCAClientFactoryClass(
Class<? extends SCAClientFactory> factoryImplClass,
- URI domainURI)
+ URI domainURI, Properties properties)
throws NoSuchDomainException, ServiceRuntimeException {
try {
Constructor<? extends SCAClientFactory> URIConstructor =
- factoryImplClass.getConstructor(URI.class);
+ factoryImplClass.getConstructor(URI.class, Properties.class);
SCAClientFactory provider =
- URIConstructor.newInstance( domainURI );
+ URIConstructor.newInstance( domainURI, properties );
return provider;
} catch (Throwable ex) {
throw new ServiceRuntimeException(