Skip to content

Commit

Permalink
use java binary instead of jitsi script files to start jicofo and jvb
Browse files Browse the repository at this point in the history
  • Loading branch information
deleolajide committed Nov 22, 2020
1 parent 945afcc commit 477ad1b
Show file tree
Hide file tree
Showing 8 changed files with 302,096 additions and 549 deletions.
5 changes: 1 addition & 4 deletions offocus/src/java/de/mxro/process/internal/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ public void destory() {
} catch (final IOException e) {
listener.onError(e);
}
//process.descendants().forEach(ph -> {
// ph.destroy();
//});
process.destroyForcibly();
//process.destroyForcibly();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public synchronized void initialize( File pluginDirectory) throws Exception
" --user_name=" + jicofoSubdomain +
" --user_password=" + config.getFocusPassword();

String jicofoHomePath = pluginDirectory.getAbsolutePath() + File.separator + "classes" + File.separator + "jicofo";
String jicofoHomePath = pluginDirectory.getPath() + File.separator + "classes" + File.separator + "jicofo";
File props_file = new File(jicofoHomePath + File.separator + "sip-communicator.properties");
Properties props = new Properties();

Expand All @@ -102,17 +102,20 @@ public synchronized void initialize( File pluginDirectory) throws Exception
{
javaExec = javaExec + ".exe";
}
makeFileExecutable(javaExec);
String cmdLine = javaExec + " -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=. -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=. -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp " + jicofoHomePath + "/jicofo.jar;" + jicofoHomePath + "/jicofo-1.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.jicofo.Main" + parameters;
jicofoThread = Spawn.startProcess(cmdLine, new File(jicofoHomePath), this);

jicofoThread = Spawn.startProcess(javaExec + " -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=. -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=. -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp ./jicofo.jar;./jicofo-1.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.jicofo.Main" + parameters, new File(jicofoHomePath), this);

Log.info( "Successfully initialized Jitsi Focus Component (jicofo)." + javaExec + parameters);
Log.info( "Successfully initialized Jitsi Focus Component (jicofo).\n" + cmdLine);
}

public synchronized void destroy() throws Exception
{
Log.debug( "Destroying Jitsi Focus Component..." );
Log.debug( "Destroying Jitsi Focus process..." );

if (jicofoThread != null) jicofoThread.destory();

Log.debug( "Destroyed Jitsi Focus process..." );
}

public void onOutputLine(final String line)
Expand All @@ -139,4 +142,11 @@ public void onError(final Throwable t)
Log.error("Thread error", t);
}

private void makeFileExecutable(String path)
{
File file = new File(path);
file.setReadable(true, true);
file.setWritable(true, true);
file.setExecutable(true, true);
}
}
129,551 changes: 129,310 additions & 241 deletions ofmeet/classes/jitsi-meet/libs/app.bundle.min.js

Large diffs are not rendered by default.

21,748 changes: 21,722 additions & 26 deletions ofmeet/classes/jitsi-meet/libs/lib-jitsi-meet.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ofmeet/src/java/de/mxro/process/internal/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void destory() {
} catch (final IOException e) {
listener.onError(e);
}
process.destroyForcibly();
//process.destroyForcibly();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public synchronized void initialize(final PluginManager manager, final File plug
final OFMeetConfig config = new OFMeetConfig();
ensureJvbUser(config);

final String jvbHomePath = pluginDirectory.getAbsolutePath() + File.separator + "classes" + File.separator + "jvb";
final String jvbHomePath = pluginDirectory.getPath() + File.separator + "classes" + File.separator + "jvb";
final String domain = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
final String hostname = XMPPServer.getInstance().getServerInfo().getHostname();
final String main_muc = JiveGlobals.getProperty( "ofmeet.main.muc", "conference." + domain);
Expand Down Expand Up @@ -140,9 +140,11 @@ public synchronized void initialize(final PluginManager manager, final File plug
javaExec = javaExec + ".exe";
}

jvbThread = Spawn.startProcess(javaExec + " -Dconfig.file=./application.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=. -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=. -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp ./jitsi-videobridge.jar;./jitsi-videobridge-2.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.videobridge.MainKt --apis=rest", new File(jvbHomePath), this);
makeFileExecutable(javaExec);
String cmdLine = javaExec + " -Dconfig.file=./application.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=. -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=. -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp " + jvbHomePath + "/jitsi-videobridge.jar;" + jvbHomePath + "/jitsi-videobridge-2.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.videobridge.MainKt --apis=rest";
jvbThread = Spawn.startProcess(cmdLine, new File(jvbHomePath), this);

Log.trace( "Successfully initialized Jitsi Videobridge." + javaExec );
Log.info( "Successfully initialized Jitsi Videobridge.\n" + cmdLine );
}

public String getIpAddress()
Expand Down Expand Up @@ -188,12 +190,13 @@ public JSONObject getConferenceStats()

public synchronized void destroy() throws Exception
{
Log.info(getConferenceStats().toString());
//Log.info(getConferenceStats().toString());
Log.debug( "Destroying jvb process." );

if (jvbThread != null) jvbThread.destory();
if (jitsiPlugin != null ) jitsiPlugin.destroyPlugin();

Log.trace( "Successfully destroyed Jitsi Videobridge." );
Log.debug( "Successfully destroyed jvb process." );
}

public void onOutputLine(final String line)
Expand Down Expand Up @@ -246,4 +249,11 @@ private void ensureJvbUser(OFMeetConfig config)
}
}
}
private void makeFileExecutable(String path)
{
File file = new File(path);
file.setReadable(true, true);
file.setWritable(true, true);
file.setExecutable(true, true);
}
}
129,551 changes: 129,310 additions & 241 deletions web/src/main/webapp/libs/app.bundle.min.js

Large diffs are not rendered by default.

21,748 changes: 21,722 additions & 26 deletions web/src/main/webapp/libs/lib-jitsi-meet.min.js

Large diffs are not rendered by default.

0 comments on commit 477ad1b

Please sign in to comment.