• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ThreadLocalRequestContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gerrit.server.util.ThreadLocalRequestContext的典型用法代码示例。如果您正苦于以下问题:Java ThreadLocalRequestContext类的具体用法?Java ThreadLocalRequestContext怎么用?Java ThreadLocalRequestContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ThreadLocalRequestContext类属于com.google.gerrit.server.util包,在下文中一共展示了ThreadLocalRequestContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: CreateBatchUser

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
public CreateBatchUser(@PluginName String pluginName, SchemaFactory<ReviewDb> schema,
					   PluginConfigFactory configFactory, SshKeyCache sshKeyCache, VersionedAuthorizedKeys.Accessor authorizedKeys,
					   AccountCache accountCache, AccountByEmailCache byEmailCache, AccountLoader.Factory infoLoader,
					   GroupsCollection groupsCollection, WorkQueue queue, ThreadLocalRequestContext context,
					   IdentifiedUser.GenericFactory userFactory) {
	this.schema = schema;
	this.sshKeyCache = sshKeyCache;
	this.authorizedKeys = authorizedKeys;
	this.accountCache = accountCache;
	this.byEmailCache = byEmailCache;
	this.infoLoader = infoLoader;
	this.groupsCollection = groupsCollection;
	this.context = context;
	this.userFactory = userFactory;
	pluginConfig = configFactory.getFromGerritConfig(pluginName);
	username = pluginConfig.getString("username", "jenkins");
	sshKey = pluginConfig.getString("sshKey");
	name = pluginConfig.getString("name", "Batch user");
	executor = queue.getDefaultQueue();

	createBatchUserIfNotExistsYet();
}
 
开发者ID:atteo,项目名称:jfactory,代码行数:24,代码来源:CreateBatchUser.java


示例2: Upload

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
Upload(
    Provider<CurrentUser> userProvider,
    VisibleRefFilter.Factory refFilterFactory,
    TransferConfig transferConfig,
    DynamicSet<UploadPackInitializer> uploadPackInitializers,
    DynamicSet<PreUploadHook> preUploadHooks,
    UploadValidators.Factory uploadValidatorsFactory,
    ThreadLocalRequestContext threadContext,
    ProjectCache projectCache,
    PermissionBackend permissionBackend) {
  this.userProvider = userProvider;
  this.refFilterFactory = refFilterFactory;
  this.transferConfig = transferConfig;
  this.uploadPackInitializers = uploadPackInitializers;
  this.preUploadHooks = preUploadHooks;
  this.uploadValidatorsFactory = uploadValidatorsFactory;
  this.threadContext = threadContext;
  this.projectCache = projectCache;
  this.permissionBackend = permissionBackend;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:22,代码来源:InProcessProtocol.java


示例3: Receive

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
Receive(
    Provider<CurrentUser> userProvider,
    ProjectCache projectCache,
    AsyncReceiveCommits.Factory factory,
    TransferConfig config,
    DynamicSet<ReceivePackInitializer> receivePackInitializers,
    DynamicSet<PostReceiveHook> postReceiveHooks,
    ThreadLocalRequestContext threadContext,
    PermissionBackend permissionBackend) {
  this.userProvider = userProvider;
  this.projectCache = projectCache;
  this.factory = factory;
  this.config = config;
  this.receivePackInitializers = receivePackInitializers;
  this.postReceiveHooks = postReceiveHooks;
  this.threadContext = threadContext;
  this.permissionBackend = permissionBackend;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:InProcessProtocol.java


示例4: EmailMerge

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
EmailMerge(
    @SendEmailExecutor ExecutorService executor,
    MergedSender.Factory mergedSenderFactory,
    SchemaFactory<ReviewDb> schemaFactory,
    ThreadLocalRequestContext requestContext,
    IdentifiedUser.GenericFactory identifiedUserFactory,
    @Assisted Project.NameKey project,
    @Assisted Change.Id changeId,
    @Assisted @Nullable Account.Id submitter,
    @Assisted NotifyHandling notifyHandling,
    @Assisted ListMultimap<RecipientType, Account.Id> accountsToNotify) {
  this.sendEmailsExecutor = executor;
  this.mergedSenderFactory = mergedSenderFactory;
  this.schemaFactory = schemaFactory;
  this.requestContext = requestContext;
  this.identifiedUserFactory = identifiedUserFactory;
  this.project = project;
  this.changeId = changeId;
  this.submitter = submitter;
  this.notifyHandling = notifyHandling;
  this.accountsToNotify = accountsToNotify;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:24,代码来源:EmailMerge.java


示例5: ChangeIndexer

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@AssistedInject
ChangeIndexer(
    @GerritServerConfig Config cfg,
    SchemaFactory<ReviewDb> schemaFactory,
    NotesMigration notesMigration,
    ChangeNotes.Factory changeNotesFactory,
    ChangeData.Factory changeDataFactory,
    ThreadLocalRequestContext context,
    DynamicSet<ChangeIndexedListener> indexedListeners,
    StalenessChecker stalenessChecker,
    @IndexExecutor(BATCH) ListeningExecutorService batchExecutor,
    @Assisted ListeningExecutorService executor,
    @Assisted ChangeIndex index) {
  this.executor = executor;
  this.schemaFactory = schemaFactory;
  this.notesMigration = notesMigration;
  this.changeNotesFactory = changeNotesFactory;
  this.changeDataFactory = changeDataFactory;
  this.context = context;
  this.indexedListeners = indexedListeners;
  this.stalenessChecker = stalenessChecker;
  this.batchExecutor = batchExecutor;
  this.autoReindexIfStale = autoReindexIfStale(cfg);
  this.index = index;
  this.indexes = null;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:27,代码来源:ChangeIndexer.java


示例6: AdministrateServerGroupsProvider

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
public AdministrateServerGroupsProvider(
    GroupBackend groupBackend,
    @GerritServerConfig Config config,
    ThreadLocalRequestContext threadContext,
    ServerRequestContext serverCtx) {
  RequestContext ctx = threadContext.setContext(serverCtx);
  try {
    ImmutableSet.Builder<GroupReference> builder = ImmutableSet.builder();
    for (String value : config.getStringList("capability", null, "administrateServer")) {
      PermissionRule rule = PermissionRule.fromString(value, false);
      String name = rule.getGroup().getName();
      GroupReference g = GroupBackends.findBestSuggestion(groupBackend, name);
      if (g != null) {
        builder.add(g);
      } else {
        Logger log = LoggerFactory.getLogger(getClass());
        log.warn("Group \"{}\" not available, skipping.", name);
      }
    }
    groups = builder.build();
  } finally {
    threadContext.setContext(ctx);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:26,代码来源:AdministrateServerGroupsProvider.java


示例7: GroupSetProvider

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
protected GroupSetProvider(
    GroupBackend groupBackend,
    ThreadLocalRequestContext threadContext,
    ServerRequestContext serverCtx,
    List<String> groupNames) {
  RequestContext ctx = threadContext.setContext(serverCtx);
  try {
    ImmutableSet.Builder<AccountGroup.UUID> builder = ImmutableSet.builder();
    for (String n : groupNames) {
      GroupReference g = GroupBackends.findBestSuggestion(groupBackend, n);
      if (g != null) {
        builder.add(g.getUUID());
      } else {
        Logger log = LoggerFactory.getLogger(getClass());
        log.warn("Group \"{}\" not available, skipping.", n);
      }
    }
    groupIds = builder.build();
  } finally {
    threadContext.setContext(ctx);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:23,代码来源:GroupSetProvider.java


示例8: GitReceivePackGroupsProvider

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
public GitReceivePackGroupsProvider(
    GroupBackend gb,
    @GerritServerConfig Config config,
    ThreadLocalRequestContext threadContext,
    ServerRequestContext serverCtx) {
  super(
      gb,
      threadContext,
      serverCtx,
      ImmutableList.copyOf(config.getStringList("receive", null, "allowGroup")));

  // If no group was set, default to "registered users"
  //
  if (groupIds.isEmpty()) {
    groupIds = Collections.singleton(SystemGroupBackend.REGISTERED_USERS);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:19,代码来源:GitReceivePackGroupsProvider.java


示例9: GitUploadPackGroupsProvider

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
public GitUploadPackGroupsProvider(
    GroupBackend gb,
    @GerritServerConfig Config config,
    ThreadLocalRequestContext threadContext,
    ServerRequestContext serverCtx) {
  super(
      gb,
      threadContext,
      serverCtx,
      ImmutableList.copyOf(config.getStringList("upload", null, "allowGroup")));

  // If no group was set, default to "registered users" and "anonymous"
  //
  if (groupIds.isEmpty()) {
    groupIds =
        ImmutableSet.of(SystemGroupBackend.REGISTERED_USERS, SystemGroupBackend.ANONYMOUS_USERS);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:GitUploadPackGroupsProvider.java


示例10: ChangeUpdatedListener

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
ChangeUpdatedListener(final SmartReviewers.Factory smartReviewersFactory,
    final GitRepositoryManager repoManager, final WorkQueue workQueue,
    final IdentifiedUser.GenericFactory identifiedUserFactory,
    final ThreadLocalRequestContext tl,
    final SchemaFactory<ReviewDb> schemaFactory,
    final PluginConfigFactory cfg,
    final @PluginName String pluginName) {
  this.smartReviewersFactory = smartReviewersFactory;
  this.repoManager = repoManager;
  this.workQueue = workQueue;
  this.identifiedUserFactory = identifiedUserFactory;
  this.tl = tl;
  this.schemaFactory = schemaFactory;
  this.cfg = cfg;
  this.pluginName = pluginName;
}
 
开发者ID:Intersec,项目名称:smart-reviewers,代码行数:18,代码来源:ChangeUpdatedListener.java


示例11: UserEventWorker

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
public UserEventWorker(
    ChangeHooks hooks,
    WorkQueue workQueue,
    AccountResolver accountResolver,
    IdentifiedUser.GenericFactory userFactory,
    ThreadLocalRequestContext threadLocalRequestContext,
    PluginUser pluginUser,
    SchemaFactory<ReviewDb> schemaFactory) {
  this.hooks = hooks;
  this.workQueue = workQueue;
  this.accountResolver = accountResolver;
  this.userFactory = userFactory;
  this.threadLocalRequestContext = threadLocalRequestContext;
  this.pluginUser = pluginUser;
  this.schemaFactory = schemaFactory;
}
 
开发者ID:rinrinne,项目名称:gerrit-rabbitmq-plugin,代码行数:18,代码来源:UserEventWorker.java


示例12: Propagator

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
Propagator(
    AcceptanceTestRequestScope atrScope,
    ThreadLocalRequestContext local,
    Provider<RequestScopedReviewDbProvider> dbProviderProvider) {
  super(REQUEST, current, local, dbProviderProvider);
  this.atrScope = atrScope;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:AcceptanceTestRequestScope.java


示例13: Propagator

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
Propagator(
    SshScope sshScope,
    ThreadLocalRequestContext local,
    Provider<RequestScopedReviewDbProvider> dbProviderProvider) {
  super(REQUEST, current, local, dbProviderProvider);
  this.sshScope = sshScope;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:SshScope.java


示例14: RequestContextFilter

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
RequestContextFilter(
    Provider<RequestCleanup> r, Provider<HttpRequestContext> c, ThreadLocalRequestContext l) {
  cleanup = r;
  requestContext = c;
  local = l;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:8,代码来源:RequestContextFilter.java


示例15: Builder

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
Builder(
    GerritServerConfigProvider configProvider,
    SitePaths sitePaths,
    SchemaFactory<ReviewDb> schemaFactory,
    GitRepositoryManager repoManager,
    NoteDbUpdateManager.Factory updateManagerFactory,
    ChangeBundleReader bundleReader,
    AllProjectsName allProjects,
    ThreadLocalRequestContext requestContext,
    InternalUser.Factory userFactory,
    ChangeRebuilderImpl rebuilder,
    WorkQueue workQueue,
    MutableNotesMigration globalNotesMigration,
    PrimaryStorageMigrator primaryStorageMigrator,
    DynamicSet<NotesMigrationStateListener> listeners) {
  // Reload gerrit.config/notedb.config on each migrator invocation, in case a previous
  // migration in the same process modified the on-disk contents. This ensures the defaults for
  // trial/autoMigrate get set correctly below.
  this.cfg = configProvider.get();
  this.sitePaths = sitePaths;
  this.schemaFactory = schemaFactory;
  this.repoManager = repoManager;
  this.updateManagerFactory = updateManagerFactory;
  this.bundleReader = bundleReader;
  this.allProjects = allProjects;
  this.requestContext = requestContext;
  this.userFactory = userFactory;
  this.rebuilder = rebuilder;
  this.workQueue = workQueue;
  this.globalNotesMigration = globalNotesMigration;
  this.primaryStorageMigrator = primaryStorageMigrator;
  this.listeners = listeners;
  this.trial = getTrialMode(cfg);
  this.autoMigrate = getAutoMigrate(cfg);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:37,代码来源:NoteDbMigrator.java


示例16: ProjectOwnerGroupsProvider

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
public ProjectOwnerGroupsProvider(
    GroupBackend gb,
    ThreadLocalRequestContext context,
    ServerRequestContext serverCtx,
    RepositoryConfig repositoryCfg,
    @Assisted Project.NameKey project) {
  super(gb, context, serverCtx, repositoryCfg.getOwnerGroups(project));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:10,代码来源:ProjectOwnerGroupsProvider.java


示例17: EmailReviewComments

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
EmailReviewComments(
    @SendEmailExecutor ExecutorService executor,
    PatchSetInfoFactory patchSetInfoFactory,
    CommentSender.Factory commentSenderFactory,
    SchemaFactory<ReviewDb> schemaFactory,
    ThreadLocalRequestContext requestContext,
    @Assisted NotifyHandling notify,
    @Assisted ListMultimap<RecipientType, Account.Id> accountsToNotify,
    @Assisted ChangeNotes notes,
    @Assisted PatchSet patchSet,
    @Assisted IdentifiedUser user,
    @Assisted ChangeMessage message,
    @Assisted List<Comment> comments,
    @Nullable @Assisted String patchSetComment,
    @Assisted List<LabelVote> labels) {
  this.sendEmailsExecutor = executor;
  this.patchSetInfoFactory = patchSetInfoFactory;
  this.commentSenderFactory = commentSenderFactory;
  this.schemaFactory = schemaFactory;
  this.requestContext = requestContext;
  this.notify = notify;
  this.accountsToNotify = accountsToNotify;
  this.notes = notes;
  this.patchSet = patchSet;
  this.user = user;
  this.message = message;
  this.comments = COMMENT_ORDER.sortedCopy(comments);
  this.patchSetComment = patchSetComment;
  this.labels = labels;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:32,代码来源:EmailReviewComments.java


示例18: PluginGuiceEnvironment

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
PluginGuiceEnvironment(
    Injector sysInjector,
    ThreadLocalRequestContext local,
    ServerInformation srvInfo,
    CopyConfigModule ccm,
    MetricMaker serverMetrics) {
  this.sysInjector = sysInjector;
  this.srvInfo = srvInfo;
  this.local = local;
  this.copyConfigModule = ccm;
  this.copyConfigKeys = Guice.createInjector(ccm).getAllBindings().keySet();
  this.serverMetrics = serverMetrics;

  onStart = new CopyOnWriteArrayList<>();
  onStart.addAll(listeners(sysInjector, StartPluginListener.class));

  onStop = new CopyOnWriteArrayList<>();
  onStop.addAll(listeners(sysInjector, StopPluginListener.class));

  onReload = new CopyOnWriteArrayList<>();
  onReload.addAll(listeners(sysInjector, ReloadPluginListener.class));

  sysItems = dynamicItemsOf(sysInjector);
  sysSets = dynamicSetsOf(sysInjector);
  sysMaps = dynamicMapsOf(sysInjector);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:28,代码来源:PluginGuiceEnvironment.java


示例19: ChangeEventListener

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
ChangeEventListener(
    final AccountResolver accountResolver,
    final AccountByEmailCache byEmailCache,
    final Provider<GroupsCollection> groupsCollection,
    final GroupMembers.Factory groupMembersFactory,
    final DefaultReviewers.Factory reviewersFactory,
    final GitRepositoryManager repoManager,
    final WorkQueue workQueue,
    final IdentifiedUser.GenericFactory identifiedUserFactory,
    final ThreadLocalRequestContext tl,
    final SchemaFactory<ReviewDb> schemaFactory,
    final ChangeData.Factory changeDataFactory,
    final ReviewersConfig.Factory configFactory,
    final Provider<CurrentUser> user,
    final ChangeQueryBuilder queryBuilder) {
  this.accountResolver = accountResolver;
  this.byEmailCache = byEmailCache;
  this.groupsCollection = groupsCollection;
  this.groupMembersFactory = groupMembersFactory;
  this.reviewersFactory = reviewersFactory;
  this.repoManager = repoManager;
  this.workQueue = workQueue;
  this.identifiedUserFactory = identifiedUserFactory;
  this.tl = tl;
  this.schemaFactory = schemaFactory;
  this.changeDataFactory = changeDataFactory;
  this.configFactory = configFactory;
  this.user = user;
  this.queryBuilder = queryBuilder;
}
 
开发者ID:davido,项目名称:gerrit-reviewers-plugin,代码行数:32,代码来源:ChangeEventListener.java


示例20: Propagator

import com.google.gerrit.server.util.ThreadLocalRequestContext; //导入依赖的package包/类
@Inject
Propagator(
    ThreadLocalRequestContext local,
    Provider<RequestScopedReviewDbProvider> dbProviderProvider) {
  super(REQUEST, current, local, dbProviderProvider);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:7,代码来源:InProcessProtocol.java



注:本文中的com.google.gerrit.server.util.ThreadLocalRequestContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Gmp类代码示例发布时间:2022-05-22
下一篇:
Java User类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap