當前位置: 首頁>>代碼示例>>Java>>正文


Java RequestScopePropagator類代碼示例

本文整理匯總了Java中com.google.gerrit.server.util.RequestScopePropagator的典型用法代碼示例。如果您正苦於以下問題:Java RequestScopePropagator類的具體用法?Java RequestScopePropagator怎麽用?Java RequestScopePropagator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RequestScopePropagator類屬於com.google.gerrit.server.util包,在下文中一共展示了RequestScopePropagator類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: module

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
static Module module() {
  return new AbstractModule() {
    @Override
    public void configure() {
      install(new GerritRequestModule());
      bind(RequestScopePropagator.class).to(Propagator.class);
      bindScope(RequestScoped.class, InProcessProtocol.REQUEST);
    }

    @Provides
    @RemotePeer
    SocketAddress getSocketAddress() {
      // TODO(dborowitz): Could potentially fake this with thread ID or
      // something.
      throw new OutOfScopeException("No remote peer in acceptance tests");
    }
  };
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:19,代碼來源:InProcessProtocol.java

示例2: MergedByPushOp

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
@Inject
MergedByPushOp(
    PatchSetInfoFactory patchSetInfoFactory,
    ChangeMessagesUtil cmUtil,
    MergedSender.Factory mergedSenderFactory,
    PatchSetUtil psUtil,
    @SendEmailExecutor ExecutorService sendEmailExecutor,
    ChangeMerged changeMerged,
    @Assisted RequestScopePropagator requestScopePropagator,
    @Assisted PatchSet.Id psId,
    @Assisted String refName) {
  this.patchSetInfoFactory = patchSetInfoFactory;
  this.cmUtil = cmUtil;
  this.mergedSenderFactory = mergedSenderFactory;
  this.psUtil = psUtil;
  this.sendEmailExecutor = sendEmailExecutor;
  this.changeMerged = changeMerged;
  this.requestScopePropagator = requestScopePropagator;
  this.psId = psId;
  this.refName = refName;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:22,代碼來源:MergedByPushOp.java

示例3: configure

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
@Override
protected void configure() {
  bind(RequestScopePropagator.class).to(GuiceRequestScopePropagator.class);
  bind(HttpRequestContext.class);

  installAuthModule();
  if (options.enableMasterFeatures()) {
    install(new UrlModule(options, authConfig));
    install(new UiRpcModule());
  }
  install(new GerritRequestModule());
  install(new GitOverHttpServlet.Module(options.enableMasterFeatures()));

  if (gitwebCgiConfig.getGitwebCgi() != null) {
    install(new GitwebModule());
  }

  install(new AsyncReceiveCommits.Module());

  bind(SocketAddress.class)
      .annotatedWith(RemotePeer.class)
      .toProvider(HttpRemotePeerProvider.class)
      .in(RequestScoped.class);

  bind(ProxyProperties.class).toProvider(ProxyPropertiesProvider.class);

  listener().toInstance(registerInParentInjectors());

  install(UniversalWebLoginFilter.module());
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:31,代碼來源:WebModule.java

示例4: JobExecutor

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
@Inject
public JobExecutor(
    final RequestScopePropagator requestScopePropagator, final GitHubConfig config) {
  this.requestScopePropagator = requestScopePropagator;
  this.config = config;
  this.executor = Executors.newScheduledThreadPool(config.jobPoolLimit);
}
 
開發者ID:GerritCodeReview,項目名稱:plugins_github,代碼行數:8,代碼來源:JobExecutor.java

示例5: configure

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
@Override
protected void configure() {
  bindScope(RequestScoped.class, SshScope.REQUEST);
  bind(RequestScopePropagator.class).to(SshScope.Propagator.class);
  bind(SshScope.class).in(SINGLETON);

  configureRequestScope();
  install(new AsyncReceiveCommits.Module());
  configureAliases();

  bind(SshLog.class);
  bind(SshInfo.class).to(SshDaemon.class).in(SINGLETON);
  factory(DispatchCommand.Factory.class);
  factory(QueryShell.Factory.class);
  factory(PeerDaemonUser.Factory.class);

  bind(DispatchCommandProvider.class)
      .annotatedWith(Commands.CMD_ROOT)
      .toInstance(new DispatchCommandProvider(Commands.CMD_ROOT));
  bind(CommandFactoryProvider.class);
  bind(CommandFactory.class).toProvider(CommandFactoryProvider.class);
  bind(ScheduledThreadPoolExecutor.class)
      .annotatedWith(StreamCommandExecutor.class)
      .toProvider(StreamCommandExecutorProvider.class)
      .in(SINGLETON);
  bind(QueueProvider.class).to(CommandExecutorQueueProvider.class).in(SINGLETON);

  bind(GSSAuthenticator.class).to(GerritGSSAuthenticator.class);
  bind(PublickeyAuthenticator.class).to(CachingPublicKeyAuthenticator.class);

  bind(ModuleGenerator.class).to(SshAutoRegisterModuleGenerator.class);
  bind(SshPluginStarterCallback.class);
  bind(StartPluginListener.class)
      .annotatedWith(UniqueAnnotations.create())
      .to(SshPluginStarterCallback.class);

  bind(ReloadPluginListener.class)
      .annotatedWith(UniqueAnnotations.create())
      .to(SshPluginStarterCallback.class);

  DynamicMap.mapOf(binder(), DynamicOptions.DynamicBean.class);

  listener().toInstance(registerInParentInjectors());
  listener().to(SshLog.class);
  listener().to(SshDaemon.class);
  listener().to(CommandFactoryProvider.class);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:48,代碼來源:SshModule.java

示例6: AsyncReceiveCommits

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
@Inject
AsyncReceiveCommits(
    ReceiveCommits.Factory factory,
    PermissionBackend permissionBackend,
    VisibleRefFilter.Factory refFilterFactory,
    Provider<InternalChangeQuery> queryProvider,
    @ReceiveCommitsExecutor ExecutorService executor,
    RequestScopePropagator scopePropagator,
    ReceiveConfig receiveConfig,
    TransferConfig transferConfig,
    Provider<LazyPostReceiveHookChain> lazyPostReceive,
    ContributorAgreementsChecker contributorAgreements,
    @Named(TIMEOUT_NAME) long timeoutMillis,
    @Assisted ProjectState projectState,
    @Assisted IdentifiedUser user,
    @Assisted Repository repo,
    @Assisted @Nullable MessageSender messageSender,
    @Assisted SetMultimap<ReviewerStateInternal, Account.Id> extraReviewers)
    throws PermissionBackendException {
  this.factory = factory;
  this.executor = executor;
  this.scopePropagator = scopePropagator;
  this.receiveConfig = receiveConfig;
  this.contributorAgreements = contributorAgreements;
  this.timeoutMillis = timeoutMillis;
  this.projectState = projectState;
  this.user = user;
  this.repo = repo;
  this.messageSender = messageSender;
  this.extraReviewers = extraReviewers;

  Project.NameKey projectName = projectState.getNameKey();
  rp = new ReceivePack(repo);
  rp.setAllowCreates(true);
  rp.setAllowDeletes(true);
  rp.setAllowNonFastForwards(true);
  rp.setRefLogIdent(user.newRefLogIdent());
  rp.setTimeout(transferConfig.getTimeout());
  rp.setMaxObjectSizeLimit(transferConfig.getEffectiveMaxObjectSizeLimit(projectState));
  rp.setCheckReceivedObjects(projectState.getConfig().getCheckReceivedObjects());
  rp.setRefFilter(new ReceiveRefFilter());
  rp.setAllowPushOptions(true);
  rp.setPreReceiveHook(this);
  rp.setPostReceiveHook(lazyPostReceive.get());

  // If the user lacks READ permission, some references may be filtered and hidden from view.
  // Check objects mentioned inside the incoming pack file are reachable from visible refs.
  this.perm = permissionBackend.user(user).project(projectName);
  try {
    this.perm.check(ProjectPermission.READ);
  } catch (AuthException e) {
    rp.setCheckReferencedObjectsAreReachable(receiveConfig.checkReferencedObjectsAreReachable);
  }

  List<AdvertiseRefsHook> advHooks = new ArrayList<>(4);
  allRefsWatcher = new AllRefsWatcher();
  advHooks.add(allRefsWatcher);
  advHooks.add(refFilterFactory.create(projectState, repo).setShowMetadata(false));
  advHooks.add(new ReceiveCommitsAdvertiseRefsHook(queryProvider, projectName));
  advHooks.add(new HackPushNegotiateHook());
  rp.setAdvertiseRefsHook(AdvertiseRefsHookChain.newChain(advHooks));
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:63,代碼來源:AsyncReceiveCommits.java

示例7: setRequestScopePropagator

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
public ReplaceOp setRequestScopePropagator(RequestScopePropagator requestScopePropagator) {
  this.requestScopePropagator = requestScopePropagator;
  return this;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:5,代碼來源:ReplaceOp.java

示例8: create

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
MergedByPushOp create(
RequestScopePropagator requestScopePropagator, PatchSet.Id psId, String refName);
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:3,代碼來源:MergedByPushOp.java

示例9: setRequestScopePropagator

import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
public ChangeInserter setRequestScopePropagator(RequestScopePropagator r) {
  this.requestScopePropagator = r;
  return this;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:5,代碼來源:ChangeInserter.java


注:本文中的com.google.gerrit.server.util.RequestScopePropagator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。