-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
297 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
core/src/main/scala/se/sics/kompics/ComponentCoreScala.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
/* | ||
* This file is part of the Kompics component model runtime. | ||
* | ||
* Copyright (C) 2009 Swedish Institute of Computer Science (SICS) | ||
* Copyright (C) 2009 Royal Institute of Technology (KTH) | ||
* | ||
* Kompics is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
*/ | ||
package se.sics.kompics | ||
|
||
import se.sics.kompics.config.ConfigUpdate | ||
|
||
/** | ||
* A small adapter class for Java -> Scala | ||
* | ||
* @author Lars Kroll {@literal <lkroll@kth.se>} | ||
*/ | ||
protected[kompics] abstract class ComponentCoreScala extends ComponentCore { | ||
override private[kompics] def doConfigUpdate(update: ConfigUpdate): Unit = { | ||
this.doConfigUpdateScala(update); | ||
} | ||
|
||
protected[kompics] def doConfigUpdateScala(update: ConfigUpdate): Unit; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* This file is part of the Kompics component model runtime. | ||
* | ||
* Copyright (C) 2009 Swedish Institute of Computer Science (SICS) | ||
* Copyright (C) 2009 Royal Institute of Technology (KTH) | ||
* | ||
* Kompics is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
*/ | ||
package se.sics.kompics.sl | ||
|
||
import se.sics.kompics.{ Kompics => JKompics, Scheduler, FaultHandler, Init => JInit } | ||
import se.sics.kompics.config.{ Config => JConfig } | ||
|
||
/** | ||
* Convenient object to forward static members of `se.sics.kompics.Kompics`. | ||
* | ||
* @author Lars Kroll {@literal <lkroll@kth.se>} | ||
*/ | ||
object Kompics { | ||
val SHUTDOWN_TIMEOUT = JKompics.SHUTDOWN_TIMEOUT; | ||
val logger = JKompics.logger; | ||
val maxNumOfExecutedEvents = JKompics.maxNumOfExecutedEvents; | ||
|
||
def scheduler_=(sched: Scheduler): Unit = JKompics.setScheduler(sched); | ||
|
||
def scheduler: Scheduler = JKompics.getScheduler; | ||
|
||
def faultHandler_=(fh: FaultHandler): Unit = JKompics.setFaultHandler(fh); | ||
|
||
def resetFaultHandler(): Unit = JKompics.resetFaultHandler(); | ||
|
||
def faultHandler: FaultHandler = JKompics.getFaultHandler; | ||
|
||
def config_=(conf: JConfig): Unit = JKompics.setConfig(conf); | ||
|
||
def resetConfig(): Unit = JKompics.resetConfig(); | ||
|
||
def config: JConfig = JKompics.getConfig; | ||
|
||
def isOn: Boolean = JKompics.isOn(); | ||
|
||
def createAndStart[C <: ComponentDefinition](main: Class[C]): Unit = JKompics.createAndStart[C](main); | ||
|
||
def createAndStart[C <: ComponentDefinition](main: Class[C], init: JInit[C]): Unit = JKompics.createAndStart[C](main, init); | ||
|
||
def createAndStart[C <: ComponentDefinition](main: Class[C], workers: Int): Unit = JKompics.createAndStart[C](main, workers); | ||
|
||
def createAndStart[C <: ComponentDefinition](main: Class[C], init: JInit[C], workers: Int): Unit = JKompics.createAndStart[C](main, init, workers); | ||
|
||
def createAndStart[C <: ComponentDefinition](main: Class[C], workers: Int, maxEventExecuteNumber: Int): Unit = JKompics.createAndStart[C](main, workers, maxEventExecuteNumber); | ||
|
||
def createAndStart[C <: ComponentDefinition](main: Class[C], init: JInit[C], workers: Int, maxEventExecuteNumber: Int): Unit = JKompics.createAndStart[C](main, init, workers, maxEventExecuteNumber); | ||
|
||
def asyncShutdown(): Unit = JKompics.asyncShutdown(); | ||
|
||
def shutdown(): Unit = JKompics.shutdown(); | ||
|
||
def forceShutdown(): Unit = JKompics.forceShutdown(); | ||
|
||
@throws(classOf[InterruptedException]) | ||
def waitForTermination(): Unit = JKompics.waitForTermination(); | ||
|
||
def logStats(): Unit = JKompics.logStats(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.