本文整理了Java中org.infinispan.commons.configuration.attributes.AttributeSet.attribute()
方法的一些代码示例,展示了AttributeSet.attribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AttributeSet.attribute()
方法的具体详情如下:
包路径:org.infinispan.commons.configuration.attributes.AttributeSet
类名称:AttributeSet
方法名:attribute
[英]Returns the named attribute
[中]返回命名属性
代码示例来源:origin: wildfly/wildfly
public HotRodStoreConfigurationBuilder cacheConfiguration(String cacheConfiguration) {
this.attributes.attribute(CACHE_CONFIGURATION).set(cacheConfiguration);
return this;
}
代码示例来源:origin: wildfly/wildfly
@Override
public void init(InitializationContext ctx) {
this.ctx = ctx;
HotRodStoreConfiguration configuration = ctx.getConfiguration();
RemoteCacheContainer remoteCacheContainer = configuration.attributes().attribute(HotRodStoreConfiguration.REMOTE_CACHE_CONTAINER).get();
String cacheConfiguration = configuration.attributes().attribute(HotRodStoreConfiguration.CACHE_CONFIGURATION).get();
String cacheName = ctx.getCache().getName();
try {
ProtocolVersion protocolVersion = remoteCacheContainer.getConfiguration().version();
// Administration support was introduced in protocol version 2.7
if (protocolVersion.compareTo(ProtocolVersion.PROTOCOL_VERSION_27) < 0) {
this.remoteCache = remoteCacheContainer.getCache(cacheName, false);
if (this.remoteCache == null) {
throw InfinispanLogger.ROOT_LOGGER.remoteCacheMustBeDefined(protocolVersion.toString(), cacheName);
}
} else {
InfinispanLogger.ROOT_LOGGER.remoteCacheCreated(cacheName, cacheConfiguration);
this.remoteCache = remoteCacheContainer.administration().getOrCreateCache(cacheName, cacheConfiguration);
}
} catch (HotRodClientException ex) {
throw new PersistenceException(ex);
}
}
代码示例来源:origin: org.infinispan/infinispan-persistence-soft-index
@Override
public SoftIndexFileStoreConfiguration newConfigurationFrom(int segment) {
AttributeSet set = SoftIndexFileStoreConfiguration.attributeDefinitionSet();
set.read(attributes);
String dataLocation = set.attribute(DATA_LOCATION).get();
set.attribute(DATA_LOCATION).set(fileLocationTransform(dataLocation, segment));
String indexLocation = set.attribute(INDEX_LOCATION).get();
set.attribute(INDEX_LOCATION).set(fileLocationTransform(indexLocation, segment));
return new SoftIndexFileStoreConfiguration(set.protect(), async(), singletonStore());
}
代码示例来源:origin: wildfly/wildfly
public HotRodStoreConfigurationBuilder remoteCacheContainer(RemoteCacheContainer remoteCacheContainer) {
this.attributes.attribute(REMOTE_CACHE_CONTAINER).set(remoteCacheContainer);
return this;
}
代码示例来源:origin: org.infinispan/infinispan-lucene-directory
/**
* When the segment size is larger than this number of bytes, separate segments will be created
* of this particular size.
*
* @return the segmentation size.
*/
public int autoChunkSize() {
return attributes.attribute(AUTO_CHUNK_SIZE).get();
}
代码示例来源:origin: org.infinispan/infinispan-commons
protected AbstractTypedPropertiesConfiguration(AttributeSet attributes) {
this.attributes = attributes.checkProtection();
this.properties = this.attributes.attribute(PROPERTIES);
if (properties.isModified()) {
properties.set(immutableTypedProperties(properties.get()));
}
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
/**
* Sets the external port of this node, i.e. the port which clients will connect to
*/
@Override
public HotRodServerConfigurationBuilder proxyPort(int proxyPort) {
attributes.attribute(PROXY_PORT).set(proxyPort);
return this;
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
/**
* When the segment size is larger than this number of bytes, separate segments will be created
* of this particular size.
*
* @return the segmentation size.
*/
public int autoChunkSize() {
return attributes.attribute(AUTO_CHUNK_SIZE).get();
}
代码示例来源:origin: org.infinispan/infinispan-commons
@Test
public void testDefaultAttributeCopy() {
AttributeDefinition<Boolean> def = AttributeDefinition.builder("test", false).build();
AttributeSet set1 = new AttributeSet("set", def);
set1.attribute(def).set(true);
AttributeSet set2 = new AttributeSet("set", def);
set2.read(set1);
assertEquals(set1.attribute(def).get(), set2.attribute(def).get());
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
/**
* Configures whether to enable waiting for initial state transfer for the topology cache. See {@link
* StateTransferConfigurationBuilder#awaitInitialTransfer(boolean)}
*/
@Override
public HotRodServerConfigurationBuilder topologyAwaitInitialTransfer(boolean topologyAwaitInitialTransfer) {
attributes.attribute(TOPOLOGY_AWAIT_INITIAL_TRANSFER).set(topologyAwaitInitialTransfer);
return this;
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
/**
* When Index Affinity is enabled, this returns the segment id to which the current index is bound to.
*/
public int affinitySegmentId() {
return attributes.attribute(AFFINITY_SEGMENT_ID).get();
}
代码示例来源:origin: org.infinispan/infinispan-core
@Override
public DummyInMemoryStoreConfiguration newConfigurationFrom(int segment) {
AttributeSet set = DummyInMemoryStoreConfiguration.attributeDefinitionSet();
set.read(attributes);
String storeName = set.attribute(STORE_NAME).get();
if (storeName != null) {
set.attribute(STORE_NAME).set(storeName + "-" + segment);
}
return new DummyInMemoryStoreConfiguration(set.protect(), async(), singletonStore());
}
代码示例来源:origin: org.infinispan/infinispan-cachestore-rest
@Override
public RestStoreConfigurationBuilder path(String path) {
attributes.attribute(PATH).set(path);
return this;
}
代码示例来源:origin: org.infinispan/infinispan-lucene-directory
/**
* The location of the root directory of the index.
*
* @return the index location root directory.
*/
public String location() {
return attributes.attribute(LOCATION).get();
}
代码示例来源:origin: org.infinispan/infinispan-cachestore-rest
@Override
public RestStoreConfigurationBuilder maxContentLength(int maxContentLength) {
attributes.attribute(MAX_CONTENT_LENGTH).set(maxContentLength);
return this;
}
代码示例来源:origin: org.infinispan/infinispan-lucene-directory
/**
* When Index Affinity is enabled, this returns the segment id to which the current index is bound to.
*/
public int affinitySegmentId() {
return attributes.attribute(AFFINITY_SEGMENT_ID).get();
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
/**
* Path to the root directory containing all indexes. Indexes are loaded from the immediate subdirectories
* of specified path, and each such subdirectory name will be the index name that must match the name
* parameter of a Directory constructor.
*
* @param location path to the root directory of all indexes
* @return this for method chaining
*/
public LuceneLoaderConfigurationBuilder location(String location) {
attributes.attribute(LOCATION).set(location);
return this;
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
/**
* The location of the root directory of the index.
*
* @return the index location root directory.
*/
public String location() {
return attributes.attribute(LOCATION).get();
}
代码示例来源:origin: org.infinispan/infinispan-clustered-lock
/**
* Sets the {@link Reliability} mode.
* <p>
* Default value is {@link Reliability#AVAILABLE}.
*
* @param reliability the {@link Reliability} mode.
* @see Reliability
*/
public ClusteredLockManagerConfigurationBuilder reliability(Reliability reliability) {
attributes.attribute(ClusteredLockManagerConfiguration.RELIABILITY).set(reliability);
return this;
}
代码示例来源:origin: org.infinispan/infinispan-cachestore-rest
@Override
public void validate() {
this.connectionPool.validate();
if (attributes.attribute(HOST).get() == null) {
throw log.hostNotSpecified();
}
String path = attributes.attribute(PATH).get();
if (!path.endsWith("/")) {
path(path + "/");
}
}
}
内容来源于网络,如有侵权,请联系作者删除!