22
33Techsenger Alpha is a framework built on top of the Java Platform Module System (JPMS) that manages modular components
44through dynamic module layers. It provides a powerful API and versatile interfaces (CLI/GUI) with multiple built-in
5- commands — helping developers efficiently build and orchestrate modular systems.
5+ commands — helping developers efficiently build and manage modular systems.
66
77## Table of Contents
88* [ Overview] ( #overview )
@@ -21,12 +21,13 @@ commands — helping developers efficiently build and orchestrate modular system
2121 * [ Configuration] ( #usage-component-config )
2222 * [ Events] ( #usage-component-events )
2323 * [ Services] ( #usage-component-services )
24+ * [ Remote Control] ( #usage-remote-control )
2425 * [ Text Commands] ( #usage-commands )
2526 * [ CLI Console] ( #usage-cli )
2627 * [ GUI Console] ( #usage-gui )
2728 * [ Shell] ( #usage-gui-shell )
2829 * [ Memory Log] ( #usage-gui-memory-log )
29- * [ Diagrams] ( #diagrams )
30+ * [ Diagrams] ( #usage-gui- diagrams )
3031 * [ Assembly Maven Plugin] ( #usage-assembly-plugin )
3132* [ Requirements] ( #requirements )
3233* [ Dependencies] ( #dependencies )
@@ -42,7 +43,7 @@ JPMS (Java Platform Module System), which was introduced in Java 9, along with m
4243layer. A layer can be defined as a group of modules that are loaded and managed together. Key features of a layer
4344include:
4445
45- * Isolation - modules within a layer can be independent from other layers.
46+ * Isolation - modules within a layer can be independent of other layers.
4647* Hierarchy - layers form a graph and can use modules from parent layers.
4748* Dynamic configuration - layers can be dynamically added and removed (except the boot layer).
4849
@@ -65,7 +66,7 @@ The framework operates in three modes: `standalone`, `client`, and `server`. The
6566already running Alpha frameworks.
6667
6768You can interact with the framework either through the API or through the text command mechanism. Text commands are a
68- convenient way to work with the framework. Out of the box , about 40 commands are provided for working with components,
69+ convenient way to work with the framework. By default , about 40 commands are provided for working with components,
6970sessions, gathering information, etc. At the same time, it is very easy to add your own commands. The framework will
7071automatically discover them in any layer (the module must provide a factory service) and integrate them into any
7172console. The framework can also execute command scripts, which consist of a series of commands, for example, from a file.
@@ -171,11 +172,7 @@ setting up the integration test environment.
171172### Component <a name =" usage-component " ></a >
172173
173174Each component has a name and a version. The name and version are separated by ` : ` . For example, the foo component
174- with version 1.0.0 is specified as ` foo:1.0.0 ` , and the command to launch the component will be:
175-
176- ```
177- component:start foo:1.0.0
178- ```
175+ with version 1.0.0 is specified as ` foo:1.0.0 ` .
179176
180177An unlimited number of instances of the same component can be created, as instances are identified in the system by
181178their ` id ` . Additionally, a component instance can be assigned an ` alias ` and accessed using this ` alias ` . This is
@@ -322,7 +319,7 @@ A configuration template with all supported tags:
322319 <Module groupId="..." artifactId="..." version="..."/>
323320 </If>
324321
325- <Module groupId="..." artifactId="..." version="${config['modVersion']}" active="true" nativeAccessEnabled="true>
322+ <Module groupId="..." artifactId="..." version="${config['modVersion']}" active="true" nativeAccessEnabled="true" >
326323 <Directives>
327324 <Directive type="opens/reads/exports" package="..." layer="..." module="..."/>
328325 <Directive type="requestsOpen/requestsRead/requestsExport" layer="..." module="..." package="..."/>
@@ -407,59 +404,80 @@ There are two solutions to this problem:
4074041 . Use ` ServiceTracker ` .
4084052 . Use ` ComponentObserver ` .
409406
407+ ### Remote Control <a name =" usage-remote-control " ></a >
408+
409+ The framework provides out-of-the-box support for remote management over HTTP. To understand how to work with it, you
410+ can refer to the integration test configuration in the ` alpha-it-net ` module.
411+
412+ It is important to note that the data channel is not encrypted. When deploying the client and server on different
413+ hosts, you must ensure traffic protection using a VPN or an SSH tunnel.
414+
410415### Text Commands <a name =" usage-commands " ></a >
411416
412417Text commands are a powerful tool for working with the framework; however, their use is optional. It is important
413418to note that all commands, both built-in and custom, are automatically added to the CLI and GUI consoles.
414419
420+ All text-based commands are transmitted to the platform over the HTTP network protocol. On one hand, this introduces
421+ a small overhead when the client and server run within the same JVM instance; on the other hand, this approach
422+ allows interaction with different servers.
423+
415424** Command Executor** . The execution of commands is handled by ` CommandExecutor ` , which receives a ` String ` containing
416425the commands as input. Each command is a separate class implementing the ` Command ` interface. The executor splits the
417- text into individual commands and processes each one. If a command is local, the executor handles it internally.
418- If a command is remote, the executor forwards it to the executor of the remote framework.
426+ text into individual commands and processes each one.
419427
420- The command processing follows these steps: First, the class implementing the command is identified. Then, the
421- ` CommandFactory ` provider of the module containing the command is invoked. The ` CommandFactory ` creates an instance
422- of the command and returns it to the executor. Next, the command's parameters are parsed and their values are set
423- in the command instance. Finally, the command is executed.
428+ The execution flow is as follows:
424429
425- It is important to note that ` CommandExecutor ` will find the ` CommandFactory ` in any layer.
430+ ```
431+ Console → Command Executor → Client → Server → EndpointHandler → Framework API
432+ ```
426433
427434** Custom Command** . To create a custom command, you need to do the following:
428435
4294361 . Implement the ` Command ` interface (it is recommended to inherit from ` AbstractCommand ` ).
430- 2 . Create a ` CommandFactory ` in the module containing the command.
431- 3 . Add the command to the ` CommandFactory ` .
437+ 2 . Create provider for ` CommandService ` in the module containing the command.
438+ 3 . Add the module to the console component .
432439
433- For examples, refer to the ` alpha-commands ` module.
440+ To create a custom ` EndpointHandler ` , do the following:
441+ 1 . Implement the EndpointHandler interface.
442+ 2 . Create provider for ` EndpointHandlerService ` in the module containing the handler.
443+ 3 . Add the module to the server component.
434444
435445** Command Scripts** . A command ` String ` can contain an unlimited number of commands separated by ` ; ` . This allows for
436446the use of command scripts — files that contain text commands. Typically, scripts are stored in the ` script ` folder.
437447
448+ ** Local and Remote Commands.** Any command can be local, remote, or both. Local commands can be executed without a
449+ session, while remote commands require an active session.
450+
438451** Special Symbols** . When working with commands, the following special characters should be considered:
439452
440453* ` ; ` — used to separate commands.
441454* ` # ` — used for comments in scripts. It can only be the first character of a line.
442- * ` ! ` — used as a prefix for commands when working in sessions, to execute the command locally .
455+ * ` ! ` — used as a prefix for commands when working in sessions, to execute them as local commands .
443456
444- ### CLI Console < a name = " usage-cli " ></ a >
457+ ** Basic Commands **
445458
446- The CLI console is a simple command-line interface. Unlike the GUI console, its capabilities are limited to
447- executing commands. The strength of the CLI console lies in its versatility—it can operate in environments without a
448- graphical interface.
459+ ```
460+ # to open a session to the server
461+ session:open demo -a 127.0.0.1:7900 -n admin -p admin
449462
450- The console supports a completer, which is invoked using the ` Tab ` key.
463+ # to list all remote commands
464+ command:list
451465
452- Help is available for all commands in the console. Therefore, we will highlight only two points:
466+ # to list all local commands
467+ !command:list
453468
454- 1 . The framework is shut down via the ` framework:shutdown ` command.
455- 2 . When working in a session, use the ` ! ` prefix to exit a session, switch between sessions, etc.
469+ # to detach the session
470+ !session:detach
471+ ```
456472
457- For example, the following command will exit the session but will not close it.
473+ ### CLI Console < a name = " usage-cli " ></ a >
458474
459- ```
460- demouser@localhost> !session:detach
461- > |
462- ```
475+ The CLI console is a simple command-line interface. Unlike the GUI console, its capabilities are limited to
476+ executing commands. The strength of the CLI console lies in its versatility—it can operate in environments without a
477+ graphical interface.
478+
479+ At the same time, it supports command history, autocomplete (both for commands and parameters via Tab key) and
480+ command highlighting.
463481
464482### GUI Console <a name =" usage-gui " ></a >
465483
@@ -468,7 +486,7 @@ but also provides features for viewing log messages and generating graphs for wo
468486
469487#### Shell <a name =" usage-gui-shell " ></a >
470488
471- The Shell is a component that allows executing text commands. It is similar to the GUI console with two exceptions:
489+ The Shell is a component that allows executing text commands. It is similar to the CLI console with two exceptions:
472490
4734911 . To invoke the completer, you need to use the ` Ctrl ` + ` Space ` keyboard shortcut.
4744922 . It provides a graphical interface for working with sessions.
@@ -484,7 +502,7 @@ intended solely for testing and debugging purposes.
484502By default, the memory log is not active. To enable it, you must set the parameter
485503` com.techsenger.alpha.core.log.memory ` to ` true ` in the ` .sh ` / ` .bat ` scripts.
486504
487- #### Diagrams <a name =" diagrams " ></a >
505+ #### Diagrams <a name =" usage-gui- diagrams" ></a >
488506
489507Diagrams are a useful tool that provides complete information about layers, modules, and packages. The importance of
490508this tool is especially heightened when working with complex systems.
@@ -595,12 +613,6 @@ The project contains various demo modules. Some of them can be run using the Exe
595613
596614Information on how to run a specific ` Demo.java ` is provided in the Javadoc of that class.
597615
598- To connect the server use the following command (name: admin, password: admin):
599-
600- ```
601- session:open demo -a 127.0.0.1:7900 -s -n admin
602- ```
603-
604616## License <a name =" license " ></a >
605617
606618Techsenger Alpha is licensed under the Apache License, Version 2.0.
0 commit comments