new system runtime
parent
ec68e2631d
commit
48068f057d
|
@ -0,0 +1,185 @@
|
||||||
|
const Event = require('.././r3-event');
|
||||||
|
const Utils = require('.././r3-utils');
|
||||||
|
const System = require('./r3-system.js');
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
GENERATED_INHERITED_START
|
||||||
|
|
||||||
|
Class R3.System.Runtime
|
||||||
|
[Inherited from System]
|
||||||
|
|
||||||
|
Inherited Properties:
|
||||||
|
|
||||||
|
<no inherited properties>
|
||||||
|
|
||||||
|
Inherited Static Properties:
|
||||||
|
|
||||||
|
<no inherited static properties>
|
||||||
|
|
||||||
|
Inherited Methods:
|
||||||
|
|
||||||
|
<no inherited methods>
|
||||||
|
|
||||||
|
Inherited Static Methods:
|
||||||
|
|
||||||
|
<no inherited static methods>
|
||||||
|
|
||||||
|
[Belonging to SystemRuntime]
|
||||||
|
|
||||||
|
Properties:
|
||||||
|
|
||||||
|
<no properties>
|
||||||
|
|
||||||
|
Static Properties:
|
||||||
|
|
||||||
|
- Started (Default value false)
|
||||||
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
|
Methods:
|
||||||
|
|
||||||
|
<no methods>
|
||||||
|
|
||||||
|
Static Methods:
|
||||||
|
|
||||||
|
- Start(options)
|
||||||
|
Starts the system by registering subscriptions to events
|
||||||
|
|
||||||
|
- Stop(options)
|
||||||
|
Stops the system by removing these subscriptions to events
|
||||||
|
|
||||||
|
GENERATED_INHERITED_END
|
||||||
|
|
||||||
|
CUSTOM_OPTIONS_START
|
||||||
|
CUSTOM_OPTIONS_END
|
||||||
|
|
||||||
|
CUSTOM_STATIC_OPTIONS_START
|
||||||
|
Started=false
|
||||||
|
Subscriptions={}
|
||||||
|
CUSTOM_STATIC_OPTIONS_END
|
||||||
|
|
||||||
|
CUSTOM_EVENT_LISTENERS_START
|
||||||
|
CUSTOM_EVENT_LISTENERS_END
|
||||||
|
|
||||||
|
CUSTOM_STATIC_EVENT_LISTENERS_START
|
||||||
|
CUSTOM_STATIC_EVENT_LISTENERS_END
|
||||||
|
|
||||||
|
CUSTOM_METHODS_START
|
||||||
|
CUSTOM_METHODS_END
|
||||||
|
|
||||||
|
CUSTOM_STATIC_METHODS_START
|
||||||
|
Start(options) - Starts the system by registering subscriptions to events
|
||||||
|
Stop(options) - Stops the system by removing these subscriptions to events
|
||||||
|
CUSTOM_STATIC_METHODS_END
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
class SystemRuntime extends System {
|
||||||
|
|
||||||
|
//GENERATED_CONSTRUCTOR_EXTENDS_START
|
||||||
|
constructor(options) {
|
||||||
|
|
||||||
|
if (typeof options === 'undefined') {
|
||||||
|
options = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
super(options);
|
||||||
|
|
||||||
|
//GENERATED_OPTIONS_INIT_START
|
||||||
|
//GENERATED_OPTIONS_INIT_END
|
||||||
|
|
||||||
|
//CUSTOM_OPTIONS_INIT_START
|
||||||
|
//CUSTOM_OPTIONS_INIT_END
|
||||||
|
|
||||||
|
Object.assign(this, options);
|
||||||
|
|
||||||
|
//CUSTOM_BEFORE_INIT_START
|
||||||
|
//CUSTOM_BEFORE_INIT_END
|
||||||
|
|
||||||
|
//CUSTOM_AFTER_INIT_START
|
||||||
|
//CUSTOM_AFTER_INIT_END
|
||||||
|
}
|
||||||
|
//GENERATED_CONSTRUCTOR_EXTENDS_END
|
||||||
|
|
||||||
|
//GENERATED_METHODS_START
|
||||||
|
//GENERATED_METHODS_END
|
||||||
|
|
||||||
|
//GENERATED_STATIC_METHODS_START
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start()
|
||||||
|
* - Starts the system by registering subscriptions to events
|
||||||
|
* @param options
|
||||||
|
*/
|
||||||
|
static Start(options) {
|
||||||
|
|
||||||
|
//GENERATED_STATIC_START_METHOD_START
|
||||||
|
|
||||||
|
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||||
|
|
||||||
|
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
||||||
|
|
||||||
|
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
||||||
|
//CUSTOM_BEFORE_STATIC_SYSTEM_START_END
|
||||||
|
|
||||||
|
SystemRuntime.Started = true;
|
||||||
|
|
||||||
|
console.log('Started system: SystemRuntime');
|
||||||
|
|
||||||
|
//GENERATED_STATIC_START_METHOD_END
|
||||||
|
|
||||||
|
//CUSTOM_STATIC_START_METHOD_START
|
||||||
|
//CUSTOM_STATIC_START_METHOD_END
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop()
|
||||||
|
* - Stops the system by removing these subscriptions to events
|
||||||
|
* @param options
|
||||||
|
*/
|
||||||
|
static Stop(options) {
|
||||||
|
|
||||||
|
//GENERATED_STATIC_STOP_METHOD_START
|
||||||
|
|
||||||
|
//GENERATED_STATIC_EVENT_LISTENERS_STOP_START
|
||||||
|
//GENERATED_STATIC_EVENT_LISTENERS_STOP_END
|
||||||
|
|
||||||
|
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_START
|
||||||
|
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_END
|
||||||
|
|
||||||
|
SystemRuntime.Started = false;
|
||||||
|
|
||||||
|
console.log('Stopped system: SystemRuntime');
|
||||||
|
|
||||||
|
//GENERATED_STATIC_STOP_METHOD_END
|
||||||
|
|
||||||
|
//CUSTOM_STATIC_STOP_METHOD_START
|
||||||
|
//CUSTOM_STATIC_STOP_METHOD_END
|
||||||
|
|
||||||
|
}
|
||||||
|
//GENERATED_STATIC_METHODS_END
|
||||||
|
|
||||||
|
//GENERATED_EVENT_LISTENER_METHODS_START
|
||||||
|
//GENERATED_EVENT_LISTENER_METHODS_END
|
||||||
|
|
||||||
|
//GENERATED_STATIC_EVENT_LISTENER_METHODS_START
|
||||||
|
//GENERATED_STATIC_EVENT_LISTENER_METHODS_END
|
||||||
|
|
||||||
|
//CUSTOM_IMPLEMENTATION_START
|
||||||
|
//CUSTOM_IMPLEMENTATION_END
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//GENERATED_STATIC_OPTIONS_INIT_START
|
||||||
|
SystemRuntime.Started = false;
|
||||||
|
SystemRuntime.Subscriptions = {};
|
||||||
|
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||||
|
|
||||||
|
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||||
|
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||||
|
|
||||||
|
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||||
|
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||||
|
|
||||||
|
module.exports = SystemRuntime;
|
Loading…
Reference in New Issue