- try to consolidate apps

This commit is contained in:
Richard Alam 2012-10-30 14:07:43 +00:00
parent 2d6d1f83c5
commit d3f1c22e46
8 changed files with 97 additions and 22 deletions

View File

@ -109,9 +109,7 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter {
String externalUserID = ((String) params[6]).toString();
String internalUserID = ((String) params[7]).toString();
if (record == true) {
recorderApplication.createRecordSession(sessionName);
}

View File

@ -22,9 +22,7 @@
package org.bigbluebutton.conference.service.presentation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.red5.logging.Red5LoggerFactory;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

View File

@ -40,17 +40,17 @@ public class PresentationService {
}
@SuppressWarnings("unchecked")
public Map getPresentationInfo() {
public Map<String, Object> getPresentationInfo() {
log.debug("Getting presentation information.");
IScope scope = Red5.getConnectionLocal().getScope();
ArrayList<String> curPresenter = participantsApplication.getCurrentPresenter(scope.getName());
int curSlide = presentationApplication.getCurrentSlide(scope.getName());
Boolean isSharing = presentationApplication.getSharingPresentation(scope.getName());
String currentPresentation = presentationApplication.getCurrentPresentation(scope.getName());
Map presentersSettings = presentationApplication.getPresenterSettings(scope.getName());
Map<String, Object> presentersSettings = presentationApplication.getPresenterSettings(scope.getName());
ArrayList<String> presentationNames = presentationApplication.getPresentations(scope.getName());
Map presenter = new HashMap();
Map<String, Object> presenter = new HashMap<String, Object>();
if (curPresenter != null) {
presenter.put("hasPresenter", true);
presenter.put("user", curPresenter.get(0));
@ -61,7 +61,7 @@ public class PresentationService {
presenter.put("hasPresenter", false);
}
Map presentation = new HashMap();
Map<String, Object> presentation = new HashMap<String, Object>();
if (isSharing.booleanValue()) {
presentation.put("sharing", true);
presentation.put("slide", curSlide);
@ -77,7 +77,7 @@ public class PresentationService {
presentation.put("sharing", false);
}
Map presentationInfo = new HashMap();
Map<String, Object> presentationInfo = new HashMap<String, Object>();
presentationInfo.put("presenter", presenter);
presentationInfo.put("presentation", presentation);
presentationInfo.put("presentations", presentationNames);

View File

@ -0,0 +1,50 @@
package org.bigbluebutton.webconference;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
public class BigBlueButton {
private static Logger log = Red5LoggerFactory.getLogger(BigBlueButton.class, "bigbluebutton");
private BlockingQueue<Message> messages = new LinkedBlockingQueue<Message>();
private static final ExecutorService executor = Executors.newSingleThreadExecutor();
private volatile boolean processMessages = false;
public void start() {
processMessages = true;
executor.execute(new Runnable() {
public void run() {
Message msg;
while (processMessages) {
try {
msg = messages.take();
processMessage(msg);
} catch (InterruptedException e) {
log.error("InterruptedException while waiting for messages");
stop();
}
}
}
});
}
private void processMessage(Message message) {
}
public void send(Message message) {
messages.offer(message);
}
public void stop() {
processMessages = false;
executor.shutdown();
}
}

View File

@ -41,25 +41,28 @@
*/
package org.bigbluebutton.webconference;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class Conference {
public class Meeting {
private final Map<String, Object> apps;
private final Map<String, User> users = new HashMap<String, User>();
private final String name;
private final String id;
public Conference(String name) {
this.name = name;
apps = new ConcurrentHashMap<String, Object>();
public Meeting(String id) {
this.id = id;
}
public String getID() {
return id;
}
public void addApplication(String app, Object data) {
apps.put(app, data);
public void processMessage(Message message) {
}
public String getName() {
return name;
public void end() {
}
}

View File

@ -21,6 +21,22 @@
*/
package org.bigbluebutton.webconference;
public class ConferenceManager {
import java.util.HashMap;
import java.util.Map;
public class MeetingManager {
private final Map<String, Meeting> meetings = new HashMap<String, Meeting>();
public void create(String id) {
Meeting m = new Meeting(id);
meetings.put(id, m);
}
public void destory(String id) {
Meeting m = meetings.remove(id);
if (m != null) {
m.end();
}
}
}

View File

@ -0,0 +1,5 @@
package org.bigbluebutton.webconference;
public class Message {
}

View File

@ -0,0 +1,5 @@
package org.bigbluebutton.webconference;
public class User {
}