Renamed warp core module
This commit is contained in:
parent
179c70a010
commit
8628c6cfb9
|
@ -14,28 +14,28 @@ import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayClose;
|
|||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayCount;
|
||||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayEvent;
|
||||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayReq;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactListener;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllActClientClose;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllActClientSendMessage;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllArtClient;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllArtClientOnMessage;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllRtsClient;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaCoil;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class NoStrRtsClient implements No2AllReactTypeScript {
|
||||
public class NoStrRtsClient implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(NoStrRtsClient.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(NoStrRtsClient.class);
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
No2AllReact react = signal.getReact();
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
react.registrate(No2AllRtsClient.API, No2AllArtClient.class, artClient -> {
|
||||
No2AllReactSlot clientSlot = artClient.getData().getSlot();
|
||||
WarpReactPlasma clientSlot = artClient.getData().getSlot();
|
||||
react.claimIn(clientSlot, NoStrMsgToRelayAuth.class);
|
||||
react.claimIn(clientSlot, NoStrMsgToRelayClose.class);
|
||||
react.claimIn(clientSlot, NoStrMsgToRelayCount.class);
|
||||
|
@ -63,7 +63,7 @@ public class NoStrRtsClient implements No2AllReactTypeScript {
|
|||
});
|
||||
}
|
||||
|
||||
private <T extends NoStrMsgToRelay> No2AllReactListener<T> pipeWriter(No2AllReact react, No2AllReactSlot clientSlot) {
|
||||
private <T extends NoStrMsgToRelay> WarpReactPlasmaCoil<T> pipeWriter(WarpReact react, WarpReactPlasma clientSlot) {
|
||||
return v -> {
|
||||
react.fire(clientSlot, new No2AllActClientSendMessage(v.getData().toBible().toString()));
|
||||
};
|
||||
|
|
|
@ -14,12 +14,6 @@ import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayClose;
|
|||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayCount;
|
||||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayEvent;
|
||||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayReq;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactListener;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllActServerBroadcastMessage;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllActServerSocketClose;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllActServerSocketSendMessage;
|
||||
|
@ -27,14 +21,20 @@ import love.distributedrebirth.no2all.react.wire.server.No2AllArtServer;
|
|||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServerSocket;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServerSocketOnMessage;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServer;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaCoil;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class NoStrRtsServer implements No2AllReactTypeScript {
|
||||
public class NoStrRtsServer implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(NoStrRtsServer.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(NoStrRtsServer.class);
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
No2AllReact react = signal.getReact();
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
react.requireSlot(API, No2AllRtsServer.API);
|
||||
react.claimIn(API, NoStrMsgToClientNotice.class);
|
||||
|
@ -42,10 +42,10 @@ public class NoStrRtsServer implements No2AllReactTypeScript {
|
|||
react.fireForEach(No2AllRtsServer.API, new No2AllActServerBroadcastMessage(v.getData().toBible().toString()));
|
||||
});
|
||||
react.registrate(No2AllRtsServer.API, No2AllArtServer.class, artServer -> {
|
||||
No2AllReactSlot serverSlot = artServer.getData().getSlot();
|
||||
WarpReactPlasma serverSlot = artServer.getData().getSlot();
|
||||
react.claimIn(serverSlot, NoStrMsgToClientNotice.class);
|
||||
react.registrate(serverSlot, No2AllArtServerSocket.class, artSocket -> {
|
||||
No2AllReactSlot socketSlot = artSocket.getData().getSlot();
|
||||
WarpReactPlasma socketSlot = artSocket.getData().getSlot();
|
||||
react.claimIn(socketSlot, NoStrMsgToClientAuth.class);
|
||||
react.claimIn(socketSlot, NoStrMsgToClientCount.class);
|
||||
react.claimIn(socketSlot, NoStrMsgToClientEose.class);
|
||||
|
@ -78,7 +78,7 @@ public class NoStrRtsServer implements No2AllReactTypeScript {
|
|||
});
|
||||
}
|
||||
|
||||
private <T extends NoStrMsgToClient> No2AllReactListener<T> pipeWriter(No2AllReact react, No2AllReactSlot clientSlot) {
|
||||
private <T extends NoStrMsgToClient> WarpReactPlasmaCoil<T> pipeWriter(WarpReact react, WarpReactPlasma clientSlot) {
|
||||
return v -> {
|
||||
react.fire(clientSlot, new No2AllActServerSocketSendMessage(v.getData().toBible().toString()));
|
||||
};
|
||||
|
|
|
@ -7,31 +7,31 @@ import love.distributedrebirth.no2all.nostr.model.event.NoStrEventSignature;
|
|||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToClientOk;
|
||||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayEvent;
|
||||
import love.distributedrebirth.no2all.nostr.nip.NoStrImplMessageOkReason;
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.react.nostr.server.NoStrRtsServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServerSocket;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServer;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class NoStrRtsServerRelay implements No2AllReactTypeScript {
|
||||
public class NoStrRtsServerRelay implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(NoStrRtsServerRelay.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(NoStrRtsServerRelay.class);
|
||||
private static final Logger logger = Logger.getLogger(NoStrRtsServerRelay.class.getName());
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
No2AllReact react = signal.getReact();
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
react.claimOut(API, NoStrArtServerRelayStoreEvent.class);
|
||||
react.requireSlot(API, NoStrRtsServer.API);
|
||||
react.registrate(No2AllRtsServer.API, No2AllArtServer.class, artServer -> {
|
||||
No2AllReactSlot serverSlot = artServer.getData().getSlot();
|
||||
WarpReactPlasma serverSlot = artServer.getData().getSlot();
|
||||
react.registrate(serverSlot, No2AllArtServerSocket.class, artSocket -> {
|
||||
No2AllReactSlot socketSlot = artSocket.getData().getSlot();
|
||||
WarpReactPlasma socketSlot = artSocket.getData().getSlot();
|
||||
react.registrate(socketSlot, NoStrMsgToRelayEvent.class, v -> {
|
||||
handleRelayEvent(react, v.getData().getEvent(), artSocket.getData().getRemoteAddr(), socketSlot);
|
||||
});
|
||||
|
@ -39,7 +39,7 @@ public class NoStrRtsServerRelay implements No2AllReactTypeScript {
|
|||
});
|
||||
}
|
||||
|
||||
private void handleRelayEvent(No2AllReact react, NoStrEvent event, String remoteAddr, No2AllReactSlot socketSlot) {
|
||||
private void handleRelayEvent(WarpReact react, NoStrEvent event, String remoteAddr, WarpReactPlasma socketSlot) {
|
||||
boolean eventSaved = false;
|
||||
String eventResponse = "";
|
||||
NoStrImplMessageOkReason eventReason = NoStrImplMessageOkReason.DEFAULT;
|
||||
|
|
|
@ -2,28 +2,28 @@ package love.distributedrebirth.no2all.react.nostr.server.relay;
|
|||
|
||||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayClose;
|
||||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayReq;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServerSocket;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServer;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class NoStrRtsServerRelaySubs implements No2AllReactTypeScript {
|
||||
public class NoStrRtsServerRelaySubs implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(NoStrRtsServerRelaySubs.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(NoStrRtsServerRelaySubs.class);
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
No2AllReact react = signal.getReact();
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
react.requireSlot(API, NoStrRtsServerRelay.API);
|
||||
react.registrate(No2AllRtsServer.API, No2AllArtServer.class, v -> {
|
||||
No2AllReactSlot serverSlot = v.getData().getSlot();
|
||||
WarpReactPlasma serverSlot = v.getData().getSlot();
|
||||
react.registrate(serverSlot, No2AllArtServerSocket.class, x -> {
|
||||
No2AllReactSlot socketSlot = x.getData().getSlot();
|
||||
WarpReactPlasma socketSlot = x.getData().getSlot();
|
||||
react.registrate(socketSlot, NoStrMsgToRelayReq.class, y -> {
|
||||
String subId = y.getData().getSubscriptionId();
|
||||
y.getData().getFilters();
|
||||
|
|
|
@ -12,9 +12,6 @@ import love.distributedrebirth.no2all.nostr.model.NoStrIdentityPrivateKey;
|
|||
import love.distributedrebirth.no2all.nostr.model.event.NoStrEvent;
|
||||
import love.distributedrebirth.no2all.nostr.model.message.NoStrMsgToRelayEvent;
|
||||
import love.distributedrebirth.no2all.nostr.nip.NoStrImplEventKind;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllReactWarpCore;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllRtsWarpSpeedMonitor;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllActClient;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllActClientClose;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllActClientConnect;
|
||||
|
@ -26,19 +23,22 @@ import love.distributedrebirth.no2all.react.wire.client.No2AllArtClientOnOpen;
|
|||
import love.distributedrebirth.no2all.react.wire.client.No2AllArtClientOnStart;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllRtsClient;
|
||||
import love.distributedrebirth.no2all.wire.ojw.OjwWireClientEndpoint;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreReactor;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreSpeedMonitor;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
|
||||
public class NoStrClientTest {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ExecutorService executor = Executors.newFixedThreadPool(10);
|
||||
NoStrIdentity nid = new NoStrIdentity(NoStrIdentityPrivateKey.ofRandom());
|
||||
No2AllReactWarpCore react = new No2AllReactWarpCore();
|
||||
react.load(new No2AllRtsWarpSpeedMonitor());
|
||||
WarpCoreReactor react = new WarpCoreReactor();
|
||||
react.load(new WarpCoreSpeedMonitor());
|
||||
react.load(new No2AllRtsClient());
|
||||
react.load(new NoStrRtsClient());
|
||||
|
||||
react.registrate(No2AllRtsClient.API, No2AllArtClient.class, v -> {
|
||||
No2AllReactSlot clientSlot = v.getData().getSlot();
|
||||
WarpReactPlasma clientSlot = v.getData().getSlot();
|
||||
System.out.println("NoStrClient created: " + clientSlot.getSlotPath());
|
||||
react.registrate(clientSlot, No2AllArtClientOnError.class, x -> {
|
||||
System.out.println("NoStrClient socket error: " + x.getData().getError().getMessage());
|
||||
|
|
|
@ -2,11 +2,8 @@ package love.distributedrebirth.no2all.react.nostr.server;
|
|||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.nostr.server.relay.NoStrRtsServerRelay;
|
||||
import love.distributedrebirth.no2all.react.nostr.server.relay.NoStrRtsServerRelaySubs;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllReactWarpCore;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllRtsWarpSpeedMonitor;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllActServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServerOnStart;
|
||||
|
@ -16,12 +13,15 @@ import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServerLog;
|
|||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServer;
|
||||
import love.distributedrebirth.no2all.wire.ojw.OjwWireServer;
|
||||
import love.distributedrebirth.no2all.wire.ojw.OjwWireServerEndpoint;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreReactor;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreSpeedMonitor;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
|
||||
public class NoStrServerTest {
|
||||
static OjwWireServer server = null;
|
||||
public static void main(String[] args) throws Exception {
|
||||
No2AllReactWarpCore react = new No2AllReactWarpCore();
|
||||
react.load(new No2AllRtsWarpSpeedMonitor());
|
||||
WarpCoreReactor react = new WarpCoreReactor();
|
||||
react.load(new WarpCoreSpeedMonitor());
|
||||
react.load(new No2AllRtsServer());
|
||||
react.load(new No2AllRtsServerLog());
|
||||
react.load(new NoStrRtsServer());
|
||||
|
@ -29,7 +29,7 @@ public class NoStrServerTest {
|
|||
react.load(new NoStrRtsServerRelaySubs());
|
||||
|
||||
react.registrate(No2AllRtsServer.API, No2AllArtServer.class, artServer -> {
|
||||
No2AllReactSlot serverSlot = artServer.getData().getSlot();
|
||||
WarpReactPlasma serverSlot = artServer.getData().getSlot();
|
||||
react.registrate(serverSlot, No2AllArtServerOnStart.class, v -> {
|
||||
System.out.println("RelayServer started: " + v.getTarget().getSlotSlug());
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nx01-no2all-react</artifactId>
|
||||
<artifactId>nx01-warp-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package love.distributedrebirth.no2all.react.wire.client;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllActAbstractSlot;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.space.AbstractSpacePlasma;
|
||||
|
||||
public final class No2AllArtClient extends No2AllActAbstractSlot {
|
||||
public final class No2AllArtClient extends AbstractSpacePlasma {
|
||||
|
||||
protected No2AllArtClient(No2AllReactSlot slot) {
|
||||
protected No2AllArtClient(WarpReactPlasma slot) {
|
||||
super(slot);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package love.distributedrebirth.no2all.react.wire.client;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllActAbstractSlot;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.space.AbstractSpacePlasma;
|
||||
|
||||
public final class No2AllArtClientOnStart extends No2AllActAbstractSlot {
|
||||
public final class No2AllArtClientOnStart extends AbstractSpacePlasma {
|
||||
|
||||
protected No2AllArtClientOnStart(No2AllReactSlot slot) {
|
||||
protected No2AllArtClientOnStart(WarpReactPlasma slot) {
|
||||
super(slot);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,28 +2,28 @@ package love.distributedrebirth.no2all.react.wire.client;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.wire.WireClient;
|
||||
import love.distributedrebirth.no2all.wire.WireClientEndpoint;
|
||||
import love.distributedrebirth.no2all.wire.WireClientHandler;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class No2AllRtsClient implements No2AllReactTypeScript {
|
||||
public class No2AllRtsClient implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(No2AllRtsClient.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(No2AllRtsClient.class);
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
No2AllReact react = signal.getReact();
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
react.claimIn(API, No2AllActClient.class);
|
||||
react.claimOut(API, No2AllArtClient.class);
|
||||
react.registrate(API, No2AllActClient.class, actClient -> {
|
||||
WireClientEndpoint clientEndpoint = actClient.getData().getEndpoint();
|
||||
No2AllReactSlot clientSlot = No2AllReactSlot.of(API, "wireId=" + clientEndpoint.wireId());
|
||||
WarpReactPlasma clientSlot = WarpReactPlasma.of(API, "wireId=" + clientEndpoint.wireId());
|
||||
WireClient client = clientEndpoint.wireClient(wireHandler(react, clientSlot));
|
||||
react.claim(clientSlot);
|
||||
react.claimIn(clientSlot, No2AllActClientConnect.class);
|
||||
|
@ -54,7 +54,7 @@ public class No2AllRtsClient implements No2AllReactTypeScript {
|
|||
});
|
||||
}
|
||||
|
||||
private WireClientHandler wireHandler(No2AllReact react, No2AllReactSlot clientSlot) {
|
||||
private WireClientHandler wireHandler(WarpReact react, WarpReactPlasma clientSlot) {
|
||||
return new WireClientHandler() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package love.distributedrebirth.no2all.react.wire.server;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllActAbstractSlot;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.space.AbstractSpacePlasma;
|
||||
|
||||
public final class No2AllArtServer extends No2AllActAbstractSlot {
|
||||
public final class No2AllArtServer extends AbstractSpacePlasma {
|
||||
|
||||
protected No2AllArtServer(No2AllReactSlot slot) {
|
||||
protected No2AllArtServer(WarpReactPlasma slot) {
|
||||
super(slot);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package love.distributedrebirth.no2all.react.wire.server;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllActAbstractSlot;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.space.AbstractSpacePlasma;
|
||||
|
||||
public final class No2AllArtServerSocket extends No2AllActAbstractSlot {
|
||||
public final class No2AllArtServerSocket extends AbstractSpacePlasma {
|
||||
|
||||
private final String remoteAddr;
|
||||
|
||||
protected No2AllArtServerSocket(No2AllReactSlot slot, String remoteAddr) {
|
||||
protected No2AllArtServerSocket(WarpReactPlasma slot, String remoteAddr) {
|
||||
super(slot);
|
||||
this.remoteAddr = remoteAddr;
|
||||
}
|
||||
|
|
|
@ -2,29 +2,29 @@ package love.distributedrebirth.no2all.react.wire.server;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.wire.WireServer;
|
||||
import love.distributedrebirth.no2all.wire.WireServerEndpoint;
|
||||
import love.distributedrebirth.no2all.wire.WireServerHandler;
|
||||
import love.distributedrebirth.no2all.wire.WireServerSocket;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class No2AllRtsServer implements No2AllReactTypeScript {
|
||||
public class No2AllRtsServer implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(No2AllRtsServer.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(No2AllRtsServer.class);
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
No2AllReact react = signal.getReact();
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
react.claimIn(API, No2AllActServer.class);
|
||||
react.claimOut(API, No2AllArtServer.class);
|
||||
react.registrate(API, No2AllActServer.class, actServer -> {
|
||||
WireServerEndpoint serverEndpoint = actServer.getData().getEndpoint();
|
||||
No2AllReactSlot serverSlot = No2AllReactSlot.of(API, "wireId=" + serverEndpoint.wireId());
|
||||
WarpReactPlasma serverSlot = WarpReactPlasma.of(API, "wireId=" + serverEndpoint.wireId());
|
||||
WireServer server = serverEndpoint.wireServer(wireHandler(react, serverSlot));
|
||||
react.claim(serverSlot);
|
||||
react.claimIn(serverSlot, No2AllActServerBroadcastMessage.class);
|
||||
|
@ -44,10 +44,10 @@ public class No2AllRtsServer implements No2AllReactTypeScript {
|
|||
});
|
||||
}
|
||||
|
||||
private WireServerHandler wireHandler(No2AllReact react, No2AllReactSlot serverSlot) {
|
||||
private WireServerHandler wireHandler(WarpReact react, WarpReactPlasma serverSlot) {
|
||||
return new WireServerHandler() {
|
||||
private No2AllReactSlot socketSlug(WireServerSocket conn) {
|
||||
return No2AllReactSlot.of(serverSlot, "hashCode=" + conn.hashCode());
|
||||
private WarpReactPlasma socketSlug(WireServerSocket conn) {
|
||||
return WarpReactPlasma.of(serverSlot, "hashCode=" + conn.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +57,7 @@ public class No2AllRtsServer implements No2AllReactTypeScript {
|
|||
|
||||
@Override
|
||||
public void onOpen(WireServerSocket conn) {
|
||||
No2AllReactSlot socketSlot = socketSlug(conn);
|
||||
WarpReactPlasma socketSlot = socketSlug(conn);
|
||||
react.claim(socketSlot);
|
||||
react.claimIn(socketSlot, No2AllActServerSocketSendMessage.class);
|
||||
react.claimIn(socketSlot, No2AllActServerSocketSendBinary.class);
|
||||
|
@ -80,7 +80,7 @@ public class No2AllRtsServer implements No2AllReactTypeScript {
|
|||
|
||||
@Override
|
||||
public void onClose(WireServerSocket conn, int code, String reason, boolean remote) {
|
||||
No2AllReactSlot socketSlot = socketSlug(conn);
|
||||
WarpReactPlasma socketSlot = socketSlug(conn);
|
||||
react.fire(socketSlot, new No2AllArtServerSocketOnClose(code, reason, remote));
|
||||
react.release(socketSlot);
|
||||
}
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
package love.distributedrebirth.no2all.react.wire.server;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class No2AllRtsServerLog implements No2AllReactTypeScript {
|
||||
public class No2AllRtsServerLog implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(No2AllRtsServerLog.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(No2AllRtsServerLog.class);
|
||||
private static final Logger logger = Logger.getLogger(No2AllRtsServerLog.class.getName());
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
No2AllReact react = signal.getReact();
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
react.registrate(No2AllRtsServer.API, No2AllArtServer.class, artServer -> {
|
||||
No2AllReactSlot serverSlot = artServer.getData().getSlot();
|
||||
WarpReactPlasma serverSlot = artServer.getData().getSlot();
|
||||
react.registrate(serverSlot, No2AllActServerBroadcastMessage.class, v -> {
|
||||
logger.info("broadcastMessage: " + v.getData().getMessage());
|
||||
});
|
||||
react.registrate(serverSlot, No2AllArtServerSocket.class, v -> {
|
||||
No2AllReactSlot socketSlot = v.getData().getSlot();
|
||||
WarpReactPlasma socketSlot = v.getData().getSlot();
|
||||
String wireId = socketSlot.getSlotSlug();
|
||||
react.registrate(socketSlot, No2AllArtServerSocketOnMessage.class, z -> {
|
||||
logger.info(wireId+".socketOnMessage: " + z.getData().getMessage());
|
||||
|
|
|
@ -11,15 +11,15 @@ import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerI
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllReactWarpCore;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllRtsWarpSpeedMonitor;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllActServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllActServerSocketSendMessage;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServerSocket;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllArtServerSocketOnMessage;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServerLog;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreReactor;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreSpeedMonitor;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServer;
|
||||
|
||||
public class EventServer {
|
||||
|
@ -55,16 +55,16 @@ public class EventServer {
|
|||
@Override
|
||||
public void lifeCycleStarted(LifeCycle event) {
|
||||
LOG.info("Startup No2AllReactWarpCore");
|
||||
No2AllReactWarpCore react = new No2AllReactWarpCore();
|
||||
react.load(new No2AllRtsWarpSpeedMonitor());
|
||||
WarpCoreReactor react = new WarpCoreReactor();
|
||||
react.load(new WarpCoreSpeedMonitor());
|
||||
react.load(new No2AllRtsServer());
|
||||
react.load(new No2AllRtsServerLog());
|
||||
|
||||
// auto reply
|
||||
react.registrate(No2AllRtsServer.API, No2AllArtServer.class, artServer -> {
|
||||
No2AllReactSlot serverSlot = artServer.getData().getSlot();
|
||||
WarpReactPlasma serverSlot = artServer.getData().getSlot();
|
||||
react.registrate(serverSlot, No2AllArtServerSocket.class, artSocket -> {
|
||||
No2AllReactSlot socketSlot = artSocket.getData().getSlot();
|
||||
WarpReactPlasma socketSlot = artSocket.getData().getSlot();
|
||||
react.registrate(socketSlot, No2AllArtServerSocketOnMessage.class, artMsg -> {
|
||||
react.fire(socketSlot, new No2AllActServerSocketSendMessage("RE: "+artMsg.getData().getMessage()));
|
||||
});
|
||||
|
|
|
@ -11,22 +11,22 @@ import javax.sql.DataSource;
|
|||
import jakarta.json.Json;
|
||||
import jakarta.json.JsonWriter;
|
||||
import love.distributedrebirth.no2all.nostr.model.event.NoStrEvent;
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.react.nostr.server.relay.NoStrArtServerRelayStoreEvent;
|
||||
import love.distributedrebirth.no2all.react.nostr.server.relay.NoStrRtsServerRelay;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class ZFunRtsServer implements No2AllReactTypeScript {
|
||||
public class ZFunRtsServer implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(ZFunRtsServer.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(ZFunRtsServer.class);
|
||||
private static final Logger logger = Logger.getLogger(ZFunRtsServer.class.getName());
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
No2AllReact react = signal.getReact();
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
|
||||
DataSource ds = react.service(DataSource.class);
|
||||
|
|
|
@ -2,18 +2,18 @@ package love.distributedrebirth.no2all.zerofungus;
|
|||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class ZFunRtsServerBooted implements No2AllReactTypeScript {
|
||||
public class ZFunRtsServerBooted implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(ZFunRtsServerBooted.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(ZFunRtsServerBooted.class);
|
||||
private static final Logger logger = Logger.getLogger(ZFunRtsServerBooted.class.getName());
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
signal.getReact().claim(API);
|
||||
logger.info("╔═╗┌─┐┬─┐┌─┐ .╔═╗┬ ┬┌┐┌╔═╗┬ ┬┌─┐");
|
||||
logger.info("╔═╝├┤ ├┬┘│ │ . ╠╣ │ ││││║ ╦│ │└─┐");
|
||||
|
|
|
@ -10,8 +10,6 @@ import love.distributedrebirth.no2all.react.nostr.client.NoStrRtsClient;
|
|||
import love.distributedrebirth.no2all.react.nostr.server.NoStrRtsServer;
|
||||
import love.distributedrebirth.no2all.react.nostr.server.relay.NoStrRtsServerRelay;
|
||||
import love.distributedrebirth.no2all.react.nostr.server.relay.NoStrRtsServerRelaySubs;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllReactWarpCore;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllRtsWarpSpeedMonitor;
|
||||
import love.distributedrebirth.no2all.react.wire.client.No2AllRtsClient;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServerLog;
|
||||
|
@ -19,11 +17,13 @@ import love.distributedrebirth.no2all.zerofungus.service.ZFunRtsConfigJetty;
|
|||
import love.distributedrebirth.no2all.zerofungus.service.ZFunRtsConfigLogger;
|
||||
//import ᒢᐩᐩ.ᔿᐤᒄʸ.ᣔᒃᣔᒼᓑᔆ.BãßBȍőnAbacusInstanceMBeanʸᴰ;
|
||||
import love.distributedrebirth.no2all.zerofungus.service.ZFunRtsInitJdbc;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreReactor;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreSpeedMonitor;
|
||||
|
||||
public enum ZeroFungus /* implements BãßBȍőnAbacusInstanceMBeanʸᴰ<ZeroFungus> */ {
|
||||
INSTANCE;
|
||||
|
||||
private No2AllReactWarpCore foei = new No2AllReactWarpCore();
|
||||
private WarpCoreReactor foei = new WarpCoreReactor();
|
||||
private List<ZFunRtsConfigJetty> jetties = new ArrayList<>();
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -52,7 +52,7 @@ public enum ZeroFungus /* implements BãßBȍőnAbacusInstanceMBeanʸᴰ<ZeroFun
|
|||
public void start() {
|
||||
// setup logger + warp monitor
|
||||
foei.load(new ZFunRtsConfigLogger());
|
||||
foei.load(new No2AllRtsWarpSpeedMonitor());
|
||||
foei.load(new WarpCoreSpeedMonitor());
|
||||
|
||||
// add websocket wire support + log
|
||||
foei.load(new No2AllRtsClient());
|
||||
|
|
|
@ -20,19 +20,19 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
import org.eclipse.jetty.webapp.WebInfConfiguration;
|
||||
import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReact;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllActServer;
|
||||
import love.distributedrebirth.no2all.react.wire.server.No2AllRtsServer;
|
||||
import love.distributedrebirth.no2all.wire.jetty.JettyWireServerEndpoint;
|
||||
import love.distributedrebirth.no2all.zerofungus.web.RedirectServlet;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public final class ZFunRtsConfigJetty implements No2AllReactTypeScript {
|
||||
public final class ZFunRtsConfigJetty implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(ZFunRtsConfigJetty.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(ZFunRtsConfigJetty.class);
|
||||
private static final Logger logger = Logger.getLogger(ZFunRtsConfigJetty.class.getName());
|
||||
private final Server server;
|
||||
private final ServerConnector connector;
|
||||
|
@ -48,7 +48,7 @@ public final class ZFunRtsConfigJetty implements No2AllReactTypeScript {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
logger.info(" ╦┌─┐╔╦╗╔╦╗┬ ┬ ╔═╗┌─┐╦ ╦╔═╗┬─┐┌┬┐");
|
||||
logger.info(" ║├┤ ║ ║ └┬┘ ╠═╝│ │║║║║╣ ├┬┘ ││");
|
||||
logger.info("╚╝└─┘ ╩ ╩ ┴ ╩ └─┘╚╩╝╚═╝┴└──┴┘");
|
||||
|
@ -84,7 +84,7 @@ public final class ZFunRtsConfigJetty implements No2AllReactTypeScript {
|
|||
CustomRequestLog log = new CustomRequestLog("logs/http.log", CustomRequestLog.EXTENDED_NCSA_FORMAT);
|
||||
server.setRequestLog(log);
|
||||
|
||||
No2AllReact react = signal.getReact();
|
||||
WarpReact react = signal.getReact();
|
||||
server.addEventListener(new Listener() {
|
||||
@Override
|
||||
public void lifeCycleStarted(LifeCycle event) {
|
||||
|
|
|
@ -6,18 +6,18 @@ import org.slf4j.LoggerFactory;
|
|||
import org.slf4j.bridge.SLF4JBridgeHandler;
|
||||
|
||||
import ch.qos.logback.core.status.NopStatusListener;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class ZFunRtsConfigLogger implements No2AllReactTypeScript {
|
||||
public class ZFunRtsConfigLogger implements WarpReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(ZFunRtsConfigLogger.class);
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(ZFunRtsConfigLogger.class);
|
||||
private static final Logger logger = Logger.getLogger(ZFunRtsConfigLogger.class.getName());
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
if (System.getProperty("logback.configurationFile") == null) {
|
||||
String logConfig = null;
|
||||
if (System.getProperty("java.class.path").contains("classes")) {
|
||||
|
|
|
@ -11,24 +11,25 @@ import javax.sql.DataSource;
|
|||
import org.flywaydb.core.Flyway;
|
||||
import org.h2.jdbcx.JdbcConnectionPool;
|
||||
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlot;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotLoad;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactSlotSignal;
|
||||
import love.distributedrebirth.no2all.react.No2AllReactTypeScript;
|
||||
import love.distributedrebirth.no2all.react.warp.No2AllReactWarpCore;
|
||||
import love.distributedrebirth.nx01.warp.core.WarpCoreReactor;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public class ZFunRtsInitJdbc implements No2AllReactTypeScript {
|
||||
|
||||
public static final No2AllReactSlot API = No2AllReactSlot.ofClass(ZFunRtsInitJdbc.class);
|
||||
public class ZFunRtsInitJdbc implements WarpReactTypeScript {
|
||||
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(ZFunRtsInitJdbc.class);
|
||||
private static final Logger logger = Logger.getLogger(ZFunRtsInitJdbc.class.getName());
|
||||
private final No2AllReactWarpCore foei;
|
||||
private final WarpCoreReactor foei;
|
||||
|
||||
public ZFunRtsInitJdbc(No2AllReactWarpCore foei) {
|
||||
public ZFunRtsInitJdbc(WarpCoreReactor foei) {
|
||||
this.foei = foei;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(No2AllReactSlotSignal<No2AllReactSlotLoad> signal) {
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
signal.getReact().claim(API);
|
||||
|
||||
JdbcConnectionPool cp = JdbcConnectionPool.create("jdbc:h2:file:./target/h2db/zfun", "sa", "sa");
|
||||
|
|
21
nx01-warp-core/pom.xml
Normal file
21
nx01-warp-core/pom.xml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<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.nx01</groupId>
|
||||
<artifactId>nx01</artifactId>
|
||||
<version>〇一。壬寅。一〄-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>nx01-warp-core</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>love.distributedrebirth.nx01</groupId>
|
||||
<artifactId>nx01-warp-fault</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,120 @@
|
|||
package love.distributedrebirth.nx01.warp.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaCoil;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
|
||||
public class WarpCorePlasmaConduit {
|
||||
|
||||
private final WarpCoreReactor no2AllReactWarpCore;
|
||||
private final WarpReactPlasma containerSlot;
|
||||
private final Map<Class<?>, List<WarpReactPlasmaCoil<Object>>> listeners = new HashMap<>();
|
||||
private final Set<Class<?>> claimTypesOut = new HashSet<>();
|
||||
private final Set<Class<?>> claimTypesIn = new HashSet<>();
|
||||
private final Set<Class<?>> requireServices = new HashSet<>();
|
||||
private final Set<WarpReactPlasma> requireSlots = new HashSet<>();
|
||||
|
||||
protected WarpCorePlasmaConduit(WarpCoreReactor no2AllReactWarpCore, WarpReactPlasma containerSlot) {
|
||||
this.no2AllReactWarpCore = Objects.requireNonNull(no2AllReactWarpCore);
|
||||
this.containerSlot = Objects.requireNonNull(containerSlot);
|
||||
}
|
||||
|
||||
private List<WarpReactPlasmaCoil<Object>> toViewOfListeners(Class<?> eventType) {
|
||||
List<WarpReactPlasmaCoil<Object>> result = new ArrayList<>();
|
||||
synchronized (listeners) {
|
||||
List<WarpReactPlasmaCoil<Object>> typeListeners = listeners.get(eventType);
|
||||
if (typeListeners == null) {
|
||||
return result;
|
||||
}
|
||||
result.addAll(typeListeners);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void fire(Object event, WarpReactPlasma slot) {
|
||||
for (WarpReactPlasmaCoil<Object> listener : toViewOfListeners(event.getClass())) {
|
||||
listener.onEvent(new WarpReactPlasmaPulse<>(slot, event, this.no2AllReactWarpCore));
|
||||
}
|
||||
}
|
||||
|
||||
public void registrateListener(Class<?> eventType, WarpReactPlasmaCoil<Object> listener) {
|
||||
Objects.requireNonNull(eventType);
|
||||
Objects.requireNonNull(listener);
|
||||
synchronized (listeners) {
|
||||
List<WarpReactPlasmaCoil<Object>> typeListeners = listeners.get(eventType);
|
||||
if (typeListeners == null) {
|
||||
typeListeners = new ArrayList<>();
|
||||
listeners.put(eventType, typeListeners);
|
||||
}
|
||||
typeListeners.add(listener);
|
||||
}
|
||||
}
|
||||
|
||||
public void registrateTypeOut(Class<?> eventType) {
|
||||
Objects.requireNonNull(eventType);
|
||||
synchronized (claimTypesOut) {
|
||||
claimTypesOut.add(eventType);
|
||||
}
|
||||
}
|
||||
|
||||
public void registrateTypeIn(Class<?> eventType) {
|
||||
Objects.requireNonNull(eventType);
|
||||
synchronized (claimTypesIn) {
|
||||
claimTypesIn.add(eventType);
|
||||
}
|
||||
}
|
||||
|
||||
public WarpCorePlasmaIntermixChamber readContract() {
|
||||
WarpCorePlasmaIntermixChamber result = new WarpCorePlasmaIntermixChamber(containerSlot);
|
||||
synchronized (claimTypesIn) {
|
||||
result.slotTypesIn.addAll(claimTypesIn);
|
||||
}
|
||||
synchronized (claimTypesOut) {
|
||||
result.slotTypesOut.addAll(claimTypesOut);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void addRequireService(Class<?> serviceType) {
|
||||
Objects.requireNonNull(serviceType);
|
||||
synchronized (requireServices) {
|
||||
requireServices.add(serviceType);
|
||||
}
|
||||
}
|
||||
|
||||
public void addRequireSlot(WarpReactPlasma dep) {
|
||||
Objects.requireNonNull(dep);
|
||||
synchronized (requireSlots) {
|
||||
requireSlots.add(dep);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeAll() {
|
||||
synchronized (listeners) {
|
||||
for (Class<?> eventType : listeners.keySet()) {
|
||||
List<WarpReactPlasmaCoil<Object>> typeListeners = listeners.get(eventType);
|
||||
typeListeners.clear();
|
||||
}
|
||||
}
|
||||
synchronized (claimTypesOut) {
|
||||
claimTypesOut.clear();
|
||||
}
|
||||
synchronized (claimTypesIn) {
|
||||
claimTypesIn.clear();
|
||||
}
|
||||
synchronized (requireServices) {
|
||||
requireServices.clear();
|
||||
}
|
||||
synchronized (requireSlots) {
|
||||
requireSlots.clear();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package love.distributedrebirth.nx01.warp.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
|
||||
|
||||
public class WarpCorePlasmaIntermixChamber {
|
||||
|
||||
private final WarpReactPlasma slot;
|
||||
final List<Class<?>> slotTypesIn = new ArrayList<>();
|
||||
final List<Class<?>> slotTypesOut = new ArrayList<>();
|
||||
|
||||
public WarpCorePlasmaIntermixChamber(WarpReactPlasma slot) {
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
public WarpReactPlasma getSlot() {
|
||||
return slot;
|
||||
}
|
||||
|
||||
public List<Class<?>> getSlotTypesIn() {
|
||||
return slotTypesIn;
|
||||
}
|
||||
|
||||
public List<Class<?>> getSlotTypesOut() {
|
||||
return slotTypesOut;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,188 @@
|
|||
package love.distributedrebirth.nx01.warp.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaCoil;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpacePlasmaAdd;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpacePlasmaRemove;
|
||||
|
||||
public class WarpCoreReactor implements WarpReact {
|
||||
|
||||
public static final WarpReactPlasma DILITHIUM = WarpReactPlasma.ofClass(WarpCoreReactor.class);
|
||||
private final Map<WarpReactPlasma, WarpCorePlasmaConduit> slots = new HashMap<>();
|
||||
private final Map<Class<?>, Object> services = new HashMap<>();
|
||||
private final List<BacklogEvent> backlog = new ArrayList<>();
|
||||
private Object currentEvent = null;
|
||||
|
||||
public WarpCoreReactor() {
|
||||
claim(DILITHIUM);
|
||||
toWarpFuel(DILITHIUM).registrateTypeIn(WarpSpaceAntimatterInducer.class);
|
||||
toWarpFuel(DILITHIUM).registrateTypeOut(WarpSpacePlasmaAdd.class);
|
||||
toWarpFuel(DILITHIUM).registrateTypeOut(WarpSpacePlasmaRemove.class);
|
||||
}
|
||||
|
||||
public void load(WarpReactTypeScript script) {
|
||||
Objects.requireNonNull(script).onEvent(new WarpReactPlasmaPulse<>(DILITHIUM, new WarpSpaceAntimatterInducer(), this));
|
||||
}
|
||||
|
||||
public WarpCorePlasmaIntermixChamber getSlotContract(WarpReactPlasma slot) {
|
||||
return toWarpFuel(slot).readContract();
|
||||
}
|
||||
|
||||
public List<WarpReactPlasma> listChilds(WarpReactPlasma slot) {
|
||||
Objects.requireNonNull(slot);
|
||||
List<WarpReactPlasma> result = new ArrayList<>();
|
||||
synchronized (slots) {
|
||||
for (WarpReactPlasma slug : slots.keySet()) {
|
||||
if (slot == null) {
|
||||
result.add(slug);
|
||||
continue;
|
||||
}
|
||||
if (slug.getParent() == null) {
|
||||
continue;
|
||||
}
|
||||
if (slug.getParent().getSlotPath().equals(slot.getSlotPath())) {
|
||||
result.add(slug);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireForEach(WarpReactPlasma slot, Object event) {
|
||||
for (WarpReactPlasma target : listChilds(slot)) {
|
||||
fire(target, event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fire(WarpReactPlasma slot, Object event) {
|
||||
Objects.requireNonNull(slot);
|
||||
Objects.requireNonNull(event);
|
||||
if (currentEvent != null) {
|
||||
backlog.add(new BacklogEvent(slot, event));
|
||||
return;
|
||||
}
|
||||
currentEvent = event;
|
||||
try {
|
||||
toWarpFuel(slot).fire(event, slot);
|
||||
|
||||
while (!backlog.isEmpty()) {
|
||||
List<BacklogEvent> backlog2 = new ArrayList<>(backlog);
|
||||
backlog.clear();
|
||||
for (BacklogEvent next : backlog2) {
|
||||
toWarpFuel(next.slot).fire(next.event, next.slot);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
currentEvent = null;
|
||||
}
|
||||
}
|
||||
|
||||
static class BacklogEvent {
|
||||
WarpReactPlasma slot;
|
||||
Object event;
|
||||
public BacklogEvent(WarpReactPlasma slot, Object event) {
|
||||
this.slot = slot;
|
||||
this.event = event;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> void registrate(WarpReactPlasma slot, Class<T> eventType, WarpReactPlasmaCoil<T> listener) {
|
||||
WarpReactPlasmaCoil<Object> listenerObj = (WarpReactPlasmaCoil<Object>) listener;
|
||||
toWarpFuel(slot).registrateListener(eventType, listenerObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release(WarpReactPlasma slot) {
|
||||
toWarpFuel(slot).removeAll();
|
||||
synchronized (slots) {
|
||||
slots.remove(slot);
|
||||
}
|
||||
fire(DILITHIUM, new WarpSpacePlasmaRemove(slot));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void claim(WarpReactPlasma slot) {
|
||||
Objects.requireNonNull(slot);
|
||||
synchronized (slots) {
|
||||
if (slots.keySet().contains(slot)) {
|
||||
throw new IllegalStateException("Slug already claimed: " + slot.getSlotPath());
|
||||
}
|
||||
slots.put(slot, new WarpCorePlasmaConduit(this, slot));
|
||||
}
|
||||
fire(DILITHIUM, new WarpSpacePlasmaAdd(slot));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void claimOut(WarpReactPlasma slot, Class<?> eventType) {
|
||||
toWarpFuel(slot).registrateTypeOut(eventType);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void claimIn(WarpReactPlasma slot, Class<?> eventType) {
|
||||
toWarpFuel(slot).registrateTypeIn(eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requireSlot(WarpReactPlasma slot, WarpReactPlasma dep) {
|
||||
if (!isClaimed(dep)) {
|
||||
throw new IllegalStateException("Script dependency missing: " + dep);
|
||||
}
|
||||
toWarpFuel(slot).addRequireSlot(dep);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requireService(WarpReactPlasma slot, Class<?> serviceType) {
|
||||
toWarpFuel(slot).addRequireService(serviceType);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> T service(Class<T> serviceType) {
|
||||
Objects.requireNonNull(serviceType);
|
||||
synchronized (services) {
|
||||
return (T) services.get(serviceType);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void addService(Class<T> serviceType, T service) {
|
||||
Objects.requireNonNull(serviceType);
|
||||
Objects.requireNonNull(service);
|
||||
synchronized (services) {
|
||||
services.put(serviceType, service);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isClaimed(WarpReactPlasma slug) {
|
||||
Objects.requireNonNull(slug);
|
||||
synchronized (slots) {
|
||||
return slots.keySet().contains(slug);
|
||||
}
|
||||
}
|
||||
|
||||
protected WarpCorePlasmaConduit toWarpFuel(WarpReactPlasma slot) {
|
||||
Objects.requireNonNull(slot);
|
||||
WarpCorePlasmaConduit result;
|
||||
synchronized (slots) {
|
||||
result = slots.get(slot);
|
||||
if (result == null) {
|
||||
throw new IllegalStateException("Slot not claimed: " + slot.getSlotPath());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package love.distributedrebirth.nx01.warp.core;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReact;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasmaPulse;
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactTypeScript;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpacePlasmaAdd;
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpacePlasmaRemove;
|
||||
|
||||
public class WarpCoreSpeedMonitor implements WarpReactTypeScript {
|
||||
|
||||
public static final WarpReactPlasma API = WarpReactPlasma.ofClass(WarpCoreSpeedMonitor.class);
|
||||
private static final WarpReactPlasma API_DILITHIUM = WarpCoreReactor.DILITHIUM;
|
||||
private static final Logger LOG = Logger.getLogger(WarpCoreSpeedMonitor.class.getName());
|
||||
|
||||
@Override
|
||||
public void onEvent(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
WarpReact react = signal.getReact();
|
||||
react.claim(API);
|
||||
react.requireSlot(API, API_DILITHIUM);
|
||||
react.registrate(API_DILITHIUM, WarpSpacePlasmaAdd.class, v -> {
|
||||
LOG.fine("slot-add: " + v.getData().getSlot().getSlotPath());
|
||||
});
|
||||
react.registrate(API_DILITHIUM, WarpSpacePlasmaRemove.class, v -> {
|
||||
LOG.fine("slot-remove: " + v.getData().getSlot().getSlotPath());
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package love.distributedrebirth.nx01.warp.core.react;
|
||||
|
||||
public interface WarpReact {
|
||||
|
||||
void claim(WarpReactPlasma slot);
|
||||
void claimIn(WarpReactPlasma slot, Class<?> eventType);
|
||||
void claimOut(WarpReactPlasma slot, Class<?> eventType);
|
||||
void requireSlot(WarpReactPlasma slot, WarpReactPlasma dep);
|
||||
void requireService(WarpReactPlasma slot, Class<?> serviceType);
|
||||
|
||||
void fire(WarpReactPlasma slot, Object event);
|
||||
void fireForEach(WarpReactPlasma slot, Object event);
|
||||
<T> void registrate(WarpReactPlasma slot, Class<T> eventType, WarpReactPlasmaCoil<T> listener);
|
||||
|
||||
<T> T service(Class<T> serviceType);
|
||||
void release(WarpReactPlasma slot);
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package love.distributedrebirth.nx01.warp.core.react;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public final class WarpReactPlasma {
|
||||
|
||||
private final WarpReactPlasma parent;
|
||||
private final String slotSlug;
|
||||
private final String slotPath;
|
||||
|
||||
private WarpReactPlasma(WarpReactPlasma parent, String slotSlug) {
|
||||
this.parent = parent;
|
||||
this.slotSlug = slotSlug;
|
||||
this.slotPath = createSlotPath();
|
||||
}
|
||||
|
||||
public WarpReactPlasma getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public String getSlotSlug() {
|
||||
return slotSlug;
|
||||
}
|
||||
|
||||
public String getSlotPath() {
|
||||
return slotPath;
|
||||
}
|
||||
|
||||
public String createSlotPath() {
|
||||
List<String> slugs = new ArrayList<>();
|
||||
WarpReactPlasma parentNode = this;
|
||||
while (parentNode != null) {
|
||||
slugs.add(parentNode.getSlotSlug());
|
||||
parentNode = parentNode.getParent();
|
||||
}
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (int i = slugs.size() - 1; i >= 0; i--) {
|
||||
buf.append(slugs.get(i));
|
||||
if (i > 0) {
|
||||
buf.append(',');
|
||||
}
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(slotPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
WarpReactPlasma other = (WarpReactPlasma) obj;
|
||||
return Objects.equals(slotPath, other.slotPath);
|
||||
}
|
||||
|
||||
public static WarpReactPlasma ofClass(Class<?> scriptClz) {
|
||||
return new WarpReactPlasma(null, scriptClz.getPackageName() + ":type=" + scriptClz.getSimpleName());
|
||||
}
|
||||
|
||||
public static WarpReactPlasma of(WarpReactPlasma parent, String kvPair) {
|
||||
return new WarpReactPlasma(parent, kvPair);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package love.distributedrebirth.nx01.warp.core.react;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface WarpReactPlasmaCoil<T> {
|
||||
|
||||
void onEvent(WarpReactPlasmaPulse<T> signal);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package love.distributedrebirth.nx01.warp.core.react;
|
||||
|
||||
public final class WarpReactPlasmaPulse<T> {
|
||||
|
||||
private final WarpReactPlasma target;
|
||||
private final T data;
|
||||
private final WarpReact react;
|
||||
|
||||
public WarpReactPlasmaPulse(WarpReactPlasma target, T data, WarpReact react) {
|
||||
this.target = target;
|
||||
this.data = data;
|
||||
this.react = react;
|
||||
}
|
||||
|
||||
public WarpReactPlasma getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public WarpReact getReact() {
|
||||
return react;
|
||||
}
|
||||
|
||||
// public T $() {
|
||||
// return getData();
|
||||
// }
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package love.distributedrebirth.nx01.warp.core.react;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.core.space.WarpSpaceAntimatterInducer;
|
||||
|
||||
public interface WarpReactTypeScript extends WarpReactPlasmaCoil<WarpSpaceAntimatterInducer> {
|
||||
|
||||
default void onRelease(WarpReactPlasmaPulse<WarpSpaceAntimatterInducer> signal) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package love.distributedrebirth.nx01.warp.core.space;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
|
||||
public abstract class AbstractSpacePlasma {
|
||||
|
||||
private final WarpReactPlasma slot;
|
||||
|
||||
public AbstractSpacePlasma(WarpReactPlasma slot) {
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
public final WarpReactPlasma getSlot() {
|
||||
return slot;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package love.distributedrebirth.nx01.warp.core.space;
|
||||
|
||||
public final class WarpSpaceAntimatterInducer {
|
||||
|
||||
public WarpSpaceAntimatterInducer() {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package love.distributedrebirth.nx01.warp.core.space;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
|
||||
public final class WarpSpacePlasmaAdd extends AbstractSpacePlasma {
|
||||
|
||||
public WarpSpacePlasmaAdd(WarpReactPlasma slot) {
|
||||
super(slot);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package love.distributedrebirth.nx01.warp.core.space;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma;
|
||||
|
||||
public final class WarpSpacePlasmaRemove extends AbstractSpacePlasma {
|
||||
|
||||
public WarpSpacePlasmaRemove(WarpReactPlasma slot) {
|
||||
super(slot);
|
||||
}
|
||||
}
|
21
pom.xml
21
pom.xml
|
@ -41,6 +41,12 @@
|
|||
<module>nx01-popcorn</module>
|
||||
<module>nx01-popcorn-duytsdoc</module>
|
||||
<module>nx01-popcorn-mm-jdbc</module>
|
||||
<module>nx01-redsea</module>
|
||||
<module>nx01-redsea-hyper-local</module>
|
||||
<module>nx01-redsea-hyper</module>
|
||||
<module>nx01-redsea-hyper-nostr</module>
|
||||
<module>nx01-redsea-jdatstart</module>
|
||||
<module>nx01-warp-core</module>
|
||||
<module>nx01-warp-fault</module>
|
||||
<module>nx01-warp-manifestor</module>
|
||||
<module>nx01-x4o-driver</module>
|
||||
|
@ -49,11 +55,6 @@
|
|||
<module>nx01-x4o-tool-ant-plugin</module>
|
||||
<module>nx01-x4o-tool-maven-plugin</module>
|
||||
<module>nx01-x4o-html</module>
|
||||
<module>nx01-redsea</module>
|
||||
<module>nx01-redsea-hyper-local</module>
|
||||
<module>nx01-redsea-hyper</module>
|
||||
<module>nx01-redsea-hyper-nostr</module>
|
||||
<module>nx01-redsea-jdatstart</module>
|
||||
</modules>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
@ -288,11 +289,6 @@
|
|||
<artifactId>nx01-no2all-nostr</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>love.distributedrebirth.nx01</groupId>
|
||||
<artifactId>nx01-no2all-react</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>love.distributedrebirth.nx01</groupId>
|
||||
<artifactId>nx01-no2all-react-nostr</artifactId>
|
||||
|
@ -368,6 +364,11 @@
|
|||
<artifactId>nx01-redsea-hyper-nostr</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>love.distributedrebirth.nx01</groupId>
|
||||
<artifactId>nx01-warp-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>love.distributedrebirth.nx01</groupId>
|
||||
<artifactId>nx01-warp-fault</artifactId>
|
||||
|
|
Loading…
Reference in a new issue