tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fm...@apache.org
Subject svn commit: r1150388 - in /tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main: java/org/apache/tuscany/sca/binding/websocket/runtime/WebsocketServiceBindingProvider.java resources/binding-websocket.xsd
Date Sun, 24 Jul 2011 14:49:01 GMT
Author: fmoga
Date: Sun Jul 24 14:49:00 2011
New Revision: 1150388

URL: http://svn.apache.org/viewvc?rev=1150388&view=rev
Log:
Change port attribute to be optional. Set default port to 9000.

Modified:
    tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/java/org/apache/tuscany/sca/binding/websocket/runtime/WebsocketServiceBindingProvider.java
    tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/resources/binding-websocket.xsd

Modified: tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/java/org/apache/tuscany/sca/binding/websocket/runtime/WebsocketServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/java/org/apache/tuscany/sca/binding/websocket/runtime/WebsocketServiceBindingProvider.java?rev=1150388&r1=1150387&r2=1150388&view=diff
==============================================================================
--- tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/java/org/apache/tuscany/sca/binding/websocket/runtime/WebsocketServiceBindingProvider.java
(original)
+++ tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/java/org/apache/tuscany/sca/binding/websocket/runtime/WebsocketServiceBindingProvider.java
Sun Jul 24 14:49:00 2011
@@ -31,6 +31,7 @@ import org.apache.tuscany.sca.runtime.Ru
 
 public class WebsocketServiceBindingProvider implements ServiceBindingProvider {
 
+    private static final int DEFAULT_PORT = 9000;
     private static final String JAVASCRIPT_RESOURCE_PATH = "/org.apache.tuscany.sca.WebsocketComponentContext.js";
     private static Map<Integer, WebSocketServer> servers = new HashMap<Integer,
WebSocketServer>();
     private RuntimeEndpoint endpoint;
@@ -43,7 +44,10 @@ public class WebsocketServiceBindingProv
 
     public void start() {
         WebsocketBinding binding = (WebsocketBinding) endpoint.getBinding();
-        int port = Integer.parseInt(binding.getPort());
+        int port = DEFAULT_PORT;
+        if (binding.getPort() != null) {
+            port = Integer.parseInt(binding.getPort());
+        }
         try {
             WebSocketServer server = initServerForURI(port);
             String component = endpoint.getComponent().getName();

Modified: tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/resources/binding-websocket.xsd
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/resources/binding-websocket.xsd?rev=1150388&r1=1150387&r2=1150388&view=diff
==============================================================================
--- tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/resources/binding-websocket.xsd
(original)
+++ tuscany/sca-java-2.x/contrib/modules/binding-websocket/src/main/resources/binding-websocket.xsd
Sun Jul 24 14:49:00 2011
@@ -30,7 +30,7 @@
     <complexType name="WebsocketBinding">
         <complexContent>
             <extension base="sca:Binding">
-                <attribute name="port" type="string" use="required"/>
+                <attribute name="port" type="string" use="optional"/>
             </extension>
         </complexContent>
     </complexType>



Mime
View raw message