@Override
    public void register() {
        prepare();
        ContentGenerator[] contentGenerators = registerContentGenerator();
        if (contentGenerators != null) {
            for (ContentGenerator contentGenerator : contentGenerators) {
                try {
                    getContext().getContentGenerators().registerContentGenerator(contentGenerator);
                } catch (IllegalIDException e) {
                    context.getLogger().fatal("Illegal Id for Module: " + contentGenerator.getID(), e);
                }
            }
        }

        EventsControllerModel[] eventsControllerModels = registerEventController();
        if (eventsControllerModels != null) {
            for (EventsControllerModel eventsController : eventsControllerModels) {
                try {
                    getContext().getEvents().distributor().registerEventsController(eventsController);
                } catch (IllegalIDException e) {
                    context.getLogger().fatal("Illegal Id for Module: " + eventsController.getID(), e);
                }
            }
        }

        OutputPluginModel[] outputPluginModels = registerOutputPlugin();
        if (outputPluginModels != null) {
            for (OutputPluginModel outputPlugin : outputPluginModels) {
                try {
                    getContext().getOutput().addOutputPlugin(outputPlugin);
                } catch (IllegalIDException e) {
                    context.getLogger().fatal("Illegal Id for Module: " + outputPlugin.getID(), e);
                }
            }
        }

        OutputExtensionModel[] outputExtensionModels = registerOutputExtension();
        if (outputExtensionModels != null) {
            for (OutputExtensionModel outputExtension : outputExtensionModels) {
                try {
                    getContext().getOutput().addOutputExtension(outputExtension);
                } catch (IllegalIDException e) {
                    context.getLogger().fatal("Illegal Id for Module: " + outputExtension.getID(), e);
                }
            }
        }

        OutputControllerModel[] outputControllerModels = registerOutputController();
        if (outputControllerModels != null) {
            for (OutputControllerModel outputController : outputControllerModels) {
                try {
                    getContext().getOutput().addOutputController(outputController);
                } catch (IllegalIDException e) {
                    context.getLogger().fatal("Illegal Id for Module: " + outputController.getID(), e);
                }
            }
        }

        ActivatorModel[] activatorModels = registerActivator();
        getContext().getSystem().registerInitializedListener(() -> {
        if (activatorModels != null) {
            for (ActivatorModel activator : activatorModels) {
                try {
                    getContext().getActivators().addActivator(activator);
                } catch (IllegalIDException e) {
                    context.getLogger().fatal("Illegal Id for Module: " + activator.getID(), e);
                }
            }
        }
        });
    }

@
Override
public
void
register
(
)
{
prepare
(
)
;
ContentGenerator
[
]
contentGenerators
=
registerContentGenerator
(
)
;
if
(
contentGenerators
!=
)
{
for
(
ContentGenerator
contentGenerator
:
contentGenerators
)
{
try
{
getContext
(
)
.
getContentGenerators
(
)
.
registerContentGenerator
(
contentGenerator
)
;
}
catch
(
IllegalIDException
e
)
{
context
.
getLogger
(
)
.
fatal
(
"Illegal Id for Module: "
+
contentGenerator
.
getID
(
)
,
e
)
;
}
}
}
EventsControllerModel
[
]
eventsControllerModels
=
registerEventController
(
)
;
if
(
eventsControllerModels
!=
)
{
for
(
EventsControllerModel
eventsController
:
eventsControllerModels
)
{
try
{
getContext
(
)
.
getEvents
(
)
.
distributor
(
)
.
registerEventsController
(
eventsController
)
;
}
catch
(
IllegalIDException
e
)
{
context
.
getLogger
(
)
.
fatal
(
"Illegal Id for Module: "
+
eventsController
.
getID
(
)
,
e
)
;
}
}
}
OutputPluginModel
[
]
outputPluginModels
=
registerOutputPlugin
(
)
;
if
(
outputPluginModels
!=
)
{
for
(
OutputPluginModel
outputPlugin
:
outputPluginModels
)
{
try
{
getContext
(
)
.
getOutput
(
)
.
addOutputPlugin
(
outputPlugin
)
;
}
catch
(
IllegalIDException
e
)
{
context
.
getLogger
(
)
.
fatal
(
"Illegal Id for Module: "
+
outputPlugin
.
getID
(
)
,
e
)
;
}
}
}
OutputExtensionModel
[
]
outputExtensionModels
=
registerOutputExtension
(
)
;
if
(
outputExtensionModels
!=
)
{
for
(
OutputExtensionModel
outputExtension
:
outputExtensionModels
)
{
try
{
getContext
(
)
.
getOutput
(
)
.
addOutputExtension
(
outputExtension
)
;
}
catch
(
IllegalIDException
e
)
{
context
.
getLogger
(
)
.
fatal
(
"Illegal Id for Module: "
+
outputExtension
.
getID
(
)
,
e
)
;
}
}
}
OutputControllerModel
[
]
outputControllerModels
=
registerOutputController
(
)
;
if
(
outputControllerModels
!=
)
{
for
(
OutputControllerModel
outputController
:
outputControllerModels
)
{
try
{
getContext
(
)
.
getOutput
(
)
.
addOutputController
(
outputController
)
;
}
catch
(
IllegalIDException
e
)
{
context
.
getLogger
(
)
.
fatal
(
"Illegal Id for Module: "
+
outputController
.
getID
(
)
,
e
)
;
}
}
}
ActivatorModel
[
]
activatorModels
=
registerActivator
(
)
;
getContext
(
)
.
getSystem
(
)
.
registerInitializedListener
(
(
)
->
{
if
(
activatorModels
!=
)
{
for
(
ActivatorModel
activator
:
activatorModels
)
{
try
{
getContext
(
)
.
getActivators
(
)
.
addActivator
(
activator
)
;
}
catch
(
IllegalIDException
e
)
{
context
.
getLogger
(
)
.
fatal
(
"Illegal Id for Module: "
+
activator
.
getID
(
)
,
e
)
;
}
}
}
}
)
;
}

This method is used to register the modules


@Override
    public void initAddOn(org.intellimate.izou.system.Context context) {
        this.context = new Context(context);
    }

@ Override public void initAddOn ( org . intellimate . izou . system . Context context ) { this . context = new Context ( context ) ; }

Internal initiation of addOn - fake constructor, comes before prepare

@param context the context to initialize with

Internal initiation of addOn - fake constructor comes before prepare


protected void notifyReconnectionFailed(Exception exception) {
        if (isReconnectionAllowed()) {
            for (ConnectionListener listener : connection.connectionListeners) {
                listener.reconnectionFailed(exception);
            }
        }
    }

protected void notifyReconnectionFailed ( Exception exception ) { if ( isReconnectionAllowed ( ) ) { for ( ConnectionListener listener : connection . connectionListeners ) { listener . reconnectionFailed ( exception ) ; } } }

Fires listeners when a reconnection attempt has failed.

@param exception
the exception that occured.

Fires listeners when a reconnection attempt has failed .


protected void notifyAttemptToReconnectIn(int seconds) {
        if (isReconnectionAllowed()) {
            for (ConnectionListener listener : connection.connectionListeners) {
                listener.reconnectingIn(seconds);
            }
        }
    }

protected void notifyAttemptToReconnectIn ( int seconds ) { if ( isReconnectionAllowed ( ) ) { for ( ConnectionListener listener : connection . connectionListeners ) { listener . reconnectingIn ( seconds ) ; } } }

Fires listeners when The Connection will retry a reconnection. Expressed
in seconds.

@param seconds
the number of seconds that a reconnection will be attempted
in.

Fires listeners when The Connection will retry a reconnection . Expressed in seconds .