Implemented first SCR component

This commit is contained in:
Willem Cazander 2022-03-02 19:18:47 +01:00
parent 00cb859cd9
commit c6bee21cee
16 changed files with 149 additions and 3 deletions

View file

@ -41,6 +41,11 @@ public class GDXAppVrGem4Activator implements BundleActivator {
public void start(final BundleContext context) {
// LOG.info("GDXAppVrGem4Activator started");
try {
Thread.sleep(2000);
} catch (InterruptedException ignored) {
}
ServiceReference<SystemWarpTerminal> termRef = context.getServiceReference(SystemWarpTerminal.class);
SystemWarpTerminal terminal = context.getService(termRef);
@ -162,7 +167,7 @@ public class GDXAppVrGem4Activator implements BundleActivator {
} else {
bootScreen.bootLine("vrGEM4: chains resolved.");
try {
Thread.sleep(5000);
Thread.sleep(2000);
} catch (InterruptedException ignored) {
}
Gdx.app.postRunnable(new Runnable() {

View file

@ -0,0 +1,28 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpLogger;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip;
@Component
public class TestComponent {
@Reference
private SystemWarpLogger log;
@Reference
private SystemWarpShip warpShip;
@Activate
void open() {
log.info(this, "Activated warpEngine: {}", warpShip.getWarpShip().theShip().getEngine());
}
@Deactivate
void close() {
}
}