summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-14 00:50:38 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-14 00:50:38 +0000
commitb4f48f407a8fefba16395eceb34de6bd48e74d12 (patch)
tree7e1bcf4456ef1dfd3b4d337ed7ea262f1259ffef /sca-java-2.x/trunk/modules/core/src
parent014971ccb5b2041147cf9d84d498cce64ea0493e (diff)
Improve the IP address binding to be based on the host from the uri
Having servlet host to return deployed uri git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@922701 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core/src')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java3
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java9
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java7
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java11
4 files changed, 14 insertions, 16 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
index fc2c6bbdfb..4829bab095 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
@@ -43,7 +43,6 @@ import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint;
import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
@@ -92,7 +91,7 @@ public class ComponentContextImpl implements RuntimeComponentContext {
this.requestContextFactory =
registry.getExtensionPoint(ContextFactoryExtensionPoint.class).getFactory(RequestContextFactory.class);
- this.proxyFactory = new ExtensibleProxyFactory(registry.getExtensionPoint(ProxyFactoryExtensionPoint.class));
+ this.proxyFactory = ExtensibleProxyFactory.getInstance(registry);
this.propertyFactory = factories.getFactory(PropertyValueFactory.class);
this.eprBinder = utilities.getUtility(EndpointReferenceBinder.class);
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java
index c6a6ecd9c0..cdb510f7ec 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java
@@ -25,10 +25,6 @@ import javax.security.auth.Subject;
import org.apache.tuscany.sca.assembly.Endpoint;
import org.apache.tuscany.sca.assembly.EndpointReference;
import org.apache.tuscany.sca.context.ThreadMessageContext;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.invocation.Message;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
@@ -43,11 +39,7 @@ import org.oasisopen.sca.ServiceReference;
*/
public class RequestContextImpl implements RequestContext {
- private ProxyFactoryExtensionPoint proxyFactoryExtensionPoint;
-
public RequestContextImpl(RuntimeComponent component) {
- ExtensionPointRegistry registry = component.getComponentContext().getExtensionPointRegistry();
- proxyFactoryExtensionPoint = registry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
}
public Subject getSecuritySubject() {
@@ -97,7 +89,6 @@ public class RequestContextImpl implements RequestContext {
JavaInterface javaInterface = (JavaInterface) callbackReference.getInterfaceContract().getInterface();
Class<CB> javaClass = (Class<CB>)javaInterface.getJavaClass();
List<EndpointReference> wires = callbackReference.getEndpointReferences();
- ProxyFactory proxyFactory = new ExtensibleProxyFactory(proxyFactoryExtensionPoint);
ServiceReferenceImpl ref = new CallbackServiceReferenceImpl(javaClass, wires);
return ref;
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java
index 5edf357e60..5d6719bc81 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java
@@ -51,7 +51,6 @@ import org.apache.tuscany.sca.core.context.ServiceReferenceExt;
import org.apache.tuscany.sca.core.factory.ObjectCreationException;
import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint;
import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
@@ -126,7 +125,7 @@ public class ServiceReferenceImpl<B> implements ServiceReferenceExt<B> {
this.staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
this.staxProcessor = staxProcessors.getProcessor(EndpointReference.class);
this.builders = registry.getExtensionPoint(BuilderExtensionPoint.class);
- this.proxyFactory = new ExtensibleProxyFactory(registry.getExtensionPoint(ProxyFactoryExtensionPoint.class));
+ this.proxyFactory = ExtensibleProxyFactory.getInstance(registry);
}
public RuntimeEndpointReference getEndpointReference() {
@@ -412,9 +411,7 @@ public class ServiceReferenceImpl<B> implements ServiceReferenceExt<B> {
private ProxyFactory getProxyFactory(CompositeContext compositeContext) {
ExtensionPointRegistry extensionPointRegistry = compositeContext.getExtensionPointRegistry();
- ProxyFactoryExtensionPoint proxyFactories =
- extensionPointRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
- return new ExtensibleProxyFactory(proxyFactories);
+ return ExtensibleProxyFactory.getInstance(extensionPointRegistry);
}
// ==================================================================================
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java
index 7f476b2fa5..bbbd3a9391 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java
@@ -21,6 +21,8 @@ package org.apache.tuscany.sca.core.invocation;
import java.util.List;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.runtime.Invocable;
import org.oasisopen.sca.ServiceReference;
@@ -37,6 +39,15 @@ public class ExtensibleProxyFactory implements ProxyFactory {
this.proxyFactories = proxyFactories;
}
+ public ExtensibleProxyFactory(ExtensionPointRegistry registry) {
+ this.proxyFactories = registry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
+ }
+
+ public static ExtensibleProxyFactory getInstance(ExtensionPointRegistry registry) {
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ return utilities.getUtility(ExtensibleProxyFactory.class);
+ }
+
/**
* @see org.apache.tuscany.sca.core.invocation.ProxyFactory#cast(java.lang.Object)
*/