Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Some fixes #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/main/scala/de/hsaugsburg/smas/node/SmasNode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,29 @@ abstract class SmasNode extends Serializable
me.getId
}

def getAllRegisteredPlugins = pluginManager.getAllRegisteredPluginNames

def registerPlugin(pluginName: String, plugin: SmasPlugin) =
{
pluginManager.registerPlugin(plugin, pluginName)
var result = true

plugin.setSurroundingNode(node)

if(pluginManager.registerPlugin(pluginName, plugin)){
result = false
}

/* Should registered plugin start automatically?
*

if(!plugin.start)
{
log.warn("Plugin was not started: {}", plugin)
result = false
}
*/
result
}

def unregisterPlugin(plugin: String) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ trait PluginManager extends Serializable
def registerPlugin(plugin: SmasPlugin, pluginName: String): Boolean
def registerPlugin(pluginName: String, plugin: SmasPlugin): Boolean
def unRegisterPlugin(pluginName: String): Boolean
def getAllRegisteredPluginNames: List[String]
def getAmountOfPlugins: Int = pluginList.size
def getAddressForPluginName(name: String): AddressBookEntry
def startAllPlugins: Boolean
Expand Down