本文整理匯總了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");
}
};
}
示例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;
}
示例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());
}
示例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);
}
示例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);
}
示例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));
}
示例7: setRequestScopePropagator
import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
public ReplaceOp setRequestScopePropagator(RequestScopePropagator requestScopePropagator) {
this.requestScopePropagator = requestScopePropagator;
return this;
}
示例8: create
import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
MergedByPushOp create(
RequestScopePropagator requestScopePropagator, PatchSet.Id psId, String refName);
示例9: setRequestScopePropagator
import com.google.gerrit.server.util.RequestScopePropagator; //導入依賴的package包/類
public ChangeInserter setRequestScopePropagator(RequestScopePropagator r) {
this.requestScopePropagator = r;
return this;
}