File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
src/main/java/com/ss/editor Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,11 @@ public final class Config {
7474 @ NotNull
7575 public static final OperatingSystem OPERATING_SYSTEM ;
7676
77+ /**
78+ * The remote control port.
79+ */
80+ public static int REMOTE_CONTROL_PORT = -1 ;
81+
7782 /**
7883 * The flag to enable debug mode.
7984 */
Original file line number Diff line number Diff line change 1+ package com .ss .editor .manager ;
2+
3+ import com .ss .editor .config .Config ;
4+ import com .ss .rlib .logging .Logger ;
5+ import com .ss .rlib .logging .LoggerManager ;
6+ import com .ss .rlib .network .NetworkFactory ;
7+ import com .ss .rlib .network .server .ServerNetwork ;
8+ import org .jetbrains .annotations .NotNull ;
9+ import org .jetbrains .annotations .Nullable ;
10+
11+ /**
12+ * The manager to process remote control.
13+ *
14+ * @author JavaSaBr
15+ */
16+ public class RemoteControlManager {
17+
18+ @ NotNull
19+ private static final Logger LOGGER = LoggerManager .getLogger (RemoteControlManager .class );
20+
21+ @ Nullable
22+ private static RemoteControlManager instance ;
23+
24+ private static @ NotNull RemoteControlManager getInstance () {
25+ if (instance == null ) instance = new RemoteControlManager ();
26+ return instance ;
27+ }
28+
29+ @ Nullable
30+ private ServerNetwork serverNetwork ;
31+
32+ private RemoteControlManager () {
33+ if (Config .REMOTE_CONTROL_PORT == -1 ) {
34+ return ;
35+ }
36+
37+ serverNetwork = NetworkFactory .newDefaultAsynchronousServerNetwork ();
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments