diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-06 18:02:42 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-06 18:02:42 -0500 |
commit | 63fbcc2b3b9c83f41298ee2822e98b0de418e013 (patch) | |
tree | 8c1d2e373e5223117d58b6339b5a5ea97550539f /src/main/java/com/gitblit/GitBlit.java | |
parent | 8d11fa04838c850aaa92895805d39d0a2845300c (diff) | |
download | gitblit-63fbcc2b3b9c83f41298ee2822e98b0de418e013.tar.gz gitblit-63fbcc2b3b9c83f41298ee2822e98b0de418e013.zip |
Do not use @Inject on the ticket service constructors
Diffstat (limited to 'src/main/java/com/gitblit/GitBlit.java')
-rw-r--r-- | src/main/java/com/gitblit/GitBlit.java | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java index a1abfcd1..b706874a 100644 --- a/src/main/java/com/gitblit/GitBlit.java +++ b/src/main/java/com/gitblit/GitBlit.java @@ -205,7 +205,9 @@ public class GitBlit extends GitblitManager { try { Class<? extends ITicketService> serviceClass = (Class<? extends ITicketService>) Class.forName(clazz); ticketService = injector.get(serviceClass).start(); - if (ticketService.isReady()) { + if (ticketService instanceof NullTicketService) { + logger.warn("No ticket service configured."); + } else if (ticketService.isReady()) { logger.info("{} is ready.", ticketService); } else { logger.warn("{} is disabled.", ticketService); @@ -284,5 +286,37 @@ public class GitBlit extends GitblitManager { @Provides @Singleton IGitblit provideGitblit() { return GitBlit.this; } + + @Provides @Singleton NullTicketService provideNullTicketService() { + return new NullTicketService( + runtimeManager, + notificationManager, + userManager, + repositoryManager); + } + + @Provides @Singleton FileTicketService provideFileTicketService() { + return new FileTicketService( + runtimeManager, + notificationManager, + userManager, + repositoryManager); + } + + @Provides @Singleton BranchTicketService provideBranchTicketService() { + return new BranchTicketService( + runtimeManager, + notificationManager, + userManager, + repositoryManager); + } + + @Provides @Singleton RedisTicketService provideRedisTicketService() { + return new RedisTicketService( + runtimeManager, + notificationManager, + userManager, + repositoryManager); + } } } |