Package com.orchestranetworks.module

# Interface ModuleRegistration

All Known Implementing Classes:
  `ModuleRegistrationListener`, `ModuleRegistrationServlet`

public interface ModuleRegistration
Ensures the EBX® module registration.

If further setup of module-related resources is required, these methods should be overridden:

- `handleServiceRegistration(ModuleServiceRegistrationContext)`
- `handleRepositoryStartup(ModuleContextOnRepositoryStartup)`
- `handleSearchRegistration(ModuleSearchRegistrationContext)`

If further release of module-related resources is required, these methods should be overridden:

- `destroyBeforeUnregisterModule()`
- `handleRepositoryShutdown()`

Since:
  5.9.0
See Also:
  - Module registration

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `destroyBeforeUnregisterModule()`
  Override this method to perform operations needed, when the current web application is being taken out of service.
  `default void`
  `handleRepositoryShutdown()`
  Override this method to release module-specific resources when the repository is shut down.
  `default void`
  `handleRepositoryStartup(ModuleContextOnRepositoryStartup aContext)`
  Override this method to register module-specific resources and performs module-specific initializations that require the repository.
  `default void`
  `handleSearchRegistration(ModuleSearchRegistrationContext aContext)`
  Override this method to register module-defined search templates and custom lists of synonyms and stopwords.
  `default void`
  `handleServiceRegistration(ModuleServiceRegistrationContext aContext)`
  Override this method to register module-defined user services, service groups and user service extensions.

- ## Method Details

  - ### handleServiceRegistration

    default void handleServiceRegistration(ModuleServiceRegistrationContext aContext)
    Override this method to register module-defined user services, service groups and user service extensions.

    This method is invoked after the EBX® module is registered, during the module compilation. Note that the EBX® repository is not yet initialized at the time this method is invoked. (That is, the method `Repository.getDefault()` cannot be called; otherwise, it throw. an exception.)

    Default implementation does nothing.

    Parameters:
      `aContext` - the services registration context

  - ### handleRepositoryStartup

    default void handleRepositoryStartup(ModuleContextOnRepositoryStartup aContext) throws OperationException
    Override this method to register module-specific resources and performs module-specific initializations that require the repository.

    It is invoked after the EBX® module is registered, after `handleServiceRegistration(ModuleServiceRegistrationContext)` and when the repository is started.

    The default implementation does nothing.

    Parameters:
      `aContext` - the module registration context invoked at the initialization of the EBX® repository.
    Throws:
      `OperationException` - if an operation cannot complete successfully.

  - ### destroyBeforeUnregisterModule

    default void destroyBeforeUnregisterModule()
    Override this method to perform operations needed, when the current web application is being taken out of service.

    Called by one of these methods:

    - `ServletContextListener.contextDestroyed(ServletContextEvent)`
    - `Servlet.destroy()`

    Default implementation does nothing.

  - ### handleRepositoryShutdown

    default void handleRepositoryShutdown()
    Override this method to release module-specific resources when the repository is shut down.

    Default implementation does nothing.

  - ### handleSearchRegistration

    default void handleSearchRegistration(ModuleSearchRegistrationContext aContext)
    Override this method to register module-defined search templates and custom lists of synonyms and stopwords.

    This method is invoked after the EBX® module is registered, during the module compilation. Note that the EBX® repository is not yet initialized at the time this method is invoked. (That is, the method `Repository.getDefault()` cannot be called; otherwise, it throws an exception.)

    The default implementation does nothing.

    Since:
      6.0.0