当前位置: 首页>>代码示例>>Java>>正文


Java Named类代码示例

本文整理汇总了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);
}
 
开发者ID:hristo-vrigazov,项目名称:bromium,代码行数:18,代码来源:DefaultModule.java

示例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();
}
 
开发者ID:quqiangsheng,项目名称:abhot,代码行数:18,代码来源:KairosDatastore.java

示例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;
}
 
开发者ID:Atypon-OpenSource,项目名称:wayf-cloud,代码行数:12,代码来源:WayfGuiceModule.java

示例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);
    }
}
 
开发者ID:MineboxOS,项目名称:minebox,代码行数:15,代码来源:LazyEncyptionKeyProvider.java

示例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;
}
 
开发者ID:MineboxOS,项目名称:tools,代码行数:9,代码来源:MetaDataStatus.java

示例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());
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:9,代码来源:TestTreeRegistryImpl.java

示例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.
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:11,代码来源:TesterFacadeImpl.java

示例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();
}
 
开发者ID:ccremer,项目名称:clustercode,代码行数:15,代码来源:TimeConstraint.java

示例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;
}
 
开发者ID:ronbadur,项目名称:maven-artifacts-uploader,代码行数:9,代码来源:XmlTagChanger.java

示例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);
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:9,代码来源:UT2004LockableLocalWorldView.java

示例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);
}
 
开发者ID:quqiangsheng,项目名称:abhot,代码行数:10,代码来源:WebServer.java

示例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();
	}
}
 
开发者ID:quqiangsheng,项目名称:abhot,代码行数:11,代码来源:KairosDatastore.java

示例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;
}
 
开发者ID:t28hub,项目名称:json2java4idea,代码行数:11,代码来源:JavaConverterFactory.java

示例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;
}
 
开发者ID:Atypon-OpenSource,项目名称:wayf-cloud,代码行数:13,代码来源:WayfGuiceModule.java

示例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);
}
 
开发者ID:quqiangsheng,项目名称:abhot,代码行数:13,代码来源:WebServer.java


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