-
Notifications
You must be signed in to change notification settings - Fork 0
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
17 changed files
with
90 additions
and
75 deletions.
There are no files selected for viewing
Binary file not shown.
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
21 changes: 15 additions & 6 deletions
21
examples/plugin-example/plugin/src/main/java/natt/plugin/MyModule1.java
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 |
---|---|---|
@@ -1,32 +1,41 @@ | ||
package natt.plugin; | ||
|
||
import utb.fai.natt.spi.INATTContext; | ||
import utb.fai.natt.spi.NATTLogger; | ||
import utb.fai.natt.spi.NATTModule; | ||
import utb.fai.natt.spi.exception.InternalErrorException; | ||
import utb.fai.natt.spi.exception.NonUniqueModuleNamesException; | ||
|
||
/** | ||
* This is your module. Modules are used to send and receive messages. Is not needed to register it in your plugin's main class. | ||
* Plugins are used by keywords. After creating an instance of a module, its reference is automatically inserted into the NATTContext | ||
* and you can access it from several different keywords using this method "ctx.getModule(name)". | ||
* This is your module. Modules are used to send and receive messages. Is not | ||
* needed to register it in your plugin's main class. Plugins are used by | ||
* keywords. After creating an instance of a module, its reference is | ||
* automatically inserted into the NATTContext and you can access it from | ||
* several different keywords using this method "ctx.getModule(name)". | ||
*/ | ||
public class MyModule1 extends NATTModule { | ||
|
||
private NATTLogger logger = new NATTLogger(MyModule1.class); | ||
|
||
public MyModule1(String name, INATTContext ctx) throws NonUniqueModuleNamesException, InternalErrorException { | ||
super(name, ctx); | ||
} | ||
|
||
@Override | ||
public void runModule() throws InternalErrorException { | ||
|
||
logger.info(super.getNameForLogger() + " Is running now!"); | ||
} | ||
|
||
@Override | ||
public boolean sendMessage(String arg0) throws InternalErrorException { | ||
public boolean sendMessage(String message) throws InternalErrorException { | ||
logger.info(super.getNameForLogger() + " sending message: " + message); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean terminateModule() { | ||
logger.info(super.getNameForLogger() + " is terminating..."); | ||
return true; | ||
} | ||
|
||
} |
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
Binary file not shown.
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
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
Oops, something went wrong.