-
Notifications
You must be signed in to change notification settings - Fork 1
New Extension
papousek edited this page Apr 20, 2012
·
2 revisions
The module should have the following maven description
<groupId>org.sybila.parasim.extension</groupId>
<artifactId>your-new-extension-api</artifactId>
<packaging>jar</packaging>
To get configuration from Parasim
<parent>
<groupId>org.sybila.parasim</groupId>
<artifactId>parasim-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>${path.to.the.parasim.parent.pom.xml}</relativePath>
</parent>
The module should have the following maven description
<groupId>org.sybila.parasim.extension</groupId>
<artifactId>your-new-extension-impl</artifactId>
<packaging>jar</packaging>
To get configuration from Parasim
<parent>
<groupId>org.sybila.parasim</groupId>
<artifactId>parasim-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>${path.to.the.parasim.parent.pom.xml}</relativePath>
</parent>
See Extension Loader page to create enter points to your implementation module.
The first way:
public class FunctionalityRegistrar {
@Inject
private Instance<Functionality> functionality;
public void registerFunctionality(@Observes ManagerStarted event, ...) {
functionality.set(new Functionality(...));
}
}
The second way:
public class FunctionalityRegistrar {
@Provide
public Functionality provideFunctionality(...) {
functionality.set(new Functionality(...));
}
}
You can fire a new event:
public class FunctionalityRegistrar {
@Inject
private Event<FunctionalityReady> event;
@Provide
public Functionality provideFunctionality(...) {
functionality.set(new Functionality(...));
event.fire(new FunctionalityReady());
}
}