summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/implementation-java-runtime
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-11-06 23:44:24 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-11-06 23:44:24 +0000
commitce411305c2393b081bb9b7fa0ce507ce31e81ff7 (patch)
tree296df39cea30ad4f227948a93b84ef8be7660edb /branches/sca-java-1.x/modules/implementation-java-runtime
parent8a46e95703d3f8fc9609e6e5d0cb84eb26003203 (diff)
Improve performance by indexing invocation chains by operation and caching Java instanceFactory
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@833606 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/implementation-java-runtime')
-rw-r--r--branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java b/branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
index 29e02da648..65bff6efdb 100644
--- a/branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
+++ b/branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
@@ -51,6 +51,7 @@ import org.apache.tuscany.sca.core.invocation.WireObjectFactory;
import org.apache.tuscany.sca.core.scope.ScopeContainer;
import org.apache.tuscany.sca.core.scope.TargetResolutionException;
import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
+import org.apache.tuscany.sca.implementation.java.context.InstanceFactory;
import org.apache.tuscany.sca.implementation.java.impl.JavaConstructorImpl;
import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
@@ -78,6 +79,7 @@ public class JavaComponentContextProvider {
private RuntimeComponent component;
private JavaInstanceFactoryProvider<?> instanceFactoryProvider;
private ProxyFactory proxyFactory;
+ private InstanceFactory instanceFactory;
public JavaComponentContextProvider(RuntimeComponent component,
JavaInstanceFactoryProvider configuration,
@@ -99,7 +101,7 @@ public class JavaComponentContextProvider {
}
InstanceWrapper<?> createInstanceWrapper() throws ObjectCreationException {
- return instanceFactoryProvider.createFactory().newInstance();
+ return instanceFactory.newInstance();
}
void configureProperties(List<ComponentProperty> definedProperties) {
@@ -272,6 +274,8 @@ public class JavaComponentContextProvider {
ccImpl.setPropertyValueFactory(propertyValueFactory);
//setUpPolicyHandlers();
+ this.instanceFactory = instanceFactoryProvider.createFactory();
+
}
void addResourceFactory(String name, ObjectFactory<?> factory) {