From a709b8ebcfcf37c9ff74bd7b8826e9b513aaa075 Mon Sep 17 00:00:00 2001 From: Ralf Sippl Date: Tue, 10 Jul 2012 22:22:05 +0200 Subject: [PATCH] a couple of fixes that enabled an upgrade to Scala 2.9.2 and make deskshare debuggable in Eclipse (w. Scala IDE) --- deskshare/app/.gitignore | 1 + .../org.eclipse.wst.common.component | 34 +---- ....eclipse.wst.common.project.facet.core.xml | 10 +- .../org.eclipse.wst.ws.service.policy.prefs | 2 + .../.settings/org.scala-ide.sdt.core.prefs | 128 ++++++++++++++++++ deskshare/app/build.gradle | 18 ++- .../server/red5/DeskshareApplication.scala | 1 + .../sessions/SessionManagerGateway.scala | 7 +- .../server/stream/DeskshareStream.scala | 3 +- .../deskshare/server/svc1/BlockManager.scala | 2 +- deskshare/build.gradle | 8 +- .../.settings/org.eclipse.jdt.core.prefs | 7 + .../org.eclipse.wst.common.component | 7 + ....eclipse.wst.common.project.facet.core.xml | 8 ++ 14 files changed, 188 insertions(+), 48 deletions(-) create mode 100644 deskshare/app/.settings/org.eclipse.wst.ws.service.policy.prefs create mode 100644 deskshare/app/.settings/org.scala-ide.sdt.core.prefs create mode 100644 deskshare/common/.settings/org.eclipse.jdt.core.prefs create mode 100644 deskshare/common/.settings/org.eclipse.wst.common.component create mode 100644 deskshare/common/.settings/org.eclipse.wst.common.project.facet.core.xml diff --git a/deskshare/app/.gitignore b/deskshare/app/.gitignore index 378eac25d3..978559761a 100644 --- a/deskshare/app/.gitignore +++ b/deskshare/app/.gitignore @@ -1 +1,2 @@ build +.cache diff --git a/deskshare/app/.settings/org.eclipse.wst.common.component b/deskshare/app/.settings/org.eclipse.wst.common.component index 246afeddf2..65ebf15e3e 100644 --- a/deskshare/app/.settings/org.eclipse.wst.common.component +++ b/deskshare/app/.settings/org.eclipse.wst.common.component @@ -1,32 +1,12 @@ - - - - - - + + + + + uses + - - uses - - - uses - - - uses - - - uses - - - uses - - - uses - - - uses - + diff --git a/deskshare/app/.settings/org.eclipse.wst.common.project.facet.core.xml b/deskshare/app/.settings/org.eclipse.wst.common.project.facet.core.xml index 2de5849fc1..e2c9b81956 100644 --- a/deskshare/app/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/deskshare/app/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,8 +1,10 @@ - - + + - - + + + + diff --git a/deskshare/app/.settings/org.eclipse.wst.ws.service.policy.prefs b/deskshare/app/.settings/org.eclipse.wst.ws.service.policy.prefs new file mode 100644 index 0000000000..9cfcabe16f --- /dev/null +++ b/deskshare/app/.settings/org.eclipse.wst.ws.service.policy.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.wst.ws.service.policy.projectEnabled=false diff --git a/deskshare/app/.settings/org.scala-ide.sdt.core.prefs b/deskshare/app/.settings/org.scala-ide.sdt.core.prefs new file mode 100644 index 0000000000..b35dd4043a --- /dev/null +++ b/deskshare/app/.settings/org.scala-ide.sdt.core.prefs @@ -0,0 +1,128 @@ +Xcheck-null=false +Xcheckinit=false +Xdisable-assertions=false +Xelide-below=-2147483648 +Xexperimental=false +Xfatal-warnings=false +Xfuture=false +Xlog-implicits=false +Xmigration=false +Xno-uescape=false +Xpluginsdir=/Users/ralf/Development/eclipse-jee-indigo-32bit/configuration/org.eclipse.osgi/bundles/2438/1/.cp/lib +Ybuild-manager-debug=false +Yno-generic-signatures=false +Yno-imports=false +Ypresentation-debug=false +Ypresentation-delay=0 +Ypresentation-verbose=false +Yrecursion=0 +Yself-in-annots=false +Ystruct-dispatch=poly-cache +Ywarn-dead-code=false +buildmanager=sbt +compileorder=Mixed +deprecation=false +eclipse.preferences.version=1 +explaintypes=false +formatter.alignParameters=false +formatter.alignSingleLineCaseStatements=false +formatter.alignSingleLineCaseStatements.maxArrowIndent=40 +formatter.compactControlReadability=false +formatter.compactStringConcatenation=false +formatter.doubleIndentClassDeclaration=false +formatter.formatXml=true +formatter.indentLocalDefs=false +formatter.indentPackageBlocks=true +formatter.indentSpaces=2 +formatter.indentWithTabs=false +formatter.multilineScaladocCommentsStartOnFirstLine=false +formatter.placeScaladocAsterisksBeneathSecondAsterisk=false +formatter.preserveDanglingCloseParenthesis=false +formatter.preserveSpaceBeforeArguments=false +formatter.rewriteArrowSymbols=false +formatter.spaceBeforeColon=false +formatter.spaceInsideBrackets=false +formatter.spaceInsideParentheses=false +formatter.spacesWithinPatternBinders=true +g=vars +no-specialization=false +nowarn=false +optimise=false +organizeimports.expandcollapse=expand +organizeimports.groups=java$scala$org$com +organizeimports.wildcards=scalaz$scalaz.Scalaz +scala.compiler.useProjectSettings=false +stopBuildOnError=false +syntaxColouring.bracket.bold=false +syntaxColouring.bracket.colour=0,0,0 +syntaxColouring.bracket.italic=false +syntaxColouring.bracket.strikethrough=false +syntaxColouring.bracket.underline=false +syntaxColouring.default.bold=false +syntaxColouring.default.colour=0,0,0 +syntaxColouring.default.italic=false +syntaxColouring.default.strikethrough=false +syntaxColouring.default.underline=false +syntaxColouring.keyword.bold=true +syntaxColouring.keyword.colour=127,0,85 +syntaxColouring.keyword.italic=false +syntaxColouring.keyword.strikethrough=false +syntaxColouring.keyword.underline=false +syntaxColouring.operator.bold=false +syntaxColouring.operator.colour=0,0,0 +syntaxColouring.operator.italic=false +syntaxColouring.operator.strikethrough=false +syntaxColouring.operator.underline=false +syntaxColouring.scaladoc.bold=false +syntaxColouring.scaladoc.colour=63,95,191 +syntaxColouring.scaladoc.italic=false +syntaxColouring.scaladoc.strikethrough=false +syntaxColouring.scaladoc.underline=false +syntaxColouring.singleLineComment.bold=false +syntaxColouring.singleLineComment.colour=63,127,95 +syntaxColouring.singleLineComment.italic=false +syntaxColouring.singleLineComment.strikethrough=false +syntaxColouring.singleLineComment.underline=false +syntaxColouring.string.bold=false +syntaxColouring.string.colour=42,0,255 +syntaxColouring.string.italic=false +syntaxColouring.string.strikethrough=false +syntaxColouring.string.underline=false +syntaxColouring.xml.attributeName.bold=false +syntaxColouring.xml.attributeName.colour=127,0,127 +syntaxColouring.xml.attributeName.italic=false +syntaxColouring.xml.attributeName.strikethrough=false +syntaxColouring.xml.attributeName.underline=false +syntaxColouring.xml.attributeValue.bold=false +syntaxColouring.xml.attributeValue.colour=42,0,255 +syntaxColouring.xml.attributeValue.italic=true +syntaxColouring.xml.attributeValue.strikethrough=false +syntaxColouring.xml.attributeValue.underline=false +syntaxColouring.xml.comment.bold=false +syntaxColouring.xml.comment.colour=63,85,191 +syntaxColouring.xml.comment.italic=false +syntaxColouring.xml.comment.strikethrough=false +syntaxColouring.xml.comment.underline=false +syntaxColouring.xml.equals.bold=false +syntaxColouring.xml.equals.colour=0,0,0 +syntaxColouring.xml.equals.italic=false +syntaxColouring.xml.equals.strikethrough=false +syntaxColouring.xml.equals.underline=false +syntaxColouring.xml.processingInstruction.bold=false +syntaxColouring.xml.processingInstruction.colour=0,128,128 +syntaxColouring.xml.processingInstruction.italic=false +syntaxColouring.xml.processingInstruction.strikethrough=false +syntaxColouring.xml.processingInstruction.underline=false +syntaxColouring.xml.tagDelimiter.bold=false +syntaxColouring.xml.tagDelimiter.colour=0,128,128 +syntaxColouring.xml.tagDelimiter.italic=false +syntaxColouring.xml.tagDelimiter.strikethrough=false +syntaxColouring.xml.tagDelimiter.underline=false +syntaxColouring.xml.tagName.bold=false +syntaxColouring.xml.tagName.colour=63,127,127 +syntaxColouring.xml.tagName.italic=false +syntaxColouring.xml.tagName.strikethrough=false +syntaxColouring.xml.tagName.underline=false +target=jvm-1.5 +unchecked=false +verbose=false diff --git a/deskshare/app/build.gradle b/deskshare/app/build.gradle index f19eca1dbe..199a59e183 100755 --- a/deskshare/app/build.gradle +++ b/deskshare/app/build.gradle @@ -34,16 +34,20 @@ dependencies { providedCompile ':jul-to-slf4j:1.6.1@jar' compile project(':common') - providedCompile 'commons-fileupload:commons-fileupload:1.2.2@jar' - providedCompile 'commons-io:commons-io:2.1@jar' + compile 'commons-fileupload:commons-fileupload:1.2.2@jar' + compile 'commons-io:commons-io:2.1@jar' // Libraries needed to run the scala tools - scalaTools 'org.scala-lang:scala-compiler:2.7.7' - scalaTools 'org.scala-lang:scala-library:2.7.7' + scalaTools 'org.scala-lang:scala-compiler:2.9.2' + scalaTools 'org.scala-lang:scala-library:2.9.2' + // workaround for http://issues.gradle.org/browse/GRADLE-1273 + compileScala.classpath = sourceSets.main.compileClasspath + files(sourceSets.main.classesDir) + compileTestScala.classpath = sourceSets.test.compileClasspath + files(sourceSets.test.classesDir) + // Libraries needed for scala api - compile 'org.scala-lang:scala-library:2.7.7' - compile 'net/lag/configgy:configgy:1.5@jar' + compile 'org.scala-lang:scala-library:2.9.2' + compile 'net.lag:configgy:2.0.0' // Testing compile 'org.testng:testng:5.8@jar' @@ -55,7 +59,7 @@ dependencies { //redis compile 'redis.clients:jedis:1.5.1' - providedCompile 'commons-pool:commons-pool:1.5.6' + compile 'commons-pool:commons-pool:1.5.6' } test { diff --git a/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/red5/DeskshareApplication.scala b/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/red5/DeskshareApplication.scala index 4fbf6062ae..44a709060c 100755 --- a/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/red5/DeskshareApplication.scala +++ b/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/red5/DeskshareApplication.scala @@ -26,6 +26,7 @@ import org.red5.server.so.SharedObjectService import org.red5.server.api.so.{ISharedObject, ISharedObjectService} import org.red5.server.stream.{BroadcastScope, IBroadcastScope, IProviderService} import org.bigbluebutton.deskshare.server.ScreenVideoBroadcastStream +import org.bigbluebutton.deskshare.server.RtmpClientAdapter import org.bigbluebutton.deskshare.server.stream.StreamManager import org.bigbluebutton.deskshare.server.socket.DeskShareServer import org.bigbluebutton.deskshare.server.MultiThreadedAppAdapter diff --git a/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/sessions/SessionManagerGateway.scala b/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/sessions/SessionManagerGateway.scala index 050ca5a252..1beb5ce057 100755 --- a/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/sessions/SessionManagerGateway.scala +++ b/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/sessions/SessionManagerGateway.scala @@ -21,7 +21,6 @@ */ package org.bigbluebutton.deskshare.server.sessions -import org.bigbluebutton.deskshare.common.Dimension import org.bigbluebutton.deskshare.server.svc1.Dimension import org.bigbluebutton.deskshare.server.stream.StreamManager import org.bigbluebutton.deskshare.server.session.ISessionManagerGateway @@ -36,10 +35,10 @@ class SessionManagerGateway(streamManager: StreamManager, keyFrameInterval: Int, val sessionManager: SessionManagerSVC = new SessionManagerSVC(streamManager, keyFrameInterval, interframeInterval, waitForAllBlocks) sessionManager.start - def createSession(room: String, screenDim: common.Dimension, blockDim: common.Dimension, seqNum: Int): Unit = { + def createSession(room: String, screenDim: org.bigbluebutton.deskshare.common.Dimension, blockDim: org.bigbluebutton.deskshare.common.Dimension, seqNum: Int): Unit = { log.info("SessionManagerGateway:createSession for %s", room) - sessionManager ! new CreateSession(room, new svc1.Dimension(screenDim.getWidth(), screenDim.getHeight()), - new svc1.Dimension(blockDim.getWidth(), blockDim.getHeight()), seqNum) + sessionManager ! new CreateSession(room, new Dimension(screenDim.getWidth(), screenDim.getHeight()), + new Dimension(blockDim.getWidth(), blockDim.getHeight()), seqNum) log.info("SessionManagerGateway:Sent create session for %s", room) } diff --git a/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/stream/DeskshareStream.scala b/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/stream/DeskshareStream.scala index d719389e4c..0e3163f171 100755 --- a/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/stream/DeskshareStream.scala +++ b/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/stream/DeskshareStream.scala @@ -24,6 +24,7 @@ package org.bigbluebutton.deskshare.server.stream import org.bigbluebutton.deskshare.server.recorder.Recorder import org.bigbluebutton.deskshare.server.red5.DeskshareApplication import org.bigbluebutton.deskshare.server.ScreenVideoBroadcastStream +import org.bigbluebutton.deskshare.server.RtmpClientAdapter import org.red5.server.api.{IContext, IScope} import org.red5.server.api.so.ISharedObject import org.red5.server.net.rtmp.event.VideoData; @@ -62,7 +63,7 @@ class DeskshareStream(app: DeskshareApplication, name: String, val width: Int, v broadcastStream = bs; app.createDeskshareClient(name) match { case None => return false - case Some(dsc) => { + case Some(dsc:RtmpClientAdapter) => { dsClient = dsc; recorder.addListener(dsClient) return true diff --git a/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/svc1/BlockManager.scala b/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/svc1/BlockManager.scala index 0a2a17acde..d18baf3a00 100755 --- a/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/svc1/BlockManager.scala +++ b/deskshare/app/src/main/scala/org/bigbluebutton/deskshare/server/svc1/BlockManager.scala @@ -30,7 +30,7 @@ import net.lag.logging.Logger class BlockManager(room: String, screenDim: Dimension, blockDim: Dimension, waitForAllBlocks: Boolean) extends BlockFactory { private val log = Logger.get - private var blocksMap = new ConcurrentHashMap[Integer, Block] + private var blocksMap = new ConcurrentHashMap[Int, Block] private var numberOfRows = getNumberOfRows(screenDim, blockDim) private var numberOfColumns = getNumberOfColumns(screenDim, blockDim) diff --git a/deskshare/build.gradle b/deskshare/build.gradle index 27b1b4d996..be6f2886e9 100755 --- a/deskshare/build.gradle +++ b/deskshare/build.gradle @@ -100,13 +100,13 @@ dependencies { compile 'net.jcip:jcip-annotations:1.0@jar' // Libraries needed to run the scala tools - scalaTools 'org.scala-lang:scala-compiler:2.7.7' - scalaTools 'org.scala-lang:scala-library:2.7.7' + scalaTools 'org.scala-lang:scala-compiler:2.9.2' + scalaTools 'org.scala-lang:scala-library:2.9.2' // Libraries needed for scala api - compile 'org.scala-lang:scala-library:2.7.7' + compile 'org.scala-lang:scala-library:2.9.2' - compile 'net/lag/configgy:configgy:1.5@jar' + compile 'net.lag:configgy:2.0.0' //redis compile 'redis.clients:jedis:2.0.0' diff --git a/deskshare/common/.settings/org.eclipse.jdt.core.prefs b/deskshare/common/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..c537b63063 --- /dev/null +++ b/deskshare/common/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/deskshare/common/.settings/org.eclipse.wst.common.component b/deskshare/common/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000000..c05e0b5b80 --- /dev/null +++ b/deskshare/common/.settings/org.eclipse.wst.common.component @@ -0,0 +1,7 @@ + + + + + + + diff --git a/deskshare/common/.settings/org.eclipse.wst.common.project.facet.core.xml b/deskshare/common/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000000..62f50b1b69 --- /dev/null +++ b/deskshare/common/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + +