Adding swt and socket frontends
This commit is contained in:
4
gclc-socket/.gitignore
vendored
Normal file
4
gclc-socket/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/target/
|
||||
/.settings/
|
||||
/.classpath
|
||||
/.project
|
||||
105
gclc-socket/pom.xml
Normal file
105
gclc-socket/pom.xml
Normal file
@@ -0,0 +1,105 @@
|
||||
|
||||
<!-- Copyright E. Bigeon (2014) -->
|
||||
<!-- -->
|
||||
<!-- emmanuel@bigeon.fr -->
|
||||
<!-- -->
|
||||
<!-- This software is a computer program whose purpose is to -->
|
||||
<!-- Socket implementation of GCLC. -->
|
||||
<!-- -->
|
||||
<!-- This software is governed by the CeCILL license under French law and -->
|
||||
<!-- abiding by the rules of distribution of free software. You can use, -->
|
||||
<!-- modify and/or redistribute the software under the terms of the CeCILL -->
|
||||
<!-- license as circulated by CEA, CNRS and INRIA at the following URL -->
|
||||
<!-- "http://www.cecill.info". -->
|
||||
<!-- -->
|
||||
<!-- As a counterpart to the access to the source code and rights to copy, -->
|
||||
<!-- modify and redistribute granted by the license, users are provided only -->
|
||||
<!-- with a limited warranty and the software's author, the holder of the -->
|
||||
<!-- economic rights, and the successive licensors have only limited -->
|
||||
<!-- liability. -->
|
||||
<!-- -->
|
||||
<!-- In this respect, the user's attention is drawn to the risks associated -->
|
||||
<!-- with loading, using, modifying and/or developing or reproducing the -->
|
||||
<!-- software by the user in light of its specific status of free software, -->
|
||||
<!-- that may mean that it is complicated to manipulate, and that also -->
|
||||
<!-- therefore means that it is reserved for developers and experienced -->
|
||||
<!-- professionals having in-depth computer knowledge. Users are therefore -->
|
||||
<!-- encouraged to load and test the software's suitability as regards their -->
|
||||
<!-- requirements in conditions enabling the security of their systems and/or -->
|
||||
<!-- data to be ensured and, more generally, to use and operate it in the -->
|
||||
<!-- same conditions as regards security. -->
|
||||
<!-- -->
|
||||
<!-- The fact that you are presently reading this means that you have had -->
|
||||
<!-- knowledge of the CeCILL license and that you accept its terms. -->
|
||||
|
||||
|
||||
<!-- Copyright E. Bigeon (2014) -->
|
||||
<!-- -->
|
||||
<!-- emmanuel@bigeon.fr -->
|
||||
<!-- -->
|
||||
<!-- This software is a computer program whose purpose is to -->
|
||||
<!-- Defines the distribution repositories and basic setup for projects
|
||||
of Emmanuel Bigeon. -->
|
||||
<!-- -->
|
||||
<!-- This software is governed by the CeCILL license under French law and -->
|
||||
<!-- abiding by the rules of distribution of free software. You can use, -->
|
||||
<!-- modify and/or redistribute the software under the terms of the CeCILL -->
|
||||
<!-- license as circulated by CEA, CNRS and INRIA at the following URL -->
|
||||
<!-- "http://www.cecill.info". -->
|
||||
<!-- -->
|
||||
<!-- As a counterpart to the access to the source code and rights to copy, -->
|
||||
<!-- modify and redistribute granted by the license, users are provided only -->
|
||||
<!-- with a limited warranty and the software's author, the holder of the -->
|
||||
<!-- economic rights, and the successive licensors have only limited -->
|
||||
<!-- liability. -->
|
||||
<!-- -->
|
||||
<!-- In this respect, the user's attention is drawn to the risks associated -->
|
||||
<!-- with loading, using, modifying and/or developing or reproducing the -->
|
||||
<!-- software by the user in light of its specific status of free software, -->
|
||||
<!-- that may mean that it is complicated to manipulate, and that also -->
|
||||
<!-- therefore means that it is reserved for developers and experienced -->
|
||||
<!-- professionals having in-depth computer knowledge. Users are therefore -->
|
||||
<!-- encouraged to load and test the software's suitability as regards their -->
|
||||
<!-- requirements in conditions enabling the security of their systems and/or -->
|
||||
<!-- data to be ensured and, more generally, to use and operate it in the -->
|
||||
<!-- same conditions as regards security. -->
|
||||
<!-- -->
|
||||
<!-- The fact that you are presently reading this means that you have had -->
|
||||
<!-- knowledge of the CeCILL license and that you accept its terms. -->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>gclc-socket</artifactId>
|
||||
<version>1.0.2-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<url>http://www.bigeon.fr/emmanuel</url>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.bigeon</groupId>
|
||||
<artifactId>gclc</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.bigeon</groupId>
|
||||
<artifactId>smu</artifactId>
|
||||
<version>0.0.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<parent>
|
||||
<groupId>fr.bigeon</groupId>
|
||||
<artifactId>ebigeon-config</artifactId>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<name>GCLC Socket</name>
|
||||
<description>Socket implementation of GCLC</description>
|
||||
</project>
|
||||
@@ -0,0 +1,278 @@
|
||||
/*
|
||||
* Copyright E. Bigeon (2014)
|
||||
*
|
||||
* emmanuel@bigeon.fr
|
||||
*
|
||||
* This software is a computer program whose purpose is to
|
||||
* Socket implementation of GCLC.
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited
|
||||
* liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
*
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*/
|
||||
package fr.bigeon.gclc.socket;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PipedInputStream;
|
||||
import java.io.PipedOutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.Arrays;
|
||||
|
||||
import fr.bigeon.gclc.ConsoleApplication;
|
||||
import fr.bigeon.gclc.ConsoleManager;
|
||||
import fr.bigeon.smu.StringEncoder;
|
||||
|
||||
/** This is a socket communicating console consoleManager
|
||||
* <p>
|
||||
* To use this application, the following flow should be used:
|
||||
*
|
||||
* <pre>
|
||||
* SocketConsoleApplicationShell shell = new SocketConsoleApplicationShell();
|
||||
* ConsoleApplication myApplication = new MyConsoleApplication(shell.getConsoleManager(), ...);
|
||||
* shell.setApplication(myApplication);
|
||||
* Thread th = new Thread(shell);
|
||||
* th.start();
|
||||
* </pre>
|
||||
* <p>
|
||||
* This will start the application in a separate thread. The application will be
|
||||
* listening on the given socket and writing back on it. If this is all your
|
||||
* application, you should then {@link Thread#join()} the thread to wait for the
|
||||
* end of the execution.
|
||||
*
|
||||
* @author Emmanuel Bigeon */
|
||||
public class SocketConsoleApplicationShell implements Runnable {
|
||||
|
||||
/** The end of line character */
|
||||
protected static final String EOL = "\n"; //$NON-NLS-1$
|
||||
/** The encoder */
|
||||
private static final StringEncoder ENCODER = new StringEncoder("%", Arrays.asList(EOL)); //$NON-NLS-1$
|
||||
/** The listening port */
|
||||
private final int port;
|
||||
/** The output */
|
||||
private PrintWriter output;
|
||||
/** The input reader */
|
||||
private BufferedReader input;
|
||||
/** The input */
|
||||
private final PipedInputStream consoleInput = new PipedInputStream();
|
||||
/** The application */
|
||||
private ConsoleApplication app;
|
||||
/** The session closing command */
|
||||
private final String close;
|
||||
/** The running status */
|
||||
private boolean running;
|
||||
/** If the prompt should be next activity */
|
||||
private boolean doPrompt = false;
|
||||
/** An object to lock on for prompt */
|
||||
private final Object promptingLock = new Object();
|
||||
|
||||
/** The console manager implementation */
|
||||
private final ConsoleManager consoleManager = new ConsoleManager() {
|
||||
|
||||
private String prompt = new String();
|
||||
private StringBuffer buffer = new StringBuffer();
|
||||
|
||||
@Override
|
||||
public void setPrompt(String prompt) {
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
@SuppressWarnings("synthetic-access")
|
||||
@Override
|
||||
public String prompt(String message) {
|
||||
buffer.append(message);
|
||||
String userInput = new String();
|
||||
boolean prompting = true;
|
||||
while (prompting) {
|
||||
output.println(ENCODER.encode(buffer.toString()));
|
||||
try {
|
||||
synchronized (promptingLock) {
|
||||
doPrompt = true;
|
||||
promptingLock.notify();
|
||||
}
|
||||
userInput = input.readLine();
|
||||
doPrompt = false;
|
||||
prompting = false;
|
||||
} catch (final IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
buffer = new StringBuffer();
|
||||
return userInput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String prompt() {
|
||||
return prompt(prompt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void println(String message) {
|
||||
buffer.append(message + EOL);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void println() {
|
||||
buffer.append(EOL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(String text) {
|
||||
buffer.append(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrompt() {
|
||||
return prompt;
|
||||
}
|
||||
};
|
||||
/** The auto close flag. if this is true, every request closes the session
|
||||
* after its call */
|
||||
private final boolean autoClose;
|
||||
|
||||
/** The runnable class that will actually have the application running.
|
||||
*
|
||||
* @author Emmanuel Bigeon */
|
||||
private class ConsoleRunnable implements Runnable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public ConsoleRunnable() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Runnable#run() */
|
||||
@SuppressWarnings("synthetic-access")
|
||||
@Override
|
||||
public void run() {
|
||||
running = true;
|
||||
app.start();
|
||||
running = false;
|
||||
synchronized (promptingLock) {
|
||||
promptingLock.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** TODO Describe SocketConsoleApplicationShell.java Constructor
|
||||
*
|
||||
* @param port the port to listen to
|
||||
* @param close the session closing command */
|
||||
public SocketConsoleApplicationShell(int port, String close) {
|
||||
this.port = port;
|
||||
this.close = close;
|
||||
this.autoClose = false;
|
||||
}
|
||||
|
||||
/** TODO Describe SocketConsoleApplicationShell.java Constructor
|
||||
*
|
||||
* @param port the port to listen to
|
||||
* @param autoClose if the session must be closed once the request has been
|
||||
* sent */
|
||||
public SocketConsoleApplicationShell(int port, boolean autoClose) {
|
||||
this.port = port;
|
||||
this.close = null;
|
||||
this.autoClose = autoClose;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Runnable#run() */
|
||||
@Override
|
||||
public void run() {
|
||||
try (ServerSocket serverSocket = new ServerSocket(port)) {
|
||||
final ConsoleRunnable runnable = new ConsoleRunnable();
|
||||
final Thread appTh = new Thread(runnable);
|
||||
running = true;
|
||||
try (PipedOutputStream outStream = new PipedOutputStream();
|
||||
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outStream))) {
|
||||
consoleInput.connect(outStream);
|
||||
try (BufferedReader inBuf = new BufferedReader(new InputStreamReader(consoleInput))) {
|
||||
input = inBuf;
|
||||
while (running) {
|
||||
try (Socket clientSocket = serverSocket.accept();
|
||||
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
|
||||
BufferedReader in = new BufferedReader(
|
||||
new InputStreamReader(clientSocket.getInputStream()));) {
|
||||
output = out;
|
||||
// Initiate application
|
||||
if (!appTh.isAlive()) {
|
||||
appTh.start();
|
||||
} else {
|
||||
output.println("Reconnected"); //$NON-NLS-1$
|
||||
}
|
||||
synchronized (promptingLock) {
|
||||
String ln;
|
||||
if (!doPrompt) try {
|
||||
promptingLock.wait();
|
||||
} catch (final InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
while (running && (ln = in.readLine()) != null) {
|
||||
if (ln.equals(close)) {
|
||||
break;
|
||||
}
|
||||
writer.write(ln + EOL);
|
||||
writer.flush();
|
||||
try {
|
||||
promptingLock.wait();
|
||||
} catch (final InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (autoClose) running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/** @return the consoleManager */
|
||||
public synchronized ConsoleManager getConsoleManager() {
|
||||
return consoleManager;
|
||||
}
|
||||
|
||||
/** @param app the application to set */
|
||||
public synchronized void setApplication(ConsoleApplication app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright E. Bigeon (2014)
|
||||
*
|
||||
* emmanuel@bigeon.fr
|
||||
*
|
||||
* This software is a computer program whose purpose is to
|
||||
* Socket implementation of GCLC.
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited
|
||||
* liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
*
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*/
|
||||
package fr.bigeon.gclc.socket;
|
||||
|
||||
import fr.bigeon.gclc.ConsoleApplication;
|
||||
import fr.bigeon.gclc.ConsoleManager;
|
||||
import fr.bigeon.gclc.command.Command;
|
||||
import fr.bigeon.gclc.exception.InvalidCommandName;
|
||||
|
||||
/** TODO Describe ConsoleTestApplication.java
|
||||
* @author Emmanuel Bigeon
|
||||
*
|
||||
*/
|
||||
public class ConsoleTestApplication extends ConsoleApplication {
|
||||
|
||||
/** @param manager the manager */
|
||||
@SuppressWarnings("nls")
|
||||
public ConsoleTestApplication(final ConsoleManager manager) {
|
||||
super(manager, "exit",
|
||||
"Welcome to the test application. Type help or test.",
|
||||
"See you");
|
||||
addHelpCommand("help");
|
||||
try {
|
||||
add(new Command("test") {
|
||||
|
||||
@Override
|
||||
public String tip() {
|
||||
return "A test command";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(String... args) {
|
||||
manager.println("Test command ran fine");
|
||||
}
|
||||
});
|
||||
} catch (final InvalidCommandName e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright E. Bigeon (2014)
|
||||
*
|
||||
* emmanuel@bigeon.fr
|
||||
*
|
||||
* This software is a computer program whose purpose is to
|
||||
* Socket implementation of GCLC.
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited
|
||||
* liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
*
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*/
|
||||
package fr.bigeon.gclc.socket;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import fr.bigeon.smu.StringEncoder;
|
||||
|
||||
/** TODO Describe TestConsoleClient.java
|
||||
* @author Emmanuel Bigeon
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class TestConsoleClient {
|
||||
@SuppressWarnings("javadoc")
|
||||
private static final Collection<String> TO_ENCODE = new ArrayList<>();
|
||||
static {
|
||||
TO_ENCODE.add("\n");
|
||||
}
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
private static final StringEncoder ENCODER = new StringEncoder("%",
|
||||
TO_ENCODE);
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public static void main(String[] args) {
|
||||
final String hostName = "127.0.0.1";
|
||||
final int portNumber = 3300;
|
||||
|
||||
try (Socket kkSocket = new Socket(hostName, portNumber);
|
||||
PrintWriter out = new PrintWriter(kkSocket.getOutputStream(),
|
||||
true);
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(
|
||||
kkSocket.getInputStream()));) {
|
||||
|
||||
String fromServer;
|
||||
while ((fromServer = in.readLine()) != null) {
|
||||
System.out.println("Server: \n" + ENCODER.decode(fromServer));
|
||||
if (fromServer.equals("Bye.")) {
|
||||
break;
|
||||
}
|
||||
|
||||
final BufferedReader stdIn = new BufferedReader(
|
||||
new InputStreamReader(System.in));
|
||||
final String fromUser = stdIn.readLine();
|
||||
if (fromUser != null) {
|
||||
System.out.println("Client: " + fromUser);
|
||||
out.println(fromUser);
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright E. Bigeon (2014)
|
||||
*
|
||||
* emmanuel@bigeon.fr
|
||||
*
|
||||
* This software is a computer program whose purpose is to
|
||||
* Socket implementation of GCLC.
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited
|
||||
* liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
*
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*/
|
||||
package fr.bigeon.gclc.socket;
|
||||
|
||||
/** TODO Describe TestServer.java
|
||||
* @author Emmanuel Bigeon
|
||||
*
|
||||
*/
|
||||
public class TestServer {
|
||||
/** @param args no argument */
|
||||
@SuppressWarnings("nls")
|
||||
public static void main(String[] args) {
|
||||
final SocketConsoleApplicationShell shell = new SocketConsoleApplicationShell(
|
||||
3300, "close");
|
||||
final ConsoleTestApplication app = new ConsoleTestApplication(
|
||||
shell.getConsoleManager());
|
||||
shell.setApplication(app);
|
||||
final Thread serverTh = new Thread(shell, "gclcServer");
|
||||
serverTh.start();
|
||||
try {
|
||||
serverTh.join();
|
||||
} catch (final InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user