You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/10/29 02:36:00 UTC

svn commit: r589463 - in /incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch: SCADomainControllerLauncher.java SCADomainLauncher.java

Author: jsdelfino
Date: Sun Oct 28 18:36:00 2007
New Revision: 589463

URL: http://svn.apache.org/viewvc?rev=589463&view=rev
Log:
Refactored domain controller launcher.

Added:
    incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainControllerLauncher.java
      - copied, changed from r589390, incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainLauncher.java
Removed:
    incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainLauncher.java

Copied: incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainControllerLauncher.java (from r589390, incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainLauncher.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainControllerLauncher.java?p2=incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainControllerLauncher.java&p1=incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainLauncher.java&r1=589390&r2=589463&rev=589463&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainLauncher.java (original)
+++ incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/launch/SCADomainControllerLauncher.java Sun Oct 28 18:36:00 2007
@@ -28,7 +28,7 @@
 import org.apache.tuscany.sca.domain.SCADomain;
 import org.apache.tuscany.sca.domain.SCADomainFactory;
 
-public class SCADomainLauncher {
+public class SCADomainControllerLauncher {
 
     /**
      * @param args
@@ -64,49 +64,4 @@
         System.exit(0);
     }
     
-    private static final String PING_HEADER =
-        "GET / HTTP/1.0\n" + "Host: localhost\n"
-            + "Content-Type: text/xml\n"
-            + "Connection: close\n"
-            + "Content-Length: ";
-    private static final String PING_CONTENT = "";
-    private static final String PING =
-        PING_HEADER + PING_CONTENT.getBytes().length + "\n\n" + PING_CONTENT;
-
-    /**
-     * Ping the domain controller at http://localhost:9999
-     * 
-     * @return true if the domain is there, false otherwise
-     * @throws IOException
-     */
-    public static boolean pingDomain() throws IOException {
-        try {
-            Socket client = new Socket("localhost", 9999);
-            OutputStream os = client.getOutputStream();
-            os.write(PING.getBytes());
-            os.flush();
-            read(client);
-            return true;
-        } catch (IOException e) {
-            return false;
-        }
-    }
-
-    private static String read(Socket socket) throws IOException {
-        BufferedReader reader = null;
-        try {
-            reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
-            StringBuffer sb = new StringBuffer();
-            String str;
-            while ((str = reader.readLine()) != null) {
-                sb.append(str);
-            }
-            return sb.toString();
-        } finally {
-            if (reader != null) {
-                reader.close();
-            }
-        }
-    }
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org