Compare commits

...

9 Commits

Author SHA1 Message Date
89847738e5 [maven-release-plugin] prepare release gclc-socket-1.1.11 2018-10-15 09:35:58 -04:00
cd76d438c1 Update config
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
2018-10-15 09:34:59 -04:00
fa46939c54 Added doc. Clean up code
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
2018-10-15 09:34:51 -04:00
fe4851053a Update configurations
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
2018-10-15 09:14:06 -04:00
6a7d0b11a0 Removed thread sleeping lock
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
2018-10-15 09:10:31 -04:00
93589c750e Reformatting
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
2018-10-14 23:07:41 -04:00
c23af20b17 Update version of configuration
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
2018-10-14 19:05:49 -04:00
c7625c8006 Update dependencies, organize imports
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
2018-10-14 18:58:17 -04:00
ad65165169 [maven-release-plugin] prepare for next development iteration 2018-10-14 18:28:48 -04:00
45 changed files with 765 additions and 817 deletions

View File

@@ -49,13 +49,13 @@
<parent> <parent>
<groupId>net.bigeon.config</groupId> <groupId>net.bigeon.config</groupId>
<artifactId>ebigeon-config</artifactId> <artifactId>ebigeon-config</artifactId>
<version>1.8.9</version> <version>1.8.12</version>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>net.bigeon</groupId> <groupId>net.bigeon</groupId>
<artifactId>gclc</artifactId> <artifactId>gclc</artifactId>
<version>2.0.7</version> <version>2.0.9</version>
</dependency> </dependency>
</dependencies> </dependencies>
@@ -68,11 +68,6 @@
</licenses> </licenses>
<reporting> <reporting>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
</plugin>
<plugin> <plugin>
<groupId>com.github.sevntu-checkstyle</groupId> <groupId>com.github.sevntu-checkstyle</groupId>
<artifactId>dsm-maven-plugin</artifactId> <artifactId>dsm-maven-plugin</artifactId>
@@ -92,7 +87,7 @@
</developers> </developers>
<scm> <scm>
<tag>process-0.0.1</tag> <tag>HEAD</tag>
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection> <developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
</scm> </scm>
</project> </project>

View File

@@ -72,10 +72,7 @@ import java.util.Arrays;
import net.bigeon.gclc.command.ICommand; import net.bigeon.gclc.command.ICommand;
import net.bigeon.gclc.exception.CommandRunException; import net.bigeon.gclc.exception.CommandRunException;
/** /** @author Emmanuel Bigeon */
* @author Emmanuel Bigeon
*
*/
public class ForkCommandTask extends ForkTask { public class ForkCommandTask extends ForkTask {
private final ICommand command; private final ICommand command;
private final String[] args; private final String[] args;
@@ -89,13 +86,6 @@ public class ForkCommandTask extends ForkTask {
this.args = Arrays.copyOf(args, args.length); this.args = Arrays.copyOf(args, args.length);
} }
/* (non-Javadoc)
* @see net.bigeon.gclc.process.Task#getName() */
@Override
public String getName() {
return command.getCommandName();
}
/* (non-Javadoc) /* (non-Javadoc)
* @see net.bigeon.gclc.process.ForkTask#doRun() */ * @see net.bigeon.gclc.process.ForkTask#doRun() */
@Override @Override
@@ -103,4 +93,11 @@ public class ForkCommandTask extends ForkTask {
command.execute(out, in, args); command.execute(out, in, args);
} }
/* (non-Javadoc)
* @see net.bigeon.gclc.process.Task#getName() */
@Override
public String getName() {
return command.getCommandName();
}
} }

View File

@@ -105,6 +105,20 @@ public abstract class ForkTask implements Task {
listeners.add(listener); listeners.add(listener);
} }
/** Actually run the fork. */
protected abstract void doRun() throws CommandRunException;
/** Get the excepion that caused a failure.
*
* @return the exception */
public final CommandRunException getException() {
return exception;
}
protected final Object getRunningLock() {
return runLock;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see net.bigeon.gclc.process.Task#isRunning() */ * @see net.bigeon.gclc.process.Task#isRunning() */
@Override @Override
@@ -162,16 +176,6 @@ public abstract class ForkTask implements Task {
} }
} }
/** Actually run the fork. */
protected abstract void doRun() throws CommandRunException;
/** Get the excepion that caused a failure.
*
* @return the exception */
public final CommandRunException getException() {
return exception;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see net.bigeon.gclc.process.Task#setRunning(boolean) */ * @see net.bigeon.gclc.process.Task#setRunning(boolean) */
@Override @Override
@@ -181,8 +185,4 @@ public abstract class ForkTask implements Task {
runLock.notifyAll(); runLock.notifyAll();
} }
} }
protected final Object getRunningLock() {
return runLock;
}
} }

View File

@@ -71,10 +71,7 @@ import net.bigeon.gclc.ApplicationAttachement;
import net.bigeon.gclc.command.ICommandProvider; import net.bigeon.gclc.command.ICommandProvider;
import net.bigeon.gclc.exception.InvalidCommandName; import net.bigeon.gclc.exception.InvalidCommandName;
/** /** @author Emmanuel Bigeon */
* @author Emmanuel Bigeon
*
*/
public class ProcessAttachement implements ApplicationAttachement { public class ProcessAttachement implements ApplicationAttachement {
private final TaskPool pool; private final TaskPool pool;
@@ -86,8 +83,8 @@ public class ProcessAttachement implements ApplicationAttachement {
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.ApplicationAttachement#attach(fr.bigeon.gclc.ConsoleApplication) * @see fr.bigeon.gclc.ApplicationAttachement#attach(fr.bigeon.gclc.
*/ * ConsoleApplication) */
@Override @Override
public void attach(ICommandProvider application) throws InvalidCommandName { public void attach(ICommandProvider application) throws InvalidCommandName {
application.add(new ProcessKill("kill", pool)); application.add(new ProcessKill("kill", pool));

View File

@@ -89,8 +89,7 @@ public final class ProcessClear extends Command {
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager. * @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager.
* ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, java.lang.String[]) */
* java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, final ConsoleInput in, public void execute(final ConsoleOutput out, final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {

View File

@@ -89,8 +89,7 @@ public final class ProcessKill extends Command {
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager. * @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager.
* ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, java.lang.String[]) */
* java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, final ConsoleInput in, public void execute(final ConsoleOutput out, final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {

View File

@@ -95,8 +95,7 @@ public final class ProcessList extends Command {
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager. * @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager.
* ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, java.lang.String[]) */
* java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, final ConsoleInput in, public void execute(final ConsoleOutput out, final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {
@@ -107,8 +106,7 @@ public final class ProcessList extends Command {
out.println(MessageFormat.format("{0}\t{1}", string, //$NON-NLS-1$ out.println(MessageFormat.format("{0}\t{1}", string, //$NON-NLS-1$
pool.get(string).getName())); pool.get(string).getName()));
} catch (final IOException e) { } catch (final IOException e) {
throw new CommandRunException( throw new CommandRunException(CommandRunExceptionType.INTERACTION,
CommandRunExceptionType.INTERACTION,
"Unable to communicate with user", e); //$NON-NLS-1$ "Unable to communicate with user", e); //$NON-NLS-1$
} }
} }

View File

@@ -103,8 +103,8 @@ public interface Task extends Runnable {
/** Set the running state. /** Set the running state.
* <p> * <p>
* This method should be only called by external objects with the false * This method should be only called by external objects with the false
* argument. Calling this method with true has unspecified behavior and * argument. Calling this method with true has unspecified behavior and could do
* could do nothing as well as restart the command for example. * nothing as well as restart the command for example.
* *
* @param running the running state */ * @param running the running state */
void setRunning(boolean running); void setRunning(boolean running);

View File

@@ -95,16 +95,6 @@ public final class TaskPool {
this.autoClear = autoClear; this.autoClear = autoClear;
} }
/** Remove a task from the pool
*
* @param pid the task id */
public void remove(String pid) {
synchronized (lock) {
running.remove(pid);
count = Math.min(count, Integer.parseInt(pid));
}
}
/** Add a process in the pool. /** Add a process in the pool.
* *
* @param cmd the process * @param cmd the process
@@ -168,6 +158,16 @@ public final class TaskPool {
return autoClear; return autoClear;
} }
/** Remove a task from the pool
*
* @param pid the task id */
public void remove(String pid) {
synchronized (lock) {
running.remove(pid);
count = Math.min(count, Integer.parseInt(pid));
}
}
/** Request all task to stop running. /** Request all task to stop running.
* <p> * <p>
* This call does not guaranty end of execution, it is up to the task * This call does not guaranty end of execution, it is up to the task

View File

@@ -97,13 +97,12 @@ public abstract class TaskSpawner extends Command {
* @param args the arguments * @param args the arguments
* @return the process to start and add to the pool * @return the process to start and add to the pool
* @throws CommandRunException if the task creation failed */ * @throws CommandRunException if the task creation failed */
protected abstract Task createTask(ConsoleOutput out, ConsoleInput in, protected abstract Task createTask(ConsoleOutput out, ConsoleInput in, String... args)
String... args) throws CommandRunException; throws CommandRunException;
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager. * @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager.
* ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, java.lang.String[]) */
* java.lang.String[]) */
@Override @Override
public final void execute(final ConsoleOutput out, final ConsoleInput in, public final void execute(final ConsoleOutput out, final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {

View File

@@ -94,6 +94,26 @@ public final class ConnectingConsoleInput implements ConsoleInput {
close = true; close = true;
} }
public void connect(ConsoleInput input) {
disconnect();
synchronized (promptLock) {
connected = input;
promptLock.notifyAll();
}
}
public void disconnect() {
synchronized (connectionLock) {
if (connected != null) {
disconnection = true;
synchronized (promptLock) {
connected.interruptPrompt();
}
connected = null;
}
}
}
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.manager.ConsoleInput#getPrompt() */ * @see fr.bigeon.gclc.manager.ConsoleInput#getPrompt() */
@Override @Override
@@ -128,14 +148,6 @@ public final class ConnectingConsoleInput implements ConsoleInput {
return prompt(prompt.apply()); return prompt(prompt.apply());
} }
/* (non-Javadoc)
* @see fr.bigeon.gclc.manager.ConsoleInput#setPrompt(fr.bigeon.gclc.tools.
* StringProvider) */
@Override
public void setPrompt(StringProvider string) {
prompt = string;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.manager.ConsoleInput#prompt(long) */ * @see fr.bigeon.gclc.manager.ConsoleInput#prompt(long) */
@Override @Override
@@ -222,23 +234,11 @@ public final class ConnectingConsoleInput implements ConsoleInput {
}; };
} }
public void connect(ConsoleInput input) { /* (non-Javadoc)
disconnect(); * @see fr.bigeon.gclc.manager.ConsoleInput#setPrompt(fr.bigeon.gclc.tools.
synchronized (promptLock) { * StringProvider) */
connected = input; @Override
promptLock.notifyAll(); public void setPrompt(StringProvider string) {
} prompt = string;
}
public void disconnect() {
synchronized (connectionLock) {
if (connected != null) {
disconnection = true;
synchronized (promptLock) {
connected.interruptPrompt();
}
connected = null;
}
}
} }
} }

View File

@@ -130,6 +130,25 @@ public class ConnectingConsoleOutput implements ConsoleOutput {
close = true; close = true;
} }
public synchronized void connect(ConsoleOutput output) {
this.output = output;
for (final String string : messages) {
try {
output.print(string);
} catch (final IOException e) {
LOGGER.severe("nable to print to connecting console");
LOGGER.log(Level.FINE, "Console error", e);
}
}
if (!persistent) {
messages.clear();
}
}
public synchronized void disconnect() {
output = null;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.manager.ConsoleOutput#isClosed() */ * @see fr.bigeon.gclc.manager.ConsoleOutput#isClosed() */
@Override @Override
@@ -157,23 +176,4 @@ public class ConnectingConsoleOutput implements ConsoleOutput {
public void println(String message) { public void println(String message) {
addMessage(message + System.lineSeparator()); addMessage(message + System.lineSeparator());
} }
public synchronized void connect(ConsoleOutput output) {
this.output = output;
for (final String string : messages) {
try {
output.print(string);
} catch (final IOException e) {
LOGGER.severe("nable to print to connecting console");
LOGGER.log(Level.FINE, "Console error", e);
}
}
if (!persistent) {
messages.clear();
}
}
public synchronized void disconnect() {
output = null;
}
} }

View File

@@ -33,7 +33,7 @@
<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"> <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> <modelVersion>4.0.0</modelVersion>
<artifactId>gclc-socket</artifactId> <artifactId>gclc-socket</artifactId>
<version>1.1.11-SNAPSHOT</version> <version>1.1.11</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<url>http://www.bigeon.net</url> <url>http://www.bigeon.net</url>
<properties> <properties>
@@ -46,18 +46,18 @@
<dependency> <dependency>
<groupId>net.bigeon</groupId> <groupId>net.bigeon</groupId>
<artifactId>gclc</artifactId> <artifactId>gclc</artifactId>
<version>2.0.7</version> <version>2.0.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.bigeon</groupId> <groupId>net.bigeon</groupId>
<artifactId>smu</artifactId> <artifactId>smu</artifactId>
<version>1.0.0</version> <version>1.0.5</version>
</dependency> </dependency>
</dependencies> </dependencies>
<parent> <parent>
<groupId>net.bigeon.config</groupId> <groupId>net.bigeon.config</groupId>
<artifactId>ebigeon-config</artifactId> <artifactId>ebigeon-config</artifactId>
<version>1.8.9</version> <version>1.8.12</version>
</parent> </parent>
<licenses> <licenses>
<license> <license>
@@ -68,11 +68,6 @@
</licenses> </licenses>
<reporting> <reporting>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
</plugin>
<plugin> <plugin>
<groupId>com.github.sevntu-checkstyle</groupId> <groupId>com.github.sevntu-checkstyle</groupId>
<artifactId>dsm-maven-plugin</artifactId> <artifactId>dsm-maven-plugin</artifactId>
@@ -94,7 +89,7 @@
<description>Socket implementation of GCLC</description> <description>Socket implementation of GCLC</description>
<scm> <scm>
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection> <developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
<tag>HEAD</tag> <tag>gclc-socket-1.1.11</tag>
</scm> </scm>
<groupId>net.bigeon.gclc</groupId> <groupId>net.bigeon.gclc</groupId>
<inceptionYear>2016</inceptionYear> <inceptionYear>2016</inceptionYear>

View File

@@ -61,12 +61,13 @@ public final class DConnexionManager<T> implements ConnexionManager<T> {
/** The lock for modification of {@link #counters}. */ /** The lock for modification of {@link #counters}. */
private final Object counterLock = new Object(); private final Object counterLock = new Object();
/** The count of connexions. */ /** The count of connexions. */
private int count = 0; private int count;
/** Default.constructor. */ /** Default.constructor. */
public DConnexionManager() { public DConnexionManager() {
// //
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see * @see
* net.bigeon.gclc.socket.ConnexionManager#addConnexion(java.lang.Object) */ * net.bigeon.gclc.socket.ConnexionManager#addConnexion(java.lang.Object) */
@@ -80,11 +81,12 @@ public final class DConnexionManager<T> implements ConnexionManager<T> {
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see * @see net.bigeon.gclc.socket.ConnexionManager#disconnect(java.lang.String) */
* net.bigeon.gclc.socket.ConnexionManager#disconnect(java.lang.String) */
@Override @Override
public T disconnect(final String id) { public T disconnect(final String id) {
if (connecteds.containsKey(id)) { if (!connecteds.containsKey(id)) {
return null;
}
final T disc = connecteds.remove(id); final T disc = connecteds.remove(id);
final Object lock = locks.get(id); final Object lock = locks.get(id);
synchronized (lock) { synchronized (lock) {
@@ -102,8 +104,6 @@ public final class DConnexionManager<T> implements ConnexionManager<T> {
} }
return disc; return disc;
} }
return null;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see net.bigeon.gclc.socket.ConnexionManager#get(java.lang.String) */ * @see net.bigeon.gclc.socket.ConnexionManager#get(java.lang.String) */
@@ -120,8 +120,7 @@ public final class DConnexionManager<T> implements ConnexionManager<T> {
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see * @see net.bigeon.gclc.socket.ConnexionManager#isConnected(java.lang.String) */
* net.bigeon.gclc.socket.ConnexionManager#isConnected(java.lang.String) */
@Override @Override
public boolean isConnected(final String id) { public boolean isConnected(final String id) {
return connecteds.containsKey(id); return connecteds.containsKey(id);
@@ -154,8 +153,8 @@ public final class DConnexionManager<T> implements ConnexionManager<T> {
@Override @Override
public void releaseDisconnexionLock(final String id) { public void releaseDisconnexionLock(final String id) {
synchronized (counterLock) { synchronized (counterLock) {
counters.put(id, Integer counters.put(id,
.valueOf(Math.max(counters.get(id).intValue() - 1, 0))); Integer.valueOf(Math.max(counters.get(id).intValue() - 1, 0)));
counterLock.notifyAll(); counterLock.notifyAll();
} }
} }

View File

@@ -100,18 +100,16 @@ public final class PluggableConsoleInput implements ConsoleInput {
closed = true; closed = true;
} }
/** Connect the given input stream to the input and output to the hints /** Connect the given input stream to the input and output to the hints writing.
* writing.
* *
* @param stream the input stream * @param stream the input stream
* @param out the output for hints. * @param out the output for hints.
* @throws IOException if the input is already connected. */ * @throws IOException if the input is already connected. */
public void connect(final InputStream stream, public void connect(final InputStream stream, final PrintStream out)
final PrintStream out) throws IOException { throws IOException {
synchronized (connexionLock) { synchronized (connexionLock) {
if (connected) { if (connected) {
throw new IOException( throw new IOException("Input already connected to an input stream"); //$NON-NLS-1$
"Input already connected to an input stream"); //$NON-NLS-1$
} }
output = out; output = out;
@@ -120,8 +118,8 @@ public final class PluggableConsoleInput implements ConsoleInput {
out.flush(); out.flush();
} }
final InputStreamReader streamReader = new InputStreamReader( final InputStreamReader streamReader = new InputStreamReader(stream,
stream, StandardCharsets.UTF_8); StandardCharsets.UTF_8);
final BufferedReader reader = new BufferedReader(streamReader); final BufferedReader reader = new BufferedReader(streamReader);
connexion = new ReadingRunnable(reader); connexion = new ReadingRunnable(reader);
final Thread th = new Thread(connexion, "GCLC Socket - Read input"); //$NON-NLS-1$ final Thread th = new Thread(connexion, "GCLC Socket - Read input"); //$NON-NLS-1$
@@ -218,11 +216,9 @@ public final class PluggableConsoleInput implements ConsoleInput {
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.manager.ConsoleInput#prompt(java.lang.String, * @see fr.bigeon.gclc.manager.ConsoleInput#prompt(java.lang.String, long) */
* long) */
@Override @Override
public String prompt(final String message, public String prompt(final String message, final long timeout) throws IOException {
final long timeout) throws IOException {
if (closed) { if (closed) {
throw new IOException(); throw new IOException();
} }
@@ -240,8 +236,7 @@ public final class PluggableConsoleInput implements ConsoleInput {
long time = System.currentTimeMillis() - tic; long time = System.currentTimeMillis() - tic;
while (res == null && !interrupted && time < timeout) { while (res == null && !interrupted && time < timeout) {
try { try {
res = waitMessageOrConnexion(timeout - time, res = waitMessageOrConnexion(timeout - time, (timeout - time) / TENTH);
(timeout - time) / TENTH);
} catch (final InterruptedException e) { } catch (final InterruptedException e) {
LOGGER.log(Level.FINE, "Interruption of thread", e); //$NON-NLS-1$ LOGGER.log(Level.FINE, "Interruption of thread", e); //$NON-NLS-1$
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
@@ -255,26 +250,25 @@ public final class PluggableConsoleInput implements ConsoleInput {
return res; return res;
} }
@Override
public void setPrompt(final StringProvider prompt) {
this.prompt = prompt;
}
@Override @Override
public void setPrompt(String prompt) { public void setPrompt(String prompt) {
setPrompt(new ConstantString(prompt)); setPrompt(new ConstantString(prompt));
} }
/** Wait for a hint or connexion. @Override
public void setPrompt(final StringProvider prompt) {
this.prompt = prompt;
}
/** Wait for a hint or connection.
* *
* @param messageTimeout the timeout on the current connexion hint waiting * @param messageTimeout the timeout on the current connection hint waiting
* @param connexionTimeout the timeout on the new connexion wait * @param connexionTimeout the timeout on the new connection wait
* @return the hint, or null if not connected or timed out. * @return the hint, or null if not connected or timed out.
* @throws IOException if the reading failed. * @throws IOException if the reading failed.
* @throws InterruptedException if the wait was interrupted */ * @throws InterruptedException if the wait was interrupted */
private String waitMessageOrConnexion(final long messageTimeout, private String waitMessageOrConnexion(final long messageTimeout,
final long connexionTimeout) throws IOException, final long connexionTimeout) throws IOException, InterruptedException {
InterruptedException {
synchronized (connexionLock) { synchronized (connexionLock) {
if (connected) { if (connected) {
return connexion.getNextMessage(messageTimeout); return connexion.getNextMessage(messageTimeout);

View File

@@ -60,6 +60,7 @@ public final class PluggableConsoleOutput implements ConsoleOutput {
public PluggableConsoleOutput() { public PluggableConsoleOutput() {
// //
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see java.lang.AutoCloseable#close() */ * @see java.lang.AutoCloseable#close() */
@Override @Override

View File

@@ -65,8 +65,8 @@ public final class RemoteDisconnectCommand<T> extends Command {
* @param manager the manager * @param manager the manager
* @param all if all elements should be disconnected when no argument is * @param all if all elements should be disconnected when no argument is
* provided */ * provided */
public RemoteDisconnectCommand(final String name, public RemoteDisconnectCommand(final String name, final ConnexionManager<T> manager,
final ConnexionManager<T> manager, final boolean all) { final boolean all) {
super(name); super(name);
this.manager = manager; this.manager = manager;
this.all = all; this.all = all;
@@ -74,8 +74,7 @@ public final class RemoteDisconnectCommand<T> extends Command {
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager. * @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager.
* ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, java.lang.String[]) */
* java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, final ConsoleInput in, public void execute(final ConsoleOutput out, final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {
@@ -89,8 +88,8 @@ public final class RemoteDisconnectCommand<T> extends Command {
if (manager.isConnected(string)) { if (manager.isConnected(string)) {
manager.disconnect(string); manager.disconnect(string);
} else { } else {
print(out, MessageFormat print(out,
.format("[WARNING] {0} is not connected", string)); //$NON-NLS-1$ MessageFormat.format("[WARNING] {0} is not connected", string)); //$NON-NLS-1$
} }
} }
} }
@@ -99,16 +98,14 @@ public final class RemoteDisconnectCommand<T> extends Command {
* *
* @param out the output * @param out the output
* @param string the message * @param string the message
* @throws CommandRunException if the output exists but cannot be printed * @throws CommandRunException if the output exists but cannot be printed to */
* to */ private static void print(final ConsoleOutput out, final String string)
private void print(final ConsoleOutput out, throws CommandRunException {
final String string) throws CommandRunException {
if (out != null) { if (out != null) {
try { try {
out.println(string); out.println(string);
} catch (final IOException e) { } catch (final IOException e) {
throw new CommandRunException( throw new CommandRunException(CommandRunExceptionType.INTERACTION,
CommandRunExceptionType.INTERACTION,
"Unable to print to existing output", e); //$NON-NLS-1$ "Unable to print to existing output", e); //$NON-NLS-1$
} }
} }
@@ -123,12 +120,11 @@ public final class RemoteDisconnectCommand<T> extends Command {
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.Command#usageDetail() */ * @see fr.bigeon.gclc.command.Command#usageDetail() */
@SuppressWarnings("nls")
@Override @Override
protected String usageDetail() { protected String usageDetail() {
return MessageFormat.format( return MessageFormat.format(
" If arguments are provided the corresponding connexions are closed, " + " If arguments are provided the corresponding connexions are closed, "
"otherwise{0}{1} are.", + "otherwise{0}{1} are.",
System.lineSeparator(), all ? "all connexions" : "none"); System.lineSeparator(), all ? "all connexions" : "none");
} }
} }

View File

@@ -82,13 +82,12 @@ public final class SocketConsoleApplicationShell implements Runnable {
/** THe server address. */ /** THe server address. */
private final InetAddress addr; private final InetAddress addr;
/** Create a socket application shell which will listen on the given port /** Create a socket application shell which will listen on the given port and
* and network interface. * network interface.
* *
* @param port the part * @param port the part
* @param addr the inet address */ * @param addr the inet address */
public SocketConsoleApplicationShell(final int port, public SocketConsoleApplicationShell(final int port, final InetAddress addr) {
final InetAddress addr) {
super(); super();
this.port = port; this.port = port;
this.addr = addr; this.addr = addr;
@@ -110,9 +109,9 @@ public final class SocketConsoleApplicationShell implements Runnable {
} }
/** If the port provided was 0, this allows to get the actual port. /** If the port provided was 0, this allows to get the actual port.
*
* @return the local port * @return the local port
* @see java.net.ServerSocket#getLocalPort() * @see java.net.ServerSocket#getLocalPort() */
*/
public int getLocalPort() { public int getLocalPort() {
return serverSocket.getLocalPort(); return serverSocket.getLocalPort();
} }
@@ -122,16 +121,14 @@ public final class SocketConsoleApplicationShell implements Runnable {
@Override @Override
public void run() { public void run() {
// Create the server // Create the server
try (ServerSocket actualServerSocket = new ServerSocket(port, 1, try (ServerSocket actualServerSocket = new ServerSocket(port, 1, addr)) {
addr)) {
serverSocket = actualServerSocket; serverSocket = actualServerSocket;
running = true; running = true;
// Create the streams // Create the streams
runSokectServer(); runSokectServer();
} catch (final IOException e) { } catch (final IOException e) {
LOGGER.severe("Communication error between client and server"); //$NON-NLS-1$ LOGGER.severe("Communication error between client and server"); //$NON-NLS-1$
LOGGER.log(Level.FINE, LOGGER.log(Level.FINE, "Communication error between client and server", e); //$NON-NLS-1$
"Communication error between client and server", e); //$NON-NLS-1$
} }
} }
@@ -141,7 +138,7 @@ public final class SocketConsoleApplicationShell implements Runnable {
private void runSokectServer() throws IOException { private void runSokectServer() throws IOException {
while (running && app.isRunning()) { while (running && app.isRunning()) {
LOGGER.info("Waiting client"); //$NON-NLS-1$ LOGGER.info("Waiting client"); //$NON-NLS-1$
try (Socket clientSocket = serverSocket.accept();) { try (Socket clientSocket = serverSocket.accept()) {
sci.connect(clientSocket); sci.connect(clientSocket);

View File

@@ -68,12 +68,10 @@ public final class SocketConsoleInterface {
* @param socket the socket * @param socket the socket
* @throws IOException if the connection failed */ * @throws IOException if the connection failed */
public void connect(final Socket socket) throws IOException { public void connect(final Socket socket) throws IOException {
final PrintStream printStream = new PrintStream( final PrintStream printStream = new PrintStream(socket.getOutputStream(), true,
socket.getOutputStream(), true,
StandardCharsets.UTF_8.name()); StandardCharsets.UTF_8.name());
output.connect(printStream); output.connect(printStream);
input.connect(socket.getInputStream(), input.connect(socket.getInputStream(), printStream);
printStream);
} }
/** Disconnect the input and output of the application from the socket's. */ /** Disconnect the input and output of the application from the socket's. */

View File

@@ -39,14 +39,12 @@ import java.util.Collection;
import net.bigeon.gclc.ConsoleApplication; import net.bigeon.gclc.ConsoleApplication;
import net.bigeon.gclc.command.Command; import net.bigeon.gclc.command.Command;
import net.bigeon.gclc.command.HelpExecutor;
import net.bigeon.gclc.command.base.ExitCommand; import net.bigeon.gclc.command.base.ExitCommand;
import net.bigeon.gclc.command.base.HelpExecutor;
import net.bigeon.gclc.exception.CommandRunException; import net.bigeon.gclc.exception.CommandRunException;
import net.bigeon.gclc.exception.InvalidCommandName; import net.bigeon.gclc.exception.InvalidCommandName;
import net.bigeon.gclc.manager.ConsoleInput; import net.bigeon.gclc.manager.ConsoleInput;
import net.bigeon.gclc.manager.ConsoleOutput; import net.bigeon.gclc.manager.ConsoleOutput;
import net.bigeon.gclc.socket.ConnexionManager;
import net.bigeon.gclc.socket.RemoteDisconnectCommand;
/** A test-purpose application /** A test-purpose application
* *
@@ -64,13 +62,10 @@ public class ConsoleTestApplication {
* @return create the application */ * @return create the application */
@SuppressWarnings("nls") @SuppressWarnings("nls")
public static ConsoleApplication create(final ConsoleOutput output, public static ConsoleApplication create(final ConsoleOutput output,
final ConsoleInput input, final ConsoleInput input, final ConnexionManager<Socket> manager) {
final ConnexionManager<Socket> manager) {
try { try {
final ConsoleApplication application = new ConsoleApplication( final ConsoleApplication application = new ConsoleApplication(output, input,
output, input, "Welcome to the test application. Type help or test.", "See you");
"Welcome to the test application. Type help or test.",
"See you");
application.add(new ExitCommand(EXIT, application) { application.add(new ExitCommand(EXIT, application) {
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ExitCommand#beforeExit() */ * @see fr.bigeon.gclc.command.ExitCommand#beforeExit() */
@@ -82,8 +77,7 @@ public class ConsoleTestApplication {
} }
} }
}); });
application application.add(new HelpExecutor("help", application.root));
.add(new HelpExecutor("help", application.root));
application.add(new Command("test") { application.add(new Command("test") {
/* (non-Javadoc) /* (non-Javadoc)
@@ -91,8 +85,7 @@ public class ConsoleTestApplication {
* manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput,
* java.lang.String[]) */ * java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, public void execute(final ConsoleOutput out, final ConsoleInput in,
final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {
try { try {
output.println("Test command ran fine"); output.println("Test command ran fine");
@@ -107,8 +100,7 @@ public class ConsoleTestApplication {
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.Command#usageDetail() * @see fr.bigeon.gclc.command.Command#usageDetail() */
*/
@Override @Override
protected String usageDetail() { protected String usageDetail() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
@@ -123,11 +115,13 @@ public class ConsoleTestApplication {
* manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput,
* java.lang.String[]) */ * java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, public void execute(final ConsoleOutput out, final ConsoleInput in,
final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {
try { try {
Thread.sleep(2000); Object obj = new Object();
synchronized (obj) {
obj.wait(2000);
}
output.println("Test command ran fine"); output.println("Test command ran fine");
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
throw new CommandRunException("manager closed", e); throw new CommandRunException("manager closed", e);
@@ -140,8 +134,7 @@ public class ConsoleTestApplication {
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.Command#usageDetail() * @see fr.bigeon.gclc.command.Command#usageDetail() */
*/
@Override @Override
protected String usageDetail() { protected String usageDetail() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
@@ -149,8 +142,7 @@ public class ConsoleTestApplication {
throw new RuntimeException("Not implemented yet"); throw new RuntimeException("Not implemented yet");
} }
}); });
application.add( application.add(new RemoteDisconnectCommand<>("out", manager, true));
new RemoteDisconnectCommand<>("out", manager, true));
return application; return application;
} catch (final InvalidCommandName e) { } catch (final InvalidCommandName e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -39,6 +39,7 @@ package net.bigeon.gclc.socket;
*/ */
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
@@ -46,11 +47,10 @@ import java.io.IOException;
import java.io.PipedInputStream; import java.io.PipedInputStream;
import java.io.PipedOutputStream; import java.io.PipedOutputStream;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.Test; import org.junit.Test;
import net.bigeon.gclc.socket.PluggableConsoleInput;
/** /**
* <p> * <p>
* TODO * TODO
@@ -90,7 +90,10 @@ public class PluggableConsoleInputTest {
} }
try { try {
Thread.sleep(100); Object obj = new Object();
synchronized (obj) {
obj.wait(100);
}
} catch (final InterruptedException e) { } catch (final InterruptedException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
@@ -112,7 +115,10 @@ public class PluggableConsoleInputTest {
@Override @Override
public void run() { public void run() {
try { try {
Thread.sleep(200); Object obj = new Object();
synchronized (obj) {
obj.wait(200);
}
} catch (final InterruptedException e) { } catch (final InterruptedException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
@@ -162,32 +168,40 @@ public class PluggableConsoleInputTest {
}); });
th.start(); th.start();
Object obj = new Object();
synchronized (obj) {
while (!input.isPrompting()) { while (!input.isPrompting()) {
Thread.sleep(10); obj.wait(10);
}
} }
input.connect(pis, out); input.connect(pis, out);
testIn.println("tac"); testIn.println("tac");
final AtomicReference<IOException> ref = new AtomicReference<>();
final Thread th2 = new Thread(new Runnable() { final Thread th2 = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
try { try {
input.prompt("Test", 5000); input.prompt("Test", 5000);
fail("Prompt should io"); // fail("Prompt should io");
} catch (final IOException e) { } catch (final IOException e) {
// ok // ok
ref.set(e);
} }
} }
}); });
th2.start(); th2.start();
synchronized (obj) {
while (!input.isPrompting()) { while (!input.isPrompting()) {
Thread.sleep(10); obj.wait(10);
}
} }
input.close(); input.close();
th2.join();
assertNotNull("Prompt should io", ref.get());
} }
} }

View File

@@ -46,8 +46,6 @@ import java.io.IOException;
import org.junit.Test; import org.junit.Test;
import net.bigeon.gclc.exception.CommandRunException; import net.bigeon.gclc.exception.CommandRunException;
import net.bigeon.gclc.socket.DConnexionManager;
import net.bigeon.gclc.socket.RemoteDisconnectCommand;
import net.bigeon.gclc.utils.PipedConsoleOutput; import net.bigeon.gclc.utils.PipedConsoleOutput;
/** /**
@@ -65,10 +63,10 @@ public class RemoteDisconnectCommandTest {
@Test @Test
public final void testExecute() throws CommandRunException, IOException { public final void testExecute() throws CommandRunException, IOException {
final DConnexionManager<String> manager = new DConnexionManager<>(); final DConnexionManager<String> manager = new DConnexionManager<>();
final RemoteDisconnectCommand<String> cmd = new RemoteDisconnectCommand<>( final RemoteDisconnectCommand<String> cmd = new RemoteDisconnectCommand<>("quit",
"quit", manager, true); manager, true);
final RemoteDisconnectCommand<String> cmd2 = new RemoteDisconnectCommand<>( final RemoteDisconnectCommand<String> cmd2 = new RemoteDisconnectCommand<>("quit",
"quit", manager, false); manager, false);
manager.addConnexion("test"); manager.addConnexion("test");
cmd2.execute(null, null); cmd2.execute(null, null);

View File

@@ -48,12 +48,10 @@ import java.util.logging.Logger;
import org.junit.Test; import org.junit.Test;
import net.bigeon.gclc.socket.SocketConsoleApplicationShell;
/** Test class for {@link SocketConsoleApplicationShell} /** Test class for {@link SocketConsoleApplicationShell}
* *
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
@SuppressWarnings({"static-method", "javadoc", "nls"}) @SuppressWarnings({ "static-method", "javadoc", "nls" })
public class SocketConsoleApplicationTest { public class SocketConsoleApplicationTest {
private static final Logger LOGGER = Logger private static final Logger LOGGER = Logger
@@ -62,12 +60,12 @@ public class SocketConsoleApplicationTest {
/** @param in the input /** @param in the input
* @return the string * @return the string
* @throws IOException if the input reading failed */ * @throws IOException if the input reading failed */
private String consumeToPrompt(final String server, private String consumeToPrompt(final String server, final BufferedReader in)
final BufferedReader in) throws IOException { throws IOException {
String fromServer = server; String fromServer = server;
LOGGER.fine("Server: \n" + fromServer); LOGGER.fine("Server: \n" + fromServer);
while (fromServer != null && !fromServer.equals("Bye.") && while (fromServer != null && !fromServer.equals("Bye.")
!fromServer.equals("> ")) { && !fromServer.equals("> ")) {
fromServer = in.readLine(); fromServer = in.readLine();
LOGGER.fine("Server: \n" + fromServer); LOGGER.fine("Server: \n" + fromServer);
} }
@@ -78,19 +76,17 @@ public class SocketConsoleApplicationTest {
public void testIntegration() throws IOException, InterruptedException { public void testIntegration() throws IOException, InterruptedException {
Thread server; Thread server;
server = TestServer.getServer(); server = TestServer.getServer();
Thread.sleep(1000);
final String hostName = "127.0.0.1"; final String hostName = "127.0.0.1";
final int portNumber = 3300; final int portNumber = 3300;
try (Socket kkSocket = new Socket(hostName, portNumber); try (Socket kkSocket = new Socket(hostName, portNumber);
PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), true);
true);
BufferedReader in = new BufferedReader( BufferedReader in = new BufferedReader(
new InputStreamReader(kkSocket.getInputStream()));) { new InputStreamReader(kkSocket.getInputStream()));) {
String fromServer; String fromServer;
int i = -1; int i = -1;
final String[] cmds = {"help", "toto", "test", "out"}; final String[] cmds = { "help", "toto", "test", "out" };
while ((fromServer = in.readLine()) != null) { while ((fromServer = in.readLine()) != null) {
i++; i++;
fromServer = consumeToPrompt(fromServer, in); fromServer = consumeToPrompt(fromServer, in);
@@ -108,15 +104,13 @@ public class SocketConsoleApplicationTest {
} }
try (Socket kkSocket = new Socket(hostName, portNumber); try (Socket kkSocket = new Socket(hostName, portNumber);
PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), true);
true);
BufferedReader in = new BufferedReader( BufferedReader in = new BufferedReader(
new InputStreamReader(kkSocket.getInputStream()));) { new InputStreamReader(kkSocket.getInputStream()));) {
String fromServer; String fromServer;
int i = 0; int i = 0;
final String[] cmds = {"help", "toto", "test", final String[] cmds = { "help", "toto", "test", ConsoleTestApplication.EXIT };
ConsoleTestApplication.EXIT};
while ((fromServer = in.readLine()) != null) { while ((fromServer = in.readLine()) != null) {
fromServer = consumeToPrompt(fromServer, in); fromServer = consumeToPrompt(fromServer, in);
if (fromServer == null || fromServer.equals("Bye.")) { if (fromServer == null || fromServer.equals("Bye.")) {
@@ -131,26 +125,20 @@ public class SocketConsoleApplicationTest {
} }
i++; i++;
} }
assertEquals("Application exit command should close connection", 4, assertEquals("Application exit command should close connection", 4, i);
i);
} }
Thread.sleep(100);
TestServer.closeServer(); TestServer.closeServer();
server.join(); server.join();
server = TestServer.getServer(); server = TestServer.getServer();
Thread.sleep(1000);
try (Socket kkSocket = new Socket(hostName, portNumber); try (Socket kkSocket = new Socket(hostName, portNumber);
PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), true);
true);
BufferedReader in = new BufferedReader( BufferedReader in = new BufferedReader(
new InputStreamReader(kkSocket.getInputStream()));) { new InputStreamReader(kkSocket.getInputStream()));) {
String fromServer; String fromServer;
int i = 0; int i = 0;
final String[] cmds = {"help", "toto", "test", final String[] cmds = { "help", "toto", "test", ConsoleTestApplication.EXIT };
ConsoleTestApplication.EXIT};
while ((fromServer = in.readLine()) != null) { while ((fromServer = in.readLine()) != null) {
fromServer = consumeToPrompt(fromServer, in); fromServer = consumeToPrompt(fromServer, in);
if (fromServer == null || fromServer.equals("Bye.")) { if (fromServer == null || fromServer.equals("Bye.")) {
@@ -164,8 +152,7 @@ public class SocketConsoleApplicationTest {
} }
i++; i++;
} }
assertEquals("Application exit command should close connection", 4, assertEquals("Application exit command should close connection", 4, i);
i);
} }
TestServer.closeServer(); TestServer.closeServer();
server.join(); server.join();

View File

@@ -44,9 +44,8 @@ import java.util.Collection;
import net.bigeon.smu.StringEncoder; import net.bigeon.smu.StringEncoder;
/** TODO Describe TestConsoleClient.java /** TODO Describe TestConsoleClient.java
* @author Emmanuel Bigeon
* *
*/ * @author Emmanuel Bigeon */
@SuppressWarnings("nls") @SuppressWarnings("nls")
public class TestConsoleClient { public class TestConsoleClient {
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
@@ -56,8 +55,7 @@ public class TestConsoleClient {
} }
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
private static final StringEncoder ENCODER = new StringEncoder("%", private static final StringEncoder ENCODER = new StringEncoder("%", TO_ENCODE);
TO_ENCODE);
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public static void main(String[] args) { public static void main(String[] args) {
@@ -65,10 +63,9 @@ public class TestConsoleClient {
final int portNumber = 3300; final int portNumber = 3300;
try (Socket kkSocket = new Socket(hostName, portNumber); try (Socket kkSocket = new Socket(hostName, portNumber);
PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), true);
true); BufferedReader in = new BufferedReader(
BufferedReader in = new BufferedReader(new InputStreamReader( new InputStreamReader(kkSocket.getInputStream()));) {
kkSocket.getInputStream()));) {
String fromServer; String fromServer;
while ((fromServer = in.readLine()) != null) { while ((fromServer = in.readLine()) != null) {

View File

@@ -39,17 +39,11 @@ import java.net.Socket;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import net.bigeon.gclc.ConsoleApplication; import net.bigeon.gclc.ConsoleApplication;
import net.bigeon.gclc.socket.ConnexionManager;
import net.bigeon.gclc.socket.DConnexionManager;
import net.bigeon.gclc.socket.PluggableConsoleInput;
import net.bigeon.gclc.socket.PluggableConsoleOutput;
import net.bigeon.gclc.socket.SocketConsoleApplicationShell;
import net.bigeon.gclc.socket.SocketConsoleInterface;
/** A test server /** A test server
* *
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
@SuppressWarnings({"javadoc", "nls"}) @SuppressWarnings({ "javadoc", "nls" })
public class TestServer { public class TestServer {
private static SocketConsoleApplicationShell SHELL; private static SocketConsoleApplicationShell SHELL;
@@ -83,8 +77,8 @@ public class TestServer {
manager = new DConnexionManager<>(); manager = new DConnexionManager<>();
SHELL = new SocketConsoleApplicationShell(3300, SHELL = new SocketConsoleApplicationShell(3300,
InetAddress.getByName("127.0.0.1")); InetAddress.getByName("127.0.0.1"));
final ConsoleApplication app = ConsoleTestApplication final ConsoleApplication app = ConsoleTestApplication.create(output, input,
.create(output, input, manager); manager);
SHELL.setInterface(new SocketConsoleInterface(input, output)); SHELL.setInterface(new SocketConsoleInterface(input, output));
SHELL.setConnexionManager(manager); SHELL.setConnexionManager(manager);
SHELL.setApplication(app); SHELL.setApplication(app);
@@ -96,6 +90,16 @@ public class TestServer {
} }
}); });
th.start(); th.start();
try {
Object waiting = new Object();
synchronized (waiting) {
while (!input.isPrompting()) {
waiting.wait(50);
}
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
} }
return SHELL; return SHELL;
} }

View File

@@ -42,7 +42,7 @@
<parent> <parent>
<groupId>net.bigeon.config</groupId> <groupId>net.bigeon.config</groupId>
<artifactId>swt-config</artifactId> <artifactId>swt-config</artifactId>
<version>1.8.7</version> <version>1.8.9</version>
</parent> </parent>
<properties> <properties>
@@ -55,7 +55,7 @@
<dependency> <dependency>
<groupId>net.bigeon</groupId> <groupId>net.bigeon</groupId>
<artifactId>gclc</artifactId> <artifactId>gclc</artifactId>
<version>2.0.7</version> <version>2.0.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.bigeon</groupId> <groupId>net.bigeon</groupId>
@@ -73,11 +73,6 @@
</licenses> </licenses>
<reporting> <reporting>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
</plugin>
<plugin> <plugin>
<groupId>com.github.sevntu-checkstyle</groupId> <groupId>com.github.sevntu-checkstyle</groupId>
<artifactId>dsm-maven-plugin</artifactId> <artifactId>dsm-maven-plugin</artifactId>

View File

@@ -77,6 +77,7 @@ package net.bigeon.gclc.swt;
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
public interface ConsoleDelayIO { public interface ConsoleDelayIO {
/** Get the input text. /** Get the input text.
*
* @return the non validated input */ * @return the non validated input */
String getInput(); String getInput();

View File

@@ -123,8 +123,7 @@ public final class HistoryTextKeyListener extends KeyAdapter {
} }
// Upper arrow retrieves previous commands // Upper arrow retrieves previous commands
if (keyCode == SWT.ARROW_UP && if (keyCode == SWT.ARROW_UP && currentIndex < commands.size() - 1) {
currentIndex < commands.size() - 1) {
currentIndex++; currentIndex++;
final String cmd = commands.get(commands.size() - currentIndex - 1); final String cmd = commands.get(commands.size() - currentIndex - 1);
console.setInput(cmd); console.setInput(cmd);
@@ -136,8 +135,7 @@ public final class HistoryTextKeyListener extends KeyAdapter {
currentIndex--; currentIndex--;
console.setInput(EMPTY); console.setInput(EMPTY);
} else if (currentIndex > 0) { } else if (currentIndex > 0) {
final String cmd = commands final String cmd = commands.get(commands.size() - (--currentIndex) - 1);
.get(commands.size() - (--currentIndex) - 1);
console.setInput(cmd); console.setInput(cmd);
} }
} }

View File

@@ -309,8 +309,8 @@ public final class SWTConsole extends Composite
promptLock.notifyAll(); promptLock.notifyAll();
final long start = System.currentTimeMillis(); final long start = System.currentTimeMillis();
long cur = start; long cur = start;
while (prompting && start + timeout>cur) { while (prompting && start + timeout > cur) {
promptLock.wait((cur-start-timeout)/2); promptLock.wait((cur - start - timeout) / 2);
cur = System.currentTimeMillis(); cur = System.currentTimeMillis();
} }
} catch (final InterruptedException e) { } catch (final InterruptedException e) {
@@ -397,6 +397,11 @@ public final class SWTConsole extends Composite
consoleInput.setSelection(input.length()); consoleInput.setSelection(input.length());
} }
@Override
public void setPrompt(String prompt) {
setPrompt(new ConstantString(prompt));
}
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.ConsoleManager#setPrompt(java.lang.String) */ * @see fr.bigeon.gclc.ConsoleManager#setPrompt(java.lang.String) */
@Override @Override
@@ -415,11 +420,6 @@ public final class SWTConsole extends Composite
}); });
} }
@Override
public void setPrompt(String prompt) {
setPrompt(new ConstantString(prompt));
}
/** @param string the text */ /** @param string the text */
public void setText(final String string) { public void setText(final String string) {
consoleInput.setText(string); consoleInput.setText(string);

View File

@@ -92,8 +92,7 @@ public final class SWTConsoleView extends Composite implements ConsoleDelayIO {
/** The local implementation of the forwarding runnable /** The local implementation of the forwarding runnable
* *
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
private final class ToSWTConsoleForwardRunnable private final class ToSWTConsoleForwardRunnable extends AOutputForwardRunnable {
extends AOutputForwardRunnable {
/** The running status */ /** The running status */
private boolean running = true; private boolean running = true;
@@ -139,15 +138,13 @@ public final class SWTConsoleView extends Composite implements ConsoleDelayIO {
setLayout(new GridLayout(1, false)); setLayout(new GridLayout(1, false));
consoleOutput = new Text(this, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | consoleOutput = new Text(this,
SWT.V_SCROLL | SWT.MULTI); SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
consoleOutput.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, consoleOutput.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
1, 1));
consoleOutput.setRedraw(true); consoleOutput.setRedraw(true);
consoleInput = new Text(this, SWT.BORDER); consoleInput = new Text(this, SWT.BORDER);
consoleInput.setLayoutData( consoleInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
consoleInput.addKeyListener(new HistoryTextKeyListener(this)); consoleInput.addKeyListener(new HistoryTextKeyListener(this));
} }

View File

@@ -73,7 +73,8 @@ import static org.junit.Assert.assertEquals;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.junit.Test; import org.junit.Test;
/** <p> /**
* <p>
* TODO * TODO
* *
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
@@ -87,8 +88,8 @@ public class HistoryTextKeyListenerTest {
private String input = ""; private String input = "";
@Override @Override
public void validateInput() { public String getInput() {
input = ""; return input;
} }
@Override @Override
@@ -97,8 +98,8 @@ public class HistoryTextKeyListenerTest {
} }
@Override @Override
public String getInput() { public void validateInput() {
return input; input = "";
} }
}; };
HistoryTextKeyListener listener = new HistoryTextKeyListener(io); HistoryTextKeyListener listener = new HistoryTextKeyListener(io);

View File

@@ -91,7 +91,7 @@ import net.bigeon.gclc.manager.ConsoleOutput;
* TODO * TODO
* *
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
@SuppressWarnings({"javadoc", "static-method", "nls", "deprecation"}) @SuppressWarnings({ "javadoc", "static-method", "nls", "deprecation" })
public class SWTConsoleShellTest { public class SWTConsoleShellTest {
protected static final long TWO_SECONDS = 2000; protected static final long TWO_SECONDS = 2000;
@@ -102,8 +102,8 @@ public class SWTConsoleShellTest {
final SWTConsoleShell shell = new SWTConsoleShell(DISPLAY); final SWTConsoleShell shell = new SWTConsoleShell(DISPLAY);
final SWTConsole swtConsole = shell.getManager(); final SWTConsole swtConsole = shell.getManager();
try { try {
final ConsoleApplication appl = new ConsoleApplication(swtConsole, final ConsoleApplication appl = new ConsoleApplication(swtConsole, swtConsole,
swtConsole, "Hello", "See you"); "Hello", "See you");
appl.add(new ExitCommand("exit", appl)); appl.add(new ExitCommand("exit", appl));
appl.add(new Command("long") { appl.add(new Command("long") {
@@ -112,8 +112,7 @@ public class SWTConsoleShellTest {
* manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput,
* java.lang.String[]) */ * java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, public void execute(final ConsoleOutput out, final ConsoleInput in,
final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {
try { try {
Thread.sleep(TWO_SECONDS); Thread.sleep(TWO_SECONDS);
@@ -204,8 +203,8 @@ public class SWTConsoleShellTest {
swtConsole.close(); swtConsole.close();
swtConsole.setPrompt(":"); swtConsole.setPrompt(":");
try { try {
final ConsoleApplication appl = new ConsoleApplication(swtConsole, final ConsoleApplication appl = new ConsoleApplication(swtConsole, swtConsole,
swtConsole, "Hello", "See you"); "Hello", "See you");
appl.add(new ExitCommand("exit", appl)); appl.add(new ExitCommand("exit", appl));
appl.add(new Command("long") { appl.add(new Command("long") {
/* (non-Javadoc) /* (non-Javadoc)
@@ -213,8 +212,7 @@ public class SWTConsoleShellTest {
* manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput,
* java.lang.String[]) */ * java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, public void execute(final ConsoleOutput out, final ConsoleInput in,
final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {
try { try {
Thread.sleep(TWO_SECONDS); Thread.sleep(TWO_SECONDS);
@@ -244,8 +242,7 @@ public class SWTConsoleShellTest {
* manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput,
* java.lang.String[]) */ * java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, public void execute(final ConsoleOutput out, final ConsoleInput in,
final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {
try { try {
swtConsole.prompt("Test"); swtConsole.prompt("Test");

View File

@@ -87,11 +87,12 @@ import net.bigeon.gclc.manager.ConsoleOutput;
import net.bigeon.gclc.utils.PipedConsoleInput; import net.bigeon.gclc.utils.PipedConsoleInput;
import net.bigeon.gclc.utils.PipedConsoleOutput; import net.bigeon.gclc.utils.PipedConsoleOutput;
/** <p> /**
* <p>
* TODO * TODO
* *
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
@SuppressWarnings({"javadoc", "static-method", "nls", "deprecation"}) @SuppressWarnings({ "javadoc", "static-method", "nls", "deprecation" })
public class SWTConsoleViewTest { public class SWTConsoleViewTest {
protected static final long TWO_SECONDS = 2000; protected static final long TWO_SECONDS = 2000;
@@ -110,15 +111,15 @@ public class SWTConsoleViewTest {
try (PipedConsoleOutput manager = new PipedConsoleOutput(); try (PipedConsoleOutput manager = new PipedConsoleOutput();
PipedConsoleInput input = new PipedConsoleInput(System.out)) { PipedConsoleInput input = new PipedConsoleInput(System.out)) {
swtConsole.setManager(manager, input); swtConsole.setManager(manager, input);
final ConsoleApplication appl = new ConsoleApplication(manager, final ConsoleApplication appl = new ConsoleApplication(manager, input,
input,
"Hello", "See you"); "Hello", "See you");
appl.add(new ExitCommand("exit", appl)); appl.add(new ExitCommand("exit", appl));
appl.add(new Command("long") { appl.add(new Command("long") {
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager.ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, java.lang.String[]) * @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager.
*/ * ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput,
* java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, final ConsoleInput in, public void execute(final ConsoleOutput out, final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {

View File

@@ -15,16 +15,10 @@
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>net.bigeon</groupId> <groupId>net.bigeon</groupId>
<artifactId>gclc</artifactId> <artifactId>gclc</artifactId>
<version>2.0.7</version> <version>2.0.9</version>
</dependency> </dependency>
</dependencies> </dependencies>
<name>GCLC system command</name> <name>GCLC system command</name>
@@ -65,6 +59,6 @@
<parent> <parent>
<groupId>net.bigeon.config</groupId> <groupId>net.bigeon.config</groupId>
<artifactId>ebigeon-config</artifactId> <artifactId>ebigeon-config</artifactId>
<version>1.8.9</version> <version>1.8.12</version>
</parent> </parent>
</project> </project>

View File

@@ -56,6 +56,8 @@ import net.bigeon.gclc.manager.ConsoleOutput;
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
public class ExecSystemCommand extends Command { public class ExecSystemCommand extends Command {
/** Error message for the manager closed. */
private static final String MANAGER_WAS_CLOSED = "manager was closed";
/** The command default name */ /** The command default name */
private static final String COMMAND_DEFAULT_NAME = "exec"; //$NON-NLS-1$ private static final String COMMAND_DEFAULT_NAME = "exec"; //$NON-NLS-1$
/** The end of line separator */ /** The end of line separator */
@@ -64,21 +66,22 @@ public class ExecSystemCommand extends Command {
private static final Logger LOGGER = Logger private static final Logger LOGGER = Logger
.getLogger(ExecSystemCommand.class.getName()); .getLogger(ExecSystemCommand.class.getName());
/***/ /** Create the command with the name 'exec'. */
public ExecSystemCommand() { public ExecSystemCommand() {
super(COMMAND_DEFAULT_NAME); super(COMMAND_DEFAULT_NAME);
} }
/** @param name the name of the command (the input from the manager that /** Create the command with a custom name.
* should trigger this command) */ *
* @param name the name of the command (the input from the manager that should
* trigger this command) */
public ExecSystemCommand(final String name) { public ExecSystemCommand(final String name) {
super(name); super(name);
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager. * @see fr.bigeon.gclc.command.ICommand#execute(fr.bigeon.gclc.manager.
* ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, * ConsoleOutput, fr.bigeon.gclc.manager.ConsoleInput, java.lang.String[]) */
* java.lang.String[]) */
@Override @Override
public void execute(final ConsoleOutput out, final ConsoleInput in, public void execute(final ConsoleOutput out, final ConsoleInput in,
final String... args) throws CommandRunException { final String... args) throws CommandRunException {
@@ -90,19 +93,16 @@ public class ExecSystemCommand extends Command {
return; return;
} }
final InputStream is = proc final InputStream is = proc.getInputStream();
.getInputStream();
final Thread th = new Thread(new Runnable() { final Thread th = new Thread(new Runnable() {
@SuppressWarnings("synthetic-access")
@Override @Override
public void run() { public void run() {
try { try {
readToEnd(out, is); readToEnd(out, is);
is.close(); is.close();
} catch (final CommandRunException e) { } catch (final CommandRunException e) {
LOGGER.log(Level.WARNING, LOGGER.log(Level.WARNING, "Manager was closed in the meantime...", e); //$NON-NLS-1$
"Manager was closed in the meantime...", e); //$NON-NLS-1$
} catch (final IOException e) { } catch (final IOException e) {
LOGGER.log(Level.WARNING, "Input stream was closed...", e); //$NON-NLS-1$ LOGGER.log(Level.WARNING, "Input stream was closed...", e); //$NON-NLS-1$
} }
@@ -111,46 +111,47 @@ public class ExecSystemCommand extends Command {
th.start(); th.start();
in.setPrompt(""); //$NON-NLS-1$ in.setPrompt(""); //$NON-NLS-1$
final OutputStream os = proc.getOutputStream(); final OutputStream os = proc.getOutputStream();
try (BufferedWriter writer = new BufferedWriter( try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os))) {
new OutputStreamWriter(os))) {
while (th.isAlive()) { while (th.isAlive()) {
String user; String user = in.prompt();
try {
user = in.prompt();
} catch (final IOException e) {
throw new CommandRunException(
CommandRunExceptionType.INTERACTION,
"manager was closed", e); //$NON-NLS-1$
}
writer.write(user + EOL); writer.write(user + EOL);
} }
} catch (final IOException e1) { } catch (final IOException e1) {
throw new CommandRunException(CommandRunExceptionType.INTERACTION, throw new CommandRunException(CommandRunExceptionType.INTERACTION,
"manager was closed", e1); //$NON-NLS-1$ MANAGER_WAS_CLOSED, e1); // $NON-NLS-1$
} }
} }
/** @param is the input stream /** @param is the input stream
* @throws CommandRunException if the manager was closed while writing the * @throws CommandRunException if the manager was closed while writing the
* stream */ * stream */
protected void readToEnd(final ConsoleOutput out, protected void readToEnd(final ConsoleOutput out, final InputStream is)
final InputStream is) throws CommandRunException { throws CommandRunException {
int c; int c;
try { try {
while ((c = is.read()) != -1) { while ((c = is.read()) != -1) {
try { printCharacter(out, (char) c);
out.print(Character.valueOf((char) c).toString());
} catch (final IOException e) {
throw new CommandRunException(
CommandRunExceptionType.INTERACTION,
"manager was closed", e); //$NON-NLS-1$
}
} }
} catch (final IOException e) { } catch (final IOException e) {
LOGGER.log(Level.INFO, "input stream reading failed", e); //$NON-NLS-1$ LOGGER.log(Level.INFO, "input stream reading failed", e); //$NON-NLS-1$
} }
} }
/** Print a character on the console.
*
* @param out the console
* @param c the character
* @throws CommandRunException if the console failed to print the character. */
private void printCharacter(final ConsoleOutput out, char c)
throws CommandRunException {
try {
out.print(Character.toString(c));
} catch (final IOException e) {
throw new CommandRunException(CommandRunExceptionType.INTERACTION,
MANAGER_WAS_CLOSED, e); // $NON-NLS-1$
}
}
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.command.ICommand#tip() */ * @see fr.bigeon.gclc.command.ICommand#tip() */
@Override @Override
@@ -164,10 +165,9 @@ public class ExecSystemCommand extends Command {
protected String usageDetail() { protected String usageDetail() {
return " The system command is a system dependend command like sh on linux or" + //$NON-NLS-1$ return " The system command is a system dependend command like sh on linux or" + //$NON-NLS-1$
System.lineSeparator() + "powershell on windows." + //$NON-NLS-1$ System.lineSeparator() + "powershell on windows." + //$NON-NLS-1$
System.lineSeparator() + System.lineSeparator() + System.lineSeparator() + System.lineSeparator()
" As an example if you give \"cat /etc/hostname\" as argument, on a linux" + //$NON-NLS-1$ + " As an example if you give \"cat /etc/hostname\" as argument, on a linux" //$NON-NLS-1$
System.lineSeparator() + + System.lineSeparator() + "system, you would get the computer name." + //$NON-NLS-1$
"system, you would get the computer name." + //$NON-NLS-1$
System.lineSeparator(); System.lineSeparator();
} }

View File

@@ -0,0 +1,8 @@
/** This package contains classes for command execution on the system.
* <p>
* The class {@link net.bigeon.gclc.system.ExecSystemCommand} is, in the current
* version (0.0.1), a source of vulnerability and should probably be used only
* in private projects where the user is aware of the dangers.
*
* @author Emmanuel Bigeon */
package net.bigeon.gclc.system;

View File

@@ -2,7 +2,7 @@
<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"> <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> <modelVersion>4.0.0</modelVersion>
<artifactId>gclc</artifactId> <artifactId>gclc</artifactId>
<version>2.0.9</version> <version>2.0.10-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<url>http://bigeon.net</url> <url>http://bigeon.net</url>
<properties> <properties>
@@ -22,7 +22,7 @@
<parent> <parent>
<groupId>net.bigeon.config</groupId> <groupId>net.bigeon.config</groupId>
<artifactId>ebigeon-config</artifactId> <artifactId>ebigeon-config</artifactId>
<version>1.8.11</version> <version>1.8.12</version>
</parent> </parent>
<build> <build>
<plugins> <plugins>
@@ -74,7 +74,7 @@
<description>A generic framework for console applications, with customized command input and output streams.</description> <description>A generic framework for console applications, with customized command input and output streams.</description>
<scm> <scm>
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection> <developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
<tag>gclc-2.0.9</tag> <tag>HEAD</tag>
</scm> </scm>
<groupId>net.bigeon</groupId> <groupId>net.bigeon</groupId>
</project> </project>