servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r487193 - in /incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src: main/java/org/apache/servicemix/file/ test/resources/
Date Thu, 14 Dec 2006 12:42:33 GMT
Author: gnodet
Date: Thu Dec 14 04:42:32 2006
New Revision: 487193

URL: http://svn.apache.org/viewvc?view=rev&rev=487193
Log:
Use a marker interface to generate a clean XSD and keep a single endpoints properties for
all endpoints.

Added:
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpointType.java
  (with props)
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
      - copied, changed from r481753, incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollingEndpoint.java
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileSenderEndpoint.java
      - copied, changed from r481753, incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpoint.java
Removed:
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpoint.java
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollingEndpoint.java
Modified:
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileComponent.java
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring-polling.xml
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring.xml

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileComponent.java?view=diff&rev=487193&r1=487192&r2=487193
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileComponent.java
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileComponent.java
Thu Dec 14 04:42:32 2006
@@ -18,7 +18,6 @@
 
 import java.io.File;
 import java.net.URI;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -37,41 +36,29 @@
  */
 public class FileComponent extends DefaultComponent {
 
-    private FileEndpoint[] endpoints;
-    private FilePollingEndpoint[] pollingEndpoints;
+    private FileEndpointType[] endpoints;
 
-    public FileEndpoint[] getEndpoints() {
+    public FileEndpointType[] getEndpoints() {
         return endpoints;
     }
 
-    public void setEndpoints(FileEndpoint[] endpoints) {
+    public void setEndpoints(FileEndpointType[] endpoints) {
         this.endpoints = endpoints;
     }
 
 
-    public FilePollingEndpoint[] getPollingEndpoints() {
-        return pollingEndpoints;
-    }
-
-    public void setPollingEndpoints(FilePollingEndpoint[] pollingEndpoints) {
-        this.pollingEndpoints = pollingEndpoints;
-    }
-
     protected List getConfiguredEndpoints() {
-        List answer = new ArrayList();
-        answer.addAll(asList(getEndpoints()));
-        answer.addAll(asList(getPollingEndpoints()));
-        return answer;
+        return asList(getEndpoints());
     }
 
     protected Class[] getEndpointClasses() {
-        return new Class[]{FileEndpoint.class, FilePollingEndpoint.class};
+        return new Class[]{ FilePollerEndpoint.class, FileSenderEndpoint.class };
     }
 
     protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception {
         // We receive an exchange for an EPR that has not been used yet.
         // Register a provider endpoint and restart processing.
-        FileEndpoint fileEp = new FileEndpoint(this, ep);
+        FileSenderEndpoint fileEp = new FileSenderEndpoint(this, ep);
 
         // TODO
         //fileEp.setRole(MessageExchange.Role.PROVIDER);

Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpointType.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpointType.java?view=auto&rev=487193
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpointType.java
(added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpointType.java
Thu Dec 14 04:42:32 2006
@@ -0,0 +1,26 @@
+/*
+ * 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.servicemix.file;
+
+/**
+ * Marker interface for File endpoints
+ * 
+ * @author gnodet
+ */
+public interface FileEndpointType {
+
+}

Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpointType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpointType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpointType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
(from r481753, incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollingEndpoint.java)
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java?view=diff&rev=487193&p1=incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollingEndpoint.java&r1=481753&p2=incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java&r2=487193
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollingEndpoint.java
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
Thu Dec 14 04:42:32 2006
@@ -45,11 +45,11 @@
  * and sends the files into the JBI bus as messages, deleting the files
  * by default when they are processed.
  *
- * @org.apache.xbean.XBean element="pollingEndpoint"
+ * @org.apache.xbean.XBean element="poller"
  *
  * @version $Revision$
  */
-public class FilePollingEndpoint extends PollingEndpoint {
+public class FilePollerEndpoint extends PollingEndpoint implements FileEndpointType {
 
     private File file;
     private FileFilter filter;
@@ -59,14 +59,14 @@
     private FileMarshaler marshaler = new DefaultFileMarshaler();
     private LockManager lockManager;
 
-    public FilePollingEndpoint() {
+    public FilePollerEndpoint() {
     }
 
-    public FilePollingEndpoint(ServiceUnit serviceUnit, QName service, String endpoint) {
+    public FilePollerEndpoint(ServiceUnit serviceUnit, QName service, String endpoint) {
         super(serviceUnit, service, endpoint);
     }
 
-    public FilePollingEndpoint(DefaultComponent component, ServiceEndpoint endpoint) {
+    public FilePollerEndpoint(DefaultComponent component, ServiceEndpoint endpoint) {
         super(component, endpoint);
     }
 

Copied: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileSenderEndpoint.java
(from r481753, incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpoint.java)
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileSenderEndpoint.java?view=diff&rev=487193&p1=incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpoint.java&r1=481753&p2=incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileSenderEndpoint.java&r2=487193
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileEndpoint.java
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FileSenderEndpoint.java
Thu Dec 14 04:42:32 2006
@@ -29,11 +29,12 @@
 /**
  * An endpoint which receives a message and writes the content to a file.
  *
- * @org.apache.xbean.XBean element="endpoint"
+ * @org.apache.xbean.XBean element="sender"
  *
  * @version $Revision: $
 */
-public class FileEndpoint extends ProviderEndpoint {
+public class FileSenderEndpoint extends ProviderEndpoint implements FileEndpointType {
+
     private File directory;
     private FileMarshaler marshaler = new DefaultFileMarshaler();
     private String tempFilePrefix = "servicemix-";
@@ -41,10 +42,10 @@
     private boolean autoCreateDirectory = true;
 
 
-    public FileEndpoint() {
+    public FileSenderEndpoint() {
     }
 
-    public FileEndpoint(FileComponent component, ServiceEndpoint endpoint) {
+    public FileSenderEndpoint(FileComponent component, ServiceEndpoint endpoint) {
         super(component, endpoint);
     }
 

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring-polling.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring-polling.xml?view=diff&rev=487193&r1=487192&r2=487193
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring-polling.xml
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring-polling.xml
Thu Dec 14 04:42:32 2006
@@ -29,17 +29,15 @@
       	<sm:component>
             <file:component>
             	<file:endpoints>
-                <file:endpoint service="test:service"
-                               endpoint="endpoint"
-                               directory="file:target/pollerFiles" />
-            	</file:endpoints>
+                <file:sender service="test:service"
+                             endpoint="endpoint"
+                             directory="file:target/pollerFiles" />
               
-              <file:pollingEndpoints>
-                <file:pollingEndpoint service="test:poller"
-                                      endpoint="poller"
-                                      targetService="test:receiver"
-                                      file="file:target/pollerFiles" />
-              </file:pollingEndpoints>
+                <file:poller service="test:poller"
+                             endpoint="poller"
+                             targetService="test:receiver"
+                             file="file:target/pollerFiles" />
+            	</file:endpoints>
             </file:component>
         </sm:component>
       </sm:activationSpec>

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring.xml?view=diff&rev=487193&r1=487192&r2=487193
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring.xml
(original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-file/src/test/resources/spring.xml
Thu Dec 14 04:42:32 2006
@@ -29,7 +29,7 @@
       	<sm:component>
             <file:component>
             	<file:endpoints>
-            		<file:endpoint service="test:service" endpoint="endpoint" directory="file:target/componentOutput">
+            		<file:sender service="test:service" endpoint="endpoint" directory="file:target/componentOutput">
                   <file:marshaler>
                     <sm:defaultFileMarshaler>
                       <sm:fileName>
@@ -38,7 +38,7 @@
                       </sm:fileName>
                     </sm:defaultFileMarshaler>
                   </file:marshaler>
-                </file:endpoint>
+                </file:sender>
             	</file:endpoints>
             </file:component>
         </sm:component>



Mime
View raw message