diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache')
6 files changed, 49 insertions, 43 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java index ed86dc4848..581ae59ae6 100644 --- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java +++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java @@ -18,7 +18,7 @@ */ package org.apache.tuscany.sca.binding.rss.collection; -import org.osoa.sca.annotations.Remotable; +import org.oasisopen.sca.annotation.Remotable; import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndFeed; diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java index 2213b50b53..a2b83465da 100644 --- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java +++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java @@ -20,7 +20,7 @@ package org.apache.tuscany.sca.binding.rss.collection; import java.io.InputStream; -import org.osoa.sca.annotations.Remotable; +import org.oasisopen.sca.annotation.Remotable; import com.sun.syndication.feed.atom.Entry; diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java index 96493a5150..44c84ce5bb 100644 --- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java +++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java @@ -46,7 +46,7 @@ import org.apache.tuscany.sca.invocation.InvocationChain; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.runtime.RuntimeWire; +import org.apache.tuscany.sca.runtime.Invocable; import com.sun.syndication.feed.synd.SyndContent; import com.sun.syndication.feed.synd.SyndContentImpl; @@ -69,7 +69,7 @@ class RSSBindingListenerServlet extends HttpServlet { private static final Logger logger = Logger.getLogger(RSSBindingListenerServlet.class.getName()); private static final long serialVersionUID = 1L; - private RuntimeWire wire; + private Invocable wire; private Invoker getFeedInvoker; private Invoker getAllInvoker; private Invoker queryInvoker; @@ -85,7 +85,7 @@ class RSSBindingListenerServlet extends HttpServlet { * @param wire * @param messageFactory */ - RSSBindingListenerServlet(RuntimeWire wire, MessageFactory messageFactory, Mediator mediator) { + RSSBindingListenerServlet(Invocable wire, MessageFactory messageFactory, Mediator mediator) { this.wire = wire; this.messageFactory = messageFactory; this.mediator = mediator; diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java index d588f041db..e1bafdd3cd 100644 --- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java +++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java @@ -20,8 +20,8 @@ package org.apache.tuscany.sca.binding.rss.provider; import org.apache.tuscany.sca.binding.rss.RSSBinding; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.databinding.Mediator; import org.apache.tuscany.sca.host.http.ServletHost; @@ -30,9 +30,8 @@ import org.apache.tuscany.sca.invocation.MessageFactory; import org.apache.tuscany.sca.provider.BindingProviderFactory; import org.apache.tuscany.sca.provider.ReferenceBindingProvider; import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; +import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; /** * Implementation of the RSS binding provider factory. @@ -48,21 +47,17 @@ public class RSSBindingProviderFactory implements BindingProviderFactory<RSSBind public RSSBindingProviderFactory(ExtensionPointRegistry extensionPoints) { ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class); this.servletHost = servletHosts.getServletHosts().get(0); - ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); this.messageFactory = modelFactories.getFactory(MessageFactory.class); this.mediator = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class).getUtility(Mediator.class); } - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - RSSBinding binding) { - return new RSSReferenceBindingProvider(component, reference, binding); + public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpointReference) { + return new RSSReferenceBindingProvider(endpointReference, mediator); } - public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - RSSBinding binding) { - return new RSSServiceBindingProvider(component, service, binding, servletHost, messageFactory, mediator); + public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) { + return new RSSServiceBindingProvider(endpoint, messageFactory, mediator, servletHost); } public Class<RSSBinding> getModelType() { diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java index 8a30e9d3fb..d234a0c92c 100644 --- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java @@ -19,12 +19,13 @@ package org.apache.tuscany.sca.binding.rss.provider; +import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.binding.rss.RSSBinding; +import org.apache.tuscany.sca.databinding.Mediator; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; /** @@ -34,14 +35,16 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentReference; */ class RSSReferenceBindingProvider implements ReferenceBindingProvider { + private EndpointReference endpointReference; + private RuntimeComponentReference reference; private RSSBinding binding; - RSSReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - RSSBinding binding) { - this.reference = reference; - this.binding = binding; + RSSReferenceBindingProvider(EndpointReference endpointReference, + Mediator mediator) { + this.endpointReference = endpointReference; + this.reference = (RuntimeComponentReference) endpointReference.getReference(); + this.binding = (RSSBinding) endpointReference.getBinding(); } public Invoker createInvoker(Operation operation) { diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java index 4e5429ac83..25ab939341 100644 --- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java @@ -25,9 +25,8 @@ import org.apache.tuscany.sca.host.http.ServletHost; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.invocation.MessageFactory; import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; -import org.apache.tuscany.sca.runtime.RuntimeWire; +import org.apache.tuscany.sca.runtime.Invocable; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; /** * Implementation of the RSS binding provider. @@ -36,28 +35,32 @@ import org.apache.tuscany.sca.runtime.RuntimeWire; */ class RSSServiceBindingProvider implements ServiceBindingProvider { - private RuntimeComponentService service; + private RuntimeEndpoint endpoint; + + //private RuntimeComponentService service; private RSSBinding binding; - private ServletHost servletHost; + private MessageFactory messageFactory; - private String servletMapping; private Mediator mediator; - - RSSServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - RSSBinding binding, - ServletHost servletHost, + private ServletHost servletHost; + + private String servletMapping; + + RSSServiceBindingProvider(RuntimeEndpoint endpoint, MessageFactory messageFactory, - Mediator mediator) { - this.service = service; - this.binding = binding; + Mediator mediator, + ServletHost servletHost) { + this.endpoint = endpoint; + + //this.service = (RuntimeComponentService)endpoint.getService(); + this.binding = (RSSBinding) endpoint.getBinding(); this.servletHost = servletHost; this.messageFactory = messageFactory; this.mediator = mediator; } public InterfaceContract getBindingInterfaceContract() { - return service.getInterfaceContract(); + return endpoint.getComponentTypeServiceInterfaceContract(); } public boolean supportsOneWayInvocation() { @@ -65,17 +68,22 @@ class RSSServiceBindingProvider implements ServiceBindingProvider { } public void start() { - RuntimeComponentService componentService = (RuntimeComponentService)service; - RuntimeWire wire = componentService.getRuntimeWire(binding); + Invocable wire = (RuntimeEndpoint) endpoint; RSSBindingListenerServlet servlet = new RSSBindingListenerServlet(wire, messageFactory, mediator); servletMapping = binding.getURI(); + if (!servletMapping.endsWith("/")) { + servletMapping += "/"; + } + if (!servletMapping.endsWith("*")) { + servletMapping += "*"; + } servletHost.addServletMapping(servletMapping, servlet); - + // Save the actual binding URI in the binding - binding.setURI(servletHost.getURLMapping(binding.getURI()).toString()); + //binding.setURI(servletHost.getURLMapping(binding.getURI()).toString()); } public void stop() { |