class PluginRegistryImplementation extends PluginRegistry implements ProcessLifeCycleListener {

  public void register(GrinderPlugin plugin) throws EngineException {
    synchronized (m_plugins) {
      if (!m_plugins.containsKey(plugin)) {

        final RegisteredPlugin registeredPlugin =
          new RegisteredPlugin(plugin, m_scriptContext, m_threadContextLocator,
                               m_statisticsServices, m_timeAuthority, m_logger);

        try {
          plugin.initialize(registeredPlugin);
        }
        catch (PluginException e) {
          throw new EngineException("An instance of the plug-in class '" +
                                    plugin.getClass().getName() +
                                    "' could not be initialised.", e);
        }

        m_plugins.put(plugin, registeredPlugin);
        m_logger.info("registered plug-in {}", plugin.getClass().getName());
      }
    }
  }

    PluginRegistryImplementation(Logger logger, ScriptContext scriptContext,
                               ThreadContextLocator threadContextLocator,
                               StatisticsServices statisticsServices,
                               TimeAuthority timeAuthority);

}