- remove old buses

This commit is contained in:
Richard Alam 2018-04-21 09:29:37 -07:00
parent e08680987d
commit 10d6649889
6 changed files with 12 additions and 104 deletions

View File

@ -16,7 +16,7 @@ class ClientGWApplication(system: ActorSystem, val msgToClientGW: MsgToClientGW,
log.debug("*********** meetingManagerChannel = " + meetingManagerChannel)
private val msgFromClientEventBus = new MsgFromClientEventBus
//private val msgFromClientEventBus = new MsgFromClientEventBus
//private val jsonMsgToAkkaAppsBus = new JsonMsgToAkkaAppsBus
private val redisPublisher = new RedisPublisher(system)
private val msgSender: MessageSender = new MessageSender(redisPublisher)
@ -28,7 +28,7 @@ class ClientGWApplication(system: ActorSystem, val msgToClientGW: MsgToClientGW,
private val meetingManagerActorRef = system.actorOf(MeetingManagerActor.props(connEventBus), "meetingManagerActor")
connEventBus.subscribe(meetingManagerActorRef, fromAkkaAppsChannel)
msgFromClientEventBus.subscribe(meetingManagerActorRef, fromClientChannel)
connEventBus.subscribe(meetingManagerActorRef, fromClientChannel)
private val msgToAkkaAppsToJsonActor = system.actorOf(MsgToAkkaAppsToJsonActor.props(connEventBus), "msgToAkkaAppsToJsonActor")
@ -51,17 +51,17 @@ class ClientGWApplication(system: ActorSystem, val msgToClientGW: MsgToClientGW,
def connect(connInfo: ConnInfo): Unit = {
//log.debug("**** ClientGWApplication connect " + connInfo)
msgFromClientEventBus.publish(MsgFromClientBusMsg(fromClientChannel, new ConnectMsg(connInfo)))
connEventBus.publish(MsgFromConnBusMsg(fromClientChannel, new ConnectMsg(connInfo)))
}
def disconnect(connInfo: ConnInfo): Unit = {
//log.debug("**** ClientGWApplication disconnect " + connInfo)
msgFromClientEventBus.publish(MsgFromClientBusMsg(fromClientChannel, new DisconnectMsg(connInfo)))
connEventBus.publish(MsgFromConnBusMsg(fromClientChannel, new DisconnectMsg(connInfo)))
}
def handleMsgFromClient(connInfo: ConnInfo, json: String): Unit = {
//log.debug("**** ClientGWApplication handleMsgFromClient " + json)
msgFromClientEventBus.publish(MsgFromClientBusMsg(fromClientChannel, new MsgFromClientMsg(connInfo, json)))
connEventBus.publish(MsgFromConnBusMsg(fromClientChannel, new MsgFromClientMsg(connInfo, json)))
}
def send(channel: String, json: String): Unit = {

View File

@ -1,10 +1,11 @@
package org.bigbluebutton.client
import java.io.{ PrintWriter, StringWriter }
import scala.concurrent.duration._
import akka.actor.{ Actor, ActorLogging, OneForOneStrategy, Props }
import akka.actor.SupervisorStrategy.Resume
import org.bigbluebutton.client.bus.JsonMsgToSendToAkkaApps
import org.bigbluebutton.client.bus.JsonMsgToAkkaApps
import org.bigbluebutton.client.endpoint.redis.MessageSender
object MessageSenderActor {
@ -24,7 +25,7 @@ class MessageSenderActor(msgSender: MessageSender) extends Actor with ActorLoggi
}
def receive = {
case msg: JsonMsgToSendToAkkaApps => msgSender.send(msg.channel, msg.json)
case msg: JsonMsgToAkkaApps => msgSender.send(msg.channel, msg.json)
}
}

View File

@ -2,6 +2,7 @@ package org.bigbluebutton.client.bus
import akka.actor.ActorRef
import akka.event.{ EventBus, LookupClassification }
import org.bigbluebutton.client.ConnInfo
import org.bigbluebutton.common2.msgs.BbbCommonEnvJsNodeMsg
case class ConnInfo2(id: String)
@ -19,6 +20,9 @@ case class BroadcastMsgToMeeting(meetingId: String, data: BbbCommonEnvJsNodeMsg)
case class DirectMsgToClient(meetingId: String, connId: String, data: BbbCommonEnvJsNodeMsg) extends FromConnMsg
case class DisconnectClientMsg(meetingId: String, connId: String) extends FromConnMsg
case class DisconnectAllMeetingClientsMsg(meetingId: String) extends FromConnMsg
case class ConnectMsg(connInfo: ConnInfo) extends FromConnMsg
case class DisconnectMsg(connInfo: ConnInfo) extends FromConnMsg
case class MsgFromClientMsg(connInfo: ConnInfo, json: String) extends FromConnMsg
case class MsgFromConnBusMsg(val topic: String, val payload: FromConnMsg)

View File

@ -1,31 +0,0 @@
package org.bigbluebutton.client.bus
import akka.actor.ActorRef
import akka.event.{ EventBus, LookupClassification }
case class JsonMsgFromAkkaAppsEvent(val topic: String, val payload: JsonMsgFromAkkaApps)
class JsonMsgFromAkkaAppsBus extends EventBus with LookupClassification {
type Event = JsonMsgFromAkkaAppsEvent
type Classifier = String
type Subscriber = ActorRef
// is used for extracting the classifier from the incoming events
override protected def classify(event: Event): Classifier = event.topic
// will be invoked for each event for all subscribers which registered themselves
// for the events classifier
override protected def publish(event: Event, subscriber: Subscriber): Unit = {
subscriber ! event.payload
}
// must define a full order over the subscribers, expressed as expected from
// `java.lang.Comparable.compare`
override protected def compareSubscribers(a: Subscriber, b: Subscriber): Int =
a.compareTo(b)
// determines the initial size of the index data structure
// used internally (i.e. the expected number of different classifiers)
override protected def mapSize: Int = 128
}

View File

@ -1,31 +0,0 @@
package org.bigbluebutton.client.bus
import akka.actor.ActorRef
import akka.event.{ EventBus, LookupClassification }
case class JsonMsgToSendToAkkaApps(channel: String, json: String)
case class JsonMsgToAkkaAppsBusMsg(val topic: String, payload: JsonMsgToSendToAkkaApps)
class JsonMsgToAkkaAppsBus extends EventBus with LookupClassification {
type Event = JsonMsgToAkkaAppsBusMsg
type Classifier = String
type Subscriber = ActorRef
// is used for extracting the classifier from the incoming events
override protected def classify(event: Event): Classifier = event.topic
// will be invoked for each event for all subscribers which registered themselves
// for the events classifier
override protected def publish(event: Event, subscriber: Subscriber): Unit = {
subscriber ! event.payload
}
// must define a full order over the subscribers, expressed as expected from
// `java.lang.Comparable.compare`
override protected def compareSubscribers(a: Subscriber, b: Subscriber): Int =
a.compareTo(b)
// determines the initial size of the index data structure
// used internally (i.e. the expected number of different classifiers)
override protected def mapSize: Int = 128
}

View File

@ -1,35 +0,0 @@
package org.bigbluebutton.client.bus
import akka.actor.ActorRef
import akka.event.{ EventBus, LookupClassification }
import org.bigbluebutton.client.ConnInfo
sealed trait FromConnectionMsg
case class ConnectMsg(connInfo: ConnInfo) extends FromConnectionMsg
case class DisconnectMsg(connInfo: ConnInfo) extends FromConnectionMsg
case class MsgFromClientMsg(connInfo: ConnInfo, json: String) extends FromConnectionMsg
case class MsgFromClientBusMsg(val topic: String, val payload: FromConnectionMsg)
class MsgFromClientEventBus extends EventBus with LookupClassification {
type Event = MsgFromClientBusMsg
type Classifier = String
type Subscriber = ActorRef
// is used for extracting the classifier from the incoming events
override protected def classify(event: Event): Classifier = event.topic
// will be invoked for each event for all subscribers which registered themselves
// for the events classifier
override protected def publish(event: Event, subscriber: Subscriber): Unit = {
subscriber ! event.payload
}
// must define a full order over the subscribers, expressed as expected from
// `java.lang.Comparable.compare`
override protected def compareSubscribers(a: Subscriber, b: Subscriber): Int =
a.compareTo(b)
// determines the initial size of the index data structure
// used internally (i.e. the expected number of different classifiers)
override protected def mapSize: Int = 128
}