本文整理汇总了Java中com.google.inject.name.Named类的典型用法代码示例。如果您正苦于以下问题:Java Named类的具体用法?Java Named怎么用?Java Named使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Named类属于com.google.inject.name包,在下文中一共展示了Named类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProxyDriverIntegrator
import com.google.inject.name.Named; //导入依赖的package包/类
private ProxyDriverIntegrator getProxyDriverIntegrator(RequestFilter recordRequestFilter,
WebDriverSupplier webDriverSupplier,
DriverServiceSupplier driverServiceSupplier,
@Named(PATH_TO_DRIVER) String pathToDriverExecutable,
@Named(SCREEN) String screen,
@Named(TIMEOUT) int timeout,
ResponseFilter responseFilter) throws IOException {
BrowserMobProxy proxy = createBrowserMobProxy(timeout, recordRequestFilter, responseFilter);
proxy.start(0);
logger.info("Proxy running on port " + proxy.getPort());
Proxy seleniumProxy = createSeleniumProxy(proxy);
DesiredCapabilities desiredCapabilities = createDesiredCapabilities(seleniumProxy);
DriverService driverService = driverServiceSupplier.getDriverService(pathToDriverExecutable, screen);
WebDriver driver = webDriverSupplier.get(driverService, desiredCapabilities);
return new ProxyDriverIntegrator(driver, proxy, driverService);
}
示例2: KairosDatastore
import com.google.inject.name.Named; //导入依赖的package包/类
@SuppressWarnings("ResultOfMethodCallIgnored")
@Inject
public KairosDatastore(Datastore datastore, QueryQueuingManager queuingManager,
List<DataPointListener> dataPointListeners, KairosDataPointFactory dataPointFactory,
@Named(KEEP_CACHE_FILES) boolean keepCacheFiles)
throws DatastoreException
{
m_datastore = checkNotNull(datastore);
m_dataPointListeners = checkNotNull(dataPointListeners);
m_queuingManager = checkNotNull(queuingManager);
m_dataPointFactory = dataPointFactory;
m_baseCacheDir = System.getProperty("java.io.tmpdir") + "/kairos_cache/";
m_keepCacheFiles = keepCacheFiles;
setupCacheDirectory();
}
示例3: getPublisherSaltLoadingCache
import com.google.inject.name.Named; //导入依赖的package包/类
@Provides
@Named("publisherSaltCache")
@Singleton
public Cache<Long, String> getPublisherSaltLoadingCache(
@Named("publisherSaltRedisCache") LoadingCache<Long, String> publisherSaltRedisCache) {
LoadingCacheGuavaImpl<Long, String> l1Cache = new LoadingCacheGuavaImpl<>();
l1Cache.setGuavaCache(CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.DAYS).build());
l1Cache.setCacheLoader((key) -> publisherSaltRedisCache.get(key));
return l1Cache;
}
示例4: watchParentDirectory
import com.google.inject.name.Named; //导入依赖的package包/类
private void watchParentDirectory(@Named("encryptionKeyPath") String encryptionKeyPath) {
try {
seedFile = Paths.get(encryptionKeyPath);
watchService = FileSystems.getDefault().newWatchService();
final Path parent = seedFile.getParent();
if (!Files.isDirectory(parent)) {
Files.createDirectories(parent);
}
watchKey = parent.register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例5: MetaDataStatusProvider
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject
public MetaDataStatusProvider(
@Named("parentDirs") List<String> parentDir,
SerialNumberService serialNumberService) {
this.parentDirs = parentDir;
this.serialNumberService = serialNumberService;
}
示例6: synchronizedMap
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject
/* default */ TestTreeRegistryImpl(final TestFsmRegistry fsmRegistry,
final @Named(TEST_TREE_TIMEOUT_KEY) long timeout) {
this.fsmRegistry = fsmRegistry;
this.timeout = timeout;
cache = synchronizedMap(newHashMap());
mutex = synchronizedMap(newHashMap());
}
示例7: TesterFacadeImpl
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject
TesterFacadeImpl(final TestFsmRegistry fsmRegistry, final HttpServerManager serverManager,
final InternalTestTreeRegistry treeRegistry, @Named(HTTP_SERVER_PORT_KEY) final int port) {
this.fsmRegistry = fsmRegistry;
this.serverManager = serverManager;
this.treeRegistry = treeRegistry;
this.port = port;
this.actualPort = port; // try with default.
}
示例8: TimeConstraint
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject
protected TimeConstraint(@Named(ConstraintModule.CONSTRAINT_TIME_BEGIN_KEY) String begin,
@Named(ConstraintModule.CONSTRAINT_TIME_STOP_KEY) String stop,
Clock clock) {
this.clock = clock;
try {
this.begin = LocalTime.parse(begin, formatter);
this.stop = LocalTime.parse(stop, formatter);
} catch (DateTimeParseException ex) {
throw new InvalidConfigurationException("The time format is HH:mm. You specified: begin({}), stop({})", ex,
begin, stop);
}
checkConfiguration();
}
示例9: XmlTagChanger
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject
public XmlTagChanger(@Named("tagToChange") String tagToChange,
@Named("oldValue") String tagOldValue,
@Named("newValue") String tagNewValue) {
this.tagToChange = tagToChange;
this.tagOldValue = tagOldValue;
this.tagNewValue = tagNewValue;
}
示例10: UT2004LockableLocalWorldView
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject
public UT2004LockableLocalWorldView(
@Named(WORLDVIEW_DEPENDENCY) ComponentDependencies dependencies,
ILifecycleBus bus, IAgentLogger logger, IMediator mediator,
ISharedWorldView parentWorldView, ITeamedAgentId agentId) {
super(dependencies, bus, logger, parentWorldView, agentId);
mediator.setConsumer(this);
}
示例11: setThreadPool
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject(optional = true)
public void setThreadPool(@Named(JETTY_THREADS_QUEUE_SIZE_PROPERTY) int maxQueueSize,
@Named(JETTY_THREADS_MIN_PROPERTY) int minThreads,
@Named(JETTY_THREADS_MAX_PROPERTY) int maxThreads,
@Named(JETTY_THREADS_KEEP_ALIVE_MS_PROPERTY) long keepAliveMs)
{
LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(maxQueueSize);
m_pool = new ExecutorThreadPool(minThreads, maxThreads, keepAliveMs, TimeUnit.MILLISECONDS, queue);
}
示例12: setBaseCacheDir
import com.google.inject.name.Named; //导入依赖的package包/类
@SuppressWarnings("UnusedDeclaration")
@Inject(optional = true)
public void setBaseCacheDir(@Named(QUERY_CACHE_DIR) String cacheTempDir)
{
if (cacheTempDir != null && !cacheTempDir.equals(""))
{
m_baseCacheDir = cacheTempDir;
setupCacheDirectory();
}
}
示例13: JavaConverterFactory
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject
public JavaConverterFactory(@Nonnull Provider<PsiNameHelper> nameHelperProvider,
@Nonnull @Named("FieldName") Provider<NamePolicy> fieldNamePolicyProvider,
@Nonnull @Named("MethodName") Provider<NamePolicy> methodNamePolicyProvider,
@Nonnull @Named("ParameterName") Provider<NamePolicy> parameterNamePolicyProvider) {
this.nameHelperProvider = nameHelperProvider;
this.fieldNamePolicyProvider = fieldNamePolicyProvider;
this.methodNamePolicyProvider = methodNamePolicyProvider;
this.parameterNamePolicyProvider = parameterNamePolicyProvider;
}
示例14: getLoadingCache
import com.google.inject.name.Named; //导入依赖的package包/类
@Provides
@Named("publisherSaltRedisCache")
@Singleton
public LoadingCache<Long, String> getLoadingCache(
@Named("publisherSaltRedisDao") RedisDao<Long, String> publisherSaltRedisDao,
PublisherDao publisherDao) {
LoadingCacheRedisImpl<Long, String> l2Cache = new LoadingCacheRedisImpl<>();
l2Cache.setRedisDao(publisherSaltRedisDao);
l2Cache.setCacheLoader((key) -> publisherDao.read(key).map((publisher) -> {LOG.debug("found publisher for l3 [{}]", publisher.getSalt());return publisher.getSalt();}));
return l2Cache;
}
示例15: WebServer
import com.google.inject.name.Named; //导入依赖的package包/类
@Inject
public WebServer(@Named(JETTY_ADDRESS_PROPERTY) String address,
@Named(JETTY_PORT_PROPERTY) int port,
@Named(JETTY_WEB_ROOT_PROPERTY) String webRoot)
throws UnknownHostException
{
checkNotNull(webRoot);
m_port = port;
m_webRoot = webRoot;
m_address = InetAddress.getByName(address);
}