Implemented first SCR component
This commit is contained in:
parent
00cb859cd9
commit
c6bee21cee
17
README.md
17
README.md
|
@ -6,7 +6,22 @@ Final version will be written in HolyC++ on templeOS called VRGEM⁴.
|
|||
|
||||
## Project Setup
|
||||
|
||||
Use the AdoptOpenJDK(11++) to run the demo.
|
||||
Requirements;
|
||||
|
||||
* Setup [Hyperdrive](https://github.com/hyperspace-org/hyperdrive-service)
|
||||
* Use an AdoptOpenJDK(11++) to run the demo.
|
||||
|
||||
### Project Launch Release
|
||||
|
||||
When hyperdrive is running just start the jar file with;
|
||||
|
||||
java -jar todo.jar
|
||||
|
||||
### Project Launch IDE
|
||||
|
||||
Run "mvn package" once before starting.
|
||||
|
||||
Append "use-local" to the main launcher to use the local chains.
|
||||
|
||||
## Duytschen Code
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<properties>
|
||||
<entry key="1c2d010066a39d96ace8af0ecc37c72d6f79109f30939e2959befcd9ce25fc8d">../gdxapp4d-chain-sys-engine/src/chain</entry>
|
||||
<entry key="f8be3b29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41a410b">../gdxapp4d-chain-sys-ocean/src/chain</entry>
|
||||
<entry key="8833aa29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41b58de">../gdxapp4d-chain-dep-osgi-scr/src/chain</entry>
|
||||
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc">../gdxapp4d-vrgem4/src/chain</entry>
|
||||
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc.gdxapp4d-vrgem4.jar">../gdxapp4d-vrgem4/target/classes</entry>
|
||||
</properties>
|
||||
|
|
10
gdxapp4d-chain-dep-osgi-scr/pom.xml
Normal file
10
gdxapp4d-chain-dep-osgi-scr/pom.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>love.distributedrebirth.gdxapp4d</groupId>
|
||||
<artifactId>gdxapp4d</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>gdxapp4d-chain-dep-osgi-scr</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
</project>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
11
gdxapp4d-chain-dep-osgi-scr/src/chain/warp-sea.xml
Normal file
11
gdxapp4d-chain-dep-osgi-scr/src/chain/warp-sea.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<root:ocean xmlns:root="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root"
|
||||
xmlns:link="http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-link"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd">
|
||||
<link:sea name="DepOSGI SCR" provider="gdxapp4d.system" author="willemtsade">
|
||||
<link:magic file="bundle/org.osgi.util.function-1.2.0.jar" mime="application/vnd.osgi.bundle"/>
|
||||
<link:magic file="bundle/org.osgi.util.promise-1.2.0.jar" mime="application/vnd.osgi.bundle"/>
|
||||
<link:magic file="bundle/org.apache.felix.scr-2.2.0.jar" mime="application/vnd.osgi.bundle"/>
|
||||
</link:sea>
|
||||
</root:ocean>
|
|
@ -4,6 +4,8 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd">
|
||||
<link:sea name="System Engine" provider="gdxapp4d.system" author="willemtsade">
|
||||
<!-- Link dep-osgi-scr -->
|
||||
<link:chain key="8833aa29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41b58de"/>
|
||||
<!-- Link vrgem4 -->
|
||||
<link:chain key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc"/>
|
||||
</link:sea>
|
||||
|
|
|
@ -44,6 +44,11 @@
|
|||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.service.component.annotations</artifactId>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
|
|
@ -14,12 +14,14 @@ import java.util.function.Consumer;
|
|||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.BundleException;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.x4o.xml.io.X4OConnectionException;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
||||
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBase;
|
||||
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
|
||||
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpLogger;
|
||||
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpSea;
|
||||
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip;
|
||||
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpTerminal;
|
||||
|
@ -138,6 +140,7 @@ public class GDXAppTos4Activator implements BundleActivator {
|
|||
|
||||
SystemWarpShipImpl systemWarpShip = new SystemWarpShipImpl();
|
||||
|
||||
context.registerService(SystemWarpLogger.class.getName(), new SystemWarpLoggerImpl(), new Hashtable<String, String>());
|
||||
context.registerService(SystemWarpBase.class.getName(), new SystemWarpBaseImpl(), new Hashtable<String, String>());
|
||||
context.registerService(SystemWarpBootArgs.class.getName(), new SystemWarpBootArgsImpl(), new Hashtable<String, String>());
|
||||
context.registerService(SystemWarpShip.class.getName(), systemWarpShip, new Hashtable<String, String>());
|
||||
|
@ -286,4 +289,27 @@ public class GDXAppTos4Activator implements BundleActivator {
|
|||
return buf.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SystemWarpLoggerImpl implements SystemWarpLogger {
|
||||
|
||||
@Override
|
||||
public void infoTag(String tag, String message, Object...args) {
|
||||
LoggerFactory.getLogger(tag).info(message, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debugTag(String tag, String message, Object...args) {
|
||||
LoggerFactory.getLogger(tag).debug(message, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void errorTag(String tag, String message, Object...args) {
|
||||
LoggerFactory.getLogger(tag).error(message, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void errorTag(String tag, String message, Throwable exception) {
|
||||
LoggerFactory.getLogger(tag).error(message, exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ public class GDXAppTos4Startup {
|
|||
}
|
||||
};
|
||||
Thread framework = new Thread(run);
|
||||
framework.setName("boot");
|
||||
framework.start();
|
||||
|
||||
return systemBundle;
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package love.distributedrebirth.gdxapp4d.tos4.service;
|
||||
|
||||
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
public interface SystemWarpLogger {
|
||||
|
||||
void infoTag(String tag, String message, Object...args);
|
||||
|
||||
void debugTag(String tag, String message, Object...args);
|
||||
|
||||
void errorTag(String tag, String message, Object...args);
|
||||
|
||||
void errorTag(String tag, String message, Throwable exception);
|
||||
|
||||
default void info(Object tag, String message, Object...args) {
|
||||
infoTag(tag.getClass().getName(), message, args);
|
||||
}
|
||||
|
||||
default void debug(Object tag, String message, Object...args) {
|
||||
debugTag(tag.getClass().getName(), message, args);
|
||||
}
|
||||
|
||||
default void error(Object tag, String message, Object...args) {
|
||||
errorTag(tag.getClass().getName(), message, args);
|
||||
}
|
||||
|
||||
default void error(Object tag, String message, Throwable exception) {
|
||||
errorTag(tag.getClass().getName(), message, exception);
|
||||
}
|
||||
}
|
|
@ -12,6 +12,7 @@
|
|||
<groupId>love.distributedrebirth.gdxapp4d</groupId>
|
||||
<artifactId>gdxapp4d-tos4</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
@ -21,11 +22,20 @@
|
|||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<exportScr>true</exportScr>
|
||||
<instructions>
|
||||
<_donotcopy>(.git)</_donotcopy>
|
||||
<!-- Enable processing of OSGI DS component annotations -->
|
||||
<_dsannotations>*</_dsannotations>
|
||||
<!-- Enable processing of OSGI metatype annotations -->
|
||||
<_metatypeannotations>*</_metatypeannotations>
|
||||
<Import-Package>
|
||||
love.distributedrebirth.gdxapp4d.tos4.service,
|
||||
org.osgi.framework,
|
||||
org.osgi.service.packageadmin,
|
||||
org.osgi.service.url,
|
||||
org.osgi.service.startlevel,
|
||||
org.osgi.util.tracker,
|
||||
love.distributedrebirth.gdxapp4d.tos4.service,
|
||||
com.badlogic.gdx,
|
||||
com.badlogic.gdx.assets,
|
||||
com.badlogic.gdx.assets.loaders,
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
}
|
||||
}
|
1
pom.xml
1
pom.xml
|
@ -12,6 +12,7 @@
|
|||
<module>gdxapp4d-app-notepad</module>
|
||||
<module>gdxapp4d-app-tosamp</module>
|
||||
<module>gdxapp4d-boot-desktop</module>
|
||||
<module>gdxapp4d-chain-dep-osgi-scr</module>
|
||||
<module>gdxapp4d-chain-music-msx</module>
|
||||
<module>gdxapp4d-chain-music-templeos</module>
|
||||
<module>gdxapp4d-chain-sys-engine</module>
|
||||
|
|
Loading…
Reference in a new issue