下面列出了org.junit.platform.commons.JUnitException#javax.inject.Inject 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Inject
public ShardOrganizationManager(
@ForMetadata IDBI dbi,
NodeManager nodeManager,
ShardManager shardManager,
ShardOrganizer organizer,
TemporalFunction temporalFunction,
StorageManagerConfig config)
{
this(dbi,
nodeManager.getCurrentNode().getNodeIdentifier(),
shardManager,
organizer,
temporalFunction,
config.isOrganizationEnabled(),
config.getOrganizationInterval(),
config.getOrganizationDiscoveryInterval());
}
@Inject
public KuduConnector(
LifeCycleManager lifeCycleManager,
KuduMetadata metadata,
ConnectorSplitManager splitManager,
KuduTableProperties tableProperties,
ConnectorPageSourceProvider pageSourceProvider,
ConnectorPageSinkProvider pageSinkProvider,
Set<Procedure> procedures)
{
this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null");
this.metadata = requireNonNull(metadata, "metadata is null");
this.splitManager = requireNonNull(splitManager, "splitManager is null");
this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null");
this.tableProperties = requireNonNull(tableProperties, "tableProperties is null");
this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null");
this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null"));
}
@Inject
private OpponentInfoOverlay(
final OpponentInfoPlugin opponentInfoPlugin,
final OpponentInfoConfig opponentInfoConfig)
{
super(opponentInfoPlugin);
this.opponentInfoPlugin = opponentInfoPlugin;
this.opponentInfoConfig = opponentInfoConfig;
setPosition(OverlayPosition.TOP_LEFT);
setPriority(OverlayPriority.HIGH);
panelComponent.setBorder(new Rectangle(2, 2, 2, 2));
panelComponent.setGap(new Point(0, 2));
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Opponent info overlay"));
}
@Inject
private KourendLibraryTutorialOverlay(Client client, KourendLibraryConfig config, Library library)
{
this.client = client;
this.config = config;
this.library = library;
panelComponent.setPreferredSize(new Dimension(177, 0));
noDataMessageComponent = LineComponent.builder().left("Click on the white squares to start finding books.").build();
incompleteMessageComponent = LineComponent.builder().left("Some books have been found. Keep checking marked bookcases to find more.").build();
completeMessageComponent = LineComponent.builder().left("All books found.").build();
sidebarMessageComponent = LineComponent.builder().left("Locations are in the sidebar.").build();
setPriority(OverlayPriority.LOW);
setPosition(OverlayPosition.TOP_LEFT);
}
private static <T> @Nullable Constructor<T> findSingleInjectConstructor(Class<T> cls) {
// Not modifying it, safe to use generics; see Class#getConstructors() for more info.
@SuppressWarnings("unchecked")
Constructor<T>[] constructors = (Constructor<T>[]) cls.getDeclaredConstructors();
Constructor<T> target = null;
for (Constructor<T> constructor : constructors) {
if (constructor.getAnnotation(Inject.class) != null) {
if (target != null) {
throw new IllegalStateException(
cls.getCanonicalName() + " defines multiple @Inject-annotations constructors");
}
target = constructor;
}
}
return target;
}
@Inject
public ThriftConnector(
LifeCycleManager lifeCycleManager,
ThriftMetadata metadata,
ThriftSplitManager splitManager,
ThriftPageSourceProvider pageSourceProvider,
ThriftSessionProperties sessionProperties,
ThriftIndexProvider indexProvider)
{
this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null");
this.metadata = requireNonNull(metadata, "metadata is null");
this.splitManager = requireNonNull(splitManager, "splitManager is null");
this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null");
this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null");
this.indexProvider = requireNonNull(indexProvider, "indexProvider is null");
}
/**
* Creates a new instance.
*
* @param vehicles The selected vehicles.
* @param level The level to to change the vehicles to.
* @param portalProvider Provides access to a shared portal.
*/
@Inject
public IntegrationLevelChangeAction(@Assisted Collection<VehicleModel> vehicles,
@Assisted Vehicle.IntegrationLevel level,
SharedKernelServicePortalProvider portalProvider) {
this.vehicles = requireNonNull(vehicles, "vehicles");
this.level = requireNonNull(level, "level");
this.portalProvider = requireNonNull(portalProvider, "portalProvider");
String actionName;
switch (level) {
case TO_BE_NOTICED:
actionName = bundle.getString("integrationLevelChangeAction.notice.name");
break;
case TO_BE_RESPECTED:
actionName = bundle.getString("integrationLevelChangeAction.respect.name");
break;
case TO_BE_UTILIZED:
actionName = bundle.getString("integrationLevelChangeAction.utilize.name");
break;
default:
actionName = bundle.getString("integrationLevelChangeAction.ignore.name");
break;
}
putValue(NAME, actionName);
}
/**
* @param provider to authenticate when required
* @param configuration the configuration to get and set the username and
* password
* @throws SvnClientException
*/
@Inject
public SvnClientJavaHl(ICredentialProvider provider, IConfiguration configuration) throws SvnClientException {
try {
if (!SVNClientAdapterFactory.isSVNClientAvailable(JhlClientAdapterFactory.JAVAHL_CLIENT)) {
JhlClientAdapterFactory.setup();
}
client = SVNClientAdapterFactory.createSVNClient(JhlClientAdapterFactory.JAVAHL_CLIENT);
final String username = configuration.getSvnUsername();
if (username != null) {
client.setUsername(username);
}
final String password = configuration.getSvnPassword();
if (password != null) {
client.setPassword(password);
}
client.addPasswordCallback(new SVNPromptUserPassword(provider, configuration, client));
} catch (SVNClientException | ConfigurationException e) {
throw new SvnClientException(e);
}
}
@Inject
public GlueHiveMetastore(
HdfsEnvironment hdfsEnvironment,
GlueHiveMetastoreConfig glueConfig,
GlueColumnStatisticsProvider columnStatisticsProvider,
@ForGlueHiveMetastore Executor executor,
@ForGlueHiveMetastore Optional<RequestHandler2> requestHandler)
{
requireNonNull(glueConfig, "glueConfig is null");
this.hdfsEnvironment = requireNonNull(hdfsEnvironment, "hdfsEnvironment is null");
this.hdfsContext = new HdfsContext(ConnectorIdentity.ofUser(DEFAULT_METASTORE_USER));
this.glueClient = createAsyncGlueClient(glueConfig, requestHandler);
this.defaultDir = glueConfig.getDefaultWarehouseDir();
this.catalogId = glueConfig.getCatalogId().orElse(null);
this.partitionSegments = glueConfig.getPartitionSegments();
this.executor = requireNonNull(executor, "executor is null");
this.columnStatisticsProvider = requireNonNull(columnStatisticsProvider, "columnStatisticsProvider is null");
}
@Inject
public MultinodeTls(
PathResolver pathResolver,
DockerFiles dockerFiles,
PortBinder portBinder,
Standard standard,
Hadoop hadoop,
EnvironmentOptions environmentOptions)
{
super(ImmutableList.of(standard, hadoop));
this.pathResolver = requireNonNull(pathResolver, "pathResolver is null");
this.dockerFiles = requireNonNull(dockerFiles, "dockerFiles is null");
this.portBinder = requireNonNull(portBinder, "portBinder is null");
imagesVersion = requireNonNull(environmentOptions.imagesVersion, "environmentOptions.imagesVersion is null");
serverPackage = requireNonNull(environmentOptions.serverPackage, "environmentOptions.serverPackage is null");
}
@Inject
private ScreenMarkerWidgetHighlightOverlay(final ScreenMarkerPlugin plugin, final Client client)
{
this.plugin = plugin;
this.client = client;
setPosition(OverlayPosition.DETACHED);
setLayer(OverlayLayer.ABOVE_WIDGETS);
setPriority(OverlayPriority.HIGH);
}
@Inject
public ResourceAccessType(StaticResourceAccessTypeLoader staticResourceAccessTypeLoader)
{
this.resourceAccessTypeLoaders = ImmutableList.<ResourceAccessTypeLoader>builder()
.add(staticResourceAccessTypeLoader)
.add(new AnnotatedResourceAccessTypeLoader())
.build();
}
@Inject
private ScreenMarkerCreationOverlay(final ScreenMarkerPlugin plugin)
{
this.plugin = plugin;
setPosition(OverlayPosition.DETACHED);
setLayer(OverlayLayer.ALWAYS_ON_TOP);
setPriority(OverlayPriority.HIGH);
}
@Inject
public TaskExecutor(TaskManagerConfig config, EmbedVersion embedVersion, MultilevelSplitQueue splitQueue)
{
this(requireNonNull(config, "config is null").getMaxWorkerThreads(),
config.getMinDrivers(),
config.getMinDriversPerTask(),
config.getMaxDriversPerTask(),
embedVersion,
splitQueue,
Ticker.systemTicker());
}
/**
* Decorates the server span with custom data when the gRPC call is closed.
*
* @param serverCloseDecorator used to decorate the server span
*/
@Inject
public void setServerCloseDecorator(@Nullable ServerCloseDecorator serverCloseDecorator) {
if (serverCloseDecorator != null) {
builder.withServerCloseDecorator(serverCloseDecorator);
}
}
@Inject
public RobotCommAdapter(AdapterComponentsFactory componentsFactory,
RobotConfiguration configuration,
StandardVehicleService vehicleService,
StandardTransportOrderService transportOrderService,
StandardPlantModelService plantModelService,
StandardDispatcherService dispatcherService,
DefaultRouter router,
VehicleControllerPool vehicleControllerPool,
@Assisted Vehicle vehicle,
@KernelExecutor ExecutorService kernelExecutor) {
super(new RobotProcessModel(vehicle),
configuration.commandQueueCapacity(),
configuration.sentQueueCapacity(),
configuration.rechargeOperation());
this.vehicle = requireNonNull(vehicle, "vehicle");
this.configuration = requireNonNull(configuration, "configuration");
this.componentsFactory = requireNonNull(componentsFactory, "componentsFactory");
this.kernelExecutor = requireNonNull(kernelExecutor, "kernelExecutor");
this.vehicleService = vehicleService;
this.transportOrderService = transportOrderService;
this.dispatcherService = dispatcherService;
this.plantModelService = plantModelService;
this.router = router;
this.vehicleControllerPool = vehicleControllerPool;
/**移动命令队列*/
this.tempCommandQueue = new LinkedBlockingQueue<>();
this.movementCommandQueue = new LinkedBlockingQueue<>();
}
@Inject
IncomingPublishService(final @NotNull InternalPublishService publishService,
final @NotNull EventLog eventLog,
final @NotNull MqttConfigurationService mqttConfigurationService,
final @NotNull Mqtt5ServerDisconnector mqtt5ServerDisconnector) {
this.publishService = publishService;
this.eventLog = eventLog;
this.mqttConfigurationService = mqttConfigurationService;
this.mqtt5ServerDisconnector = mqtt5ServerDisconnector;
}
@Inject
public ProxyResource(@ForProxy HttpClient httpClient, JsonWebTokenHandler jwtHandler, ProxyConfig config)
{
this.httpClient = requireNonNull(httpClient, "httpClient is null");
this.jwtHandler = requireNonNull(jwtHandler, "jwtHandler is null");
this.remoteUri = requireNonNull(config.getUri(), "uri is null");
this.hmac = hmacSha256(loadSharedSecret(config.getSharedSecretFile()));
}
@Inject
public ContainerEndpoint(OzoneStorageContainerManager reconSCM,
ContainerSchemaManager containerSchemaManager) {
this.containerManager =
(ReconContainerManager) reconSCM.getContainerManager();
this.containerSchemaManager = containerSchemaManager;
}
/**
* Creates a new instance.
*
* @param objectService The tcs obejct service.
* @param globalSyncObject The kernel threads' global synchronization object.
* @param globalObjectPool The object pool to be used.
* @param orderPool The oder pool to be used.
* @param model The model to be used.
*/
@Inject
public StandardTransportOrderService(TCSObjectService objectService,
@GlobalSyncObject Object globalSyncObject,
TCSObjectPool globalObjectPool,
TransportOrderPool orderPool,
Model model) {
super(objectService);
this.globalSyncObject = requireNonNull(globalSyncObject, "globalSyncObject");
this.globalObjectPool = requireNonNull(globalObjectPool, "globalObjectPool");
this.orderPool = requireNonNull(orderPool, "orderPool");
this.model = requireNonNull(model, "model");
}
@Inject
NpcSceneOverlay(final Client client, final NpcIndicatorsPlugin plugin, final NpcIndicatorsConfig config, final ModelOutlineRenderer modelOutliner)
{
this.client = client;
this.plugin = plugin;
this.config = config;
this.modelOutliner = modelOutliner;
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.ABOVE_SCENE);
}
/**
* Creates a new instance.
*
* @param dispatcherService The dispatcher service used to dispatch vehicles.
* @param objectService The object service.
*/
@Inject
public PeriodicVehicleRedispatchingTask(DispatcherService dispatcherService,
TCSObjectService objectService) {
this.dispatcherService = requireNonNull(dispatcherService, "dispatcherService");
this.objectService = requireNonNull(objectService, "objectService");
}
/**
* <p>Constructs new <code>IconFileResource</code> instance. This implementation does nothing.</p>
*/
@Inject
public IconFileResource(UploadedFileDAO uploadedFileDAO,
CustomerDAO customerDAO,
@Named("files.directory") String filesDirectory) {
this.uploadedFileDAO = uploadedFileDAO;
this.customerDAO = customerDAO;
this.filesDirectory = filesDirectory;
}
@Inject
private BlastMineRockOverlay(final Client client, final BlastMinePlugin plugin, final BlastMinePluginConfig config, final ItemManager itemManager)
{
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.ABOVE_SCENE);
this.client = client;
this.plugin = plugin;
this.config = config;
chiselIcon = itemManager.getImage(ItemID.CHISEL);
dynamiteIcon = itemManager.getImage(ItemID.DYNAMITE);
tinderboxIcon = itemManager.getImage(ItemID.TINDERBOX);
}
@Inject
public PendingWillMessages(@NotNull final InternalPublishService publishService,
@Persistence final ListeningScheduledExecutorService executorService,
@NotNull final ClientSessionPersistence clientSessionPersistence,
@NotNull final ClientSessionLocalPersistence clientSessionLocalPersistence) {
this.publishService = publishService;
this.executorService = executorService;
this.clientSessionPersistence = clientSessionPersistence;
this.clientSessionLocalPersistence = clientSessionLocalPersistence;
executorService.scheduleAtFixedRate(new CheckWillsTask(), WILL_DELAY_CHECK_SCHEDULE, WILL_DELAY_CHECK_SCHEDULE, TimeUnit.SECONDS);
}
@Inject
public DisconnectHandler(final EventLog eventLog, final MetricsHolder metricsHolder, final TopicAliasLimiter topicAliasLimiter) {
this.eventLog = eventLog;
this.metricsHolder = metricsHolder;
this.topicAliasLimiter = topicAliasLimiter;
this.logClientReasonString = InternalConfigurations.LOG_CLIENT_REASON_STRING_ON_DISCONNECT;
}
@Inject
ClientQueueMemoryLocalPersistence(
final @NotNull PublishPayloadPersistence payloadPersistence,
final @NotNull MessageDroppedService messageDroppedService,
final @NotNull MetricRegistry metricRegistry) {
retainedMessageMax = InternalConfigurations.RETAINED_MESSAGE_QUEUE_SIZE.get();
qos0ClientMemoryLimit = InternalConfigurations.QOS_0_MEMORY_LIMIT_PER_CLIENT.get();
final int bucketCount = InternalConfigurations.PERSISTENCE_BUCKET_COUNT.get();
this.messageDroppedService = messageDroppedService;
this.payloadPersistence = payloadPersistence;
this.qos0MemoryLimit = getQos0MemoryLimit();
//must be concurrent as it is not protected by bucket access
this.clientQos0MemoryMap = new ConcurrentHashMap<>();
this.totalMemorySize = new AtomicLong();
this.qos0MessagesMemory = new AtomicLong();
//noinspection unchecked
this.qos12MessageBuckets = new HashMap[bucketCount];
//noinspection unchecked
this.qos0MessageBuckets = new HashMap[bucketCount];
//noinspection unchecked
this.queueSizeBuckets = new HashMap[bucketCount];
//noinspection unchecked
this.retainedQueueSizeBuckets = new HashMap[bucketCount];
for (int i = 0; i < bucketCount; i++) {
qos12MessageBuckets[i] = new HashMap<>();
qos0MessageBuckets[i] = new HashMap<>();
queueSizeBuckets[i] = new HashMap<>();
retainedQueueSizeBuckets[i] = new HashMap<>();
}
metricRegistry.register(
HiveMQMetrics.QUEUED_MESSAGES_MEMORY_PERSISTENCE_TOTAL_SIZE.name(),
(Gauge<Long>) totalMemorySize::get);
}
@Inject
public ThriftIndexProvider(DriftClient<PrestoThriftService> client, ThriftHeaderProvider thriftHeaderProvider, ThriftConnectorStats stats, ThriftConnectorConfig config)
{
this.client = requireNonNull(client, "client is null");
this.thriftHeaderProvider = requireNonNull(thriftHeaderProvider, "thriftHeaderProvider is null");
this.stats = requireNonNull(stats, "stats is null");
requireNonNull(config, "config is null");
this.maxBytesPerResponse = config.getMaxResponseSize().toBytes();
this.lookupRequestsConcurrency = config.getLookupRequestsConcurrency();
}
/**
* Creates a new instance.
*
* @param model The model corresponding to this graphical object.
* @param textGenerator The tool tip text generator.
*/
@Inject
public PathConnection(@Assisted PathModel model,
ToolTipTextGenerator textGenerator) {
super(model);
this.textGenerator = requireNonNull(textGenerator, "textGenerator");
resetPath();
}
@Inject
public IndexLookup(Connector connector, ColumnCardinalityCache cardinalityCache)
{
this.connector = requireNonNull(connector, "connector is null");
this.cardinalityCache = requireNonNull(cardinalityCache, "cardinalityCache is null");
// Create a bounded executor with a pool size at 4x number of processors
this.coreExecutor = newCachedThreadPool(daemonThreadsNamed("cardinality-lookup-%s"));
this.executorService = new BoundedExecutor(coreExecutor, 4 * Runtime.getRuntime().availableProcessors());
}