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);
@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);
+ }
}
}
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
-import javax.inject.Inject;
-
import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException;
import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.dircache.DirCache;
private final Map<String, AtomicLong> lastAssignedId;
- @Inject
public BranchTicketService(
IRuntimeManager runtimeManager,
INotificationManager notificationManager,
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
-import javax.inject.Inject;
-
import org.eclipse.jgit.lib.Repository;
import com.gitblit.Constants;
private final Map<String, AtomicLong> lastAssignedId;
- @Inject
public FileTicketService(
IRuntimeManager runtimeManager,
INotificationManager notificationManager,
import java.util.Collections;
import java.util.List;
-import javax.inject.Inject;
-
import com.gitblit.manager.INotificationManager;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
*/
public class NullTicketService extends ITicketService {
- @Inject
public NullTicketService(
IRuntimeManager runtimeManager,
INotificationManager notificationManager,
import java.util.List;
import java.util.Set;
-import javax.inject.Inject;
-
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import redis.clients.jedis.Client;
journal, ticket, counter
}
- @Inject
public RedisTicketService(
IRuntimeManager runtimeManager,
INotificationManager notificationManager,