Author: antelder
Date: Sat May 17 03:02:52 2008
New Revision: 657325

URL: http://svn.apache.org/viewvc?rev=657325&view=rev
Log:
Add an EndpointProvider to the Tomcat deep integration as a start of getting 
that to work with the new dynamic endpoint code

Added:
    
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderFactoryImpl.java
   (with props)
    
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderImpl.java
   (with props)
    
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.EndpointProviderFactory

Added: 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderFactoryImpl.java?rev=657325&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderFactoryImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderFactoryImpl.java
 Sat May 17 03:02:52 2008
@@ -0,0 +1,46 @@
+/*
+ * 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.runtime.tomcat;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.EndpointProvider;
+import org.apache.tuscany.sca.provider.EndpointProviderFactory;
+
+/**
+ * The factory for creating endpoint Binding providers
+ */
+public class EndpointProviderFactoryImpl implements 
EndpointProviderFactory<Endpoint> {
+    
+    private ExtensionPointRegistry extensionPoints;
+    
+    public EndpointProviderFactoryImpl(ExtensionPointRegistry extensionPoints) 
{
+        this.extensionPoints = extensionPoints;     
+    } 
+    
+    public EndpointProvider createEndpointProvider(Endpoint endpoint) {
+              
+        return  new EndpointProviderImpl(extensionPoints, endpoint);
+    }
+
+    public Class<Endpoint> getModelType() {
+        return Endpoint.class;
+    }
+}

Propchange: 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderFactoryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderImpl.java?rev=657325&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderImpl.java
 Sat May 17 03:02:52 2008
@@ -0,0 +1,58 @@
+/*
+ * 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.runtime.tomcat;
+
+import java.util.logging.Logger;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.EndpointProvider;
+
+/** 
+ * The endpoint binding provider allows unresolved endpoints to be plumbed into
+ * the runtime start and message send processing as a hook to late resolution
+ * of target services
+ */
+public class EndpointProviderImpl implements EndpointProvider {
+
+    private final static Logger logger = 
Logger.getLogger(EndpointProviderImpl.class.getName());
+
+    private Endpoint endpoint;
+
+    public EndpointProviderImpl(ExtensionPointRegistry extensionPoints,
+                                Endpoint endpoint) {
+        this.endpoint = endpoint;        
+    }
+
+    public void start() {
+        if (endpoint.isUnresolved()){
+            // Resolve the endpoint binding here
+            
+            logger.info("resolving endpoint: " + endpoint.getTargetName());
+        }
+    }
+
+    public void stop() {
+        if (!endpoint.isUnresolved()){
+            // Currently the CompositeActivator stop() should take care of the 
providers and 
+            // wires that have been added. 
+        }
+    }
+}

Propchange: 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/java/org/apache/tuscany/sca/runtime/tomcat/EndpointProviderImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.EndpointProviderFactory
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.EndpointProviderFactory?rev=657325&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.EndpointProviderFactory
 (added)
+++ 
incubator/tuscany/java/sca/modules/runtime-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.EndpointProviderFactory
 Sat May 17 03:02:52 2008
@@ -0,0 +1,19 @@
+# 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. 
+
+# Implementation class for the binding extension
+org.apache.tuscany.sca.runtime.tomcat.EndpointProviderFactoryImpl;model=org.apache.tuscany.sca.assembly.Endpoint


Reply via email to