Remove the NewProjectCreatedListener implementation

Initial version of this plugin implemented the NewProjectCreatedListener
in order to create missing repositories in the replication targets. This
was the only way how replication plugin created missing repositories.

Since I4e587cdfca09445c9b1c528b2f1edae0944aec68, if during the
replication of a ref it is found that the repository missing on the
remote site it will be automatically created. This means, that since
that change there are two ways a repository is created on the remote
site:
1: from the NewProjectCreatedListener.onNewProjectCreated
2: during ref replication when the repository is missing

There are two major differences in how cases 1 and 2 are invoked. In the
case 1 the remote repository creation is performed from the calling
thread, which means from the Gerrit core thread which invokes
NewProjectCreatedListener(s). In the case 2, the creation of the remote
repository is done from the replication queue thread which was
processing the ref replication. Note that replication tasks are created
with an additional child injector [1] which provides additional bindings
available for injection into the classes implementing the replication
and repository creation.  These binding are, however, not available when
the repository creation is processed from the Gerrit core thread
invoking NewProjectCreatedListener(s).

Removing the NewProjectCreatedListener implementation removes this
asymmetry and makes sure that all replication relevant steps, including
repository creation, are processed from replication queue threads.

[1] https://gerrit.googlesource.com/plugins/replication/+/871da5aa023bdfd03a3b943f7f6b82c7e0f16341/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java#189

Change-Id: I32e7aa632ffe0e94eb525f7f2c007fbb88569004
2 files changed
tree: 684fa29826d6f0271d38ec8127fdf5262c169564
  1. .settings/
  2. src/
  3. .gitignore
  4. .mailmap
  5. BUILD
  6. LICENSE