Ignore:
Timestamp:
09/23/13 18:54:07 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add SimultorProviders? hierarchy
  • start Framsticks server over SSH
  • FJF compatible with Framsticks 4.0rc3
  • reading and writing of standard.expt
  • a proof-of-concept implementation of StandardExperiment?

CHANGELOG:
Optionally return FreeAccess? from registry.

Add SimulatorRange?.

StandardExperiment? with genotypes circulation.

Automate registration around StandardState?.

More improvements to StandardExperiment?.

Skeleton version of StandardExperiment?.

Test saving of StandardState?.

Standard experiment state is being loaded.

More development towards StandardState? reading.

Work on reading standard experiment state.

Add classes for standard experiment.

Update example standard.expt

Add FreeAccess? and FreeObject?.

Made compatible with version 4.0rc3

Change deserialization policy.

Improve SSH support.

Working running simulator over SSH.

Fix joining bug in Experiment.

Working version of SimulatorRunner?.

Add more SimulatorProviders?.

Working PrimeExperimentTest? with 4.0rc3

Add references to deserialization.

Add OpaqueObject? and it's serialization.

Add deserialization of dictionaries.

Partial implementation of deserialization.

Add more tests for deserialization.

Prepare tests for deserialization.

Add proper result to prime experiment test.

Minor fixes to simulators providers.

Draft version of SimulatorProvider?.

Add SimulatorProvider? interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/running/ExternalProcess.java

    r105 r107  
    88import java.io.PrintWriter;
    99import java.util.ArrayList;
     10import java.util.Arrays;
    1011import java.util.List;
    1112
     
    3132import com.framsticks.util.dispatching.ThrowExceptionHandler;
    3233import com.framsticks.util.io.Encoding;
     34import com.framsticks.util.lang.Strings;
    3335
    3436@FramsClassAnnotation
     
    3840        protected List<String> arguments = new ArrayList<>();
    3941        protected Process process;
    40         protected final ProcessBuilder builder = new ProcessBuilder();
    4142        protected Thread<ExternalProcess> readerThread = new Thread<ExternalProcess>();
    4243
     
    4546        protected Integer exitCode;
    4647        protected String echoInput;
     48        protected String directory;
     49        protected String host;
    4750
    4851        protected final EventListeners<ValueChange> listeners = new EventListeners<>();
     
    7073                setName("process");
    7174                arguments.add(null);
    72                 builder.redirectErrorStream(true);
    7375        }
    7476
     
    120122        @ParamAnnotation(flags = ParamFlags.USERREADONLY)
    121123        public void setDirectory(String directory) {
    122                 builder.directory(new File(directory));
     124                this.directory = directory;
     125        }
     126
     127        /**
     128         * @return the host
     129         */
     130        public String getHost() {
     131                return host;
     132        }
     133
     134        /**
     135         * @param host the host to set
     136         */
     137        public void setHost(String host) {
     138                this.host = host;
    123139        }
    124140
    125141        @ParamAnnotation
    126142        public String getDirectory() {
    127                 return builder.directory() != null ? builder.directory().getName() : ".";
     143                return Strings.toStringNullProof(directory, ".");
    128144        }
    129145
    130146        @Override
    131147        protected void joinableStart() {
     148
     149                final ProcessBuilder builder = new ProcessBuilder();
     150
     151                builder.redirectErrorStream(true);
     152                if (host == null) {
     153                        setDirectory(System.getProperties().get("user.home") + "/" + getDirectory());
     154                        setCommand(getDirectory() + "/" + getCommand());
     155                        builder.directory(new File(getDirectory()));
     156                } else {
     157                        StringBuilder b = new StringBuilder();
     158                        setCommand("./" + getCommand());
     159                        for (String a : arguments) {
     160                                b.append(" '").append(a).append("'");
     161                        }
     162                        arguments = Arrays.asList("ssh", host, "-tt", ("cd " + getDirectory() + " &&" + b.toString()));
     163                }
    132164                log.info("running process {}", this);
     165
    133166                builder.command(arguments);
    134167                try {
Note: See TracChangeset for help on using the changeset viewer.