本文整理汇总了Java中org.infinispan.configuration.parsing.XMLExtendedStreamReader类的典型用法代码示例。如果您正苦于以下问题:Java XMLExtendedStreamReader类的具体用法?Java XMLExtendedStreamReader怎么用?Java XMLExtendedStreamReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLExtendedStreamReader类属于org.infinispan.configuration.parsing包,在下文中一共展示了XMLExtendedStreamReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: readElement
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
@Override
public void readElement(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder)
throws XMLStreamException {
ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
Element element = Element.forName(reader.getLocalName());
switch (element) {
case CLOUD_STORE: {
parseCloudStore(reader, builder.persistence(), holder.getClassLoader());
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}
}
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cloud,代码行数:17,代码来源:CloudStoreConfigurationParser.java
示例2: parseCloudStore
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseCloudStore(final XMLExtendedStreamReader reader, PersistenceConfigurationBuilder loadersBuilder,
ClassLoader classLoader) throws XMLStreamException {
CloudStoreConfigurationBuilder builder = new CloudStoreConfigurationBuilder(loadersBuilder);
parseCloudStoreAttributes(reader, builder, classLoader);
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
Element element = Element.forName(reader.getLocalName());
switch (element) {
default: {
Parser.parseStoreElement(reader, builder);
break;
}
}
}
loadersBuilder.addStore(builder);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cloud,代码行数:17,代码来源:CloudStoreConfigurationParser.java
示例3: readElement
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, ConfigurationBuilderHolder configurationBuilderHolder)
throws XMLStreamException {
ConfigurationBuilder builder = configurationBuilderHolder.getCurrentConfigurationBuilder();
Element element = Element.forName(reader.getLocalName());
switch (element) {
case MONGODB_STORE: {
parseMongoDBStore(reader,
builder.persistence());
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}
}
}
开发者ID:infinispan,项目名称:infinispan-cachestore-mongodb,代码行数:18,代码来源:MongoDBCacheStoreConfigurationParser.java
示例4: parseMongoDBStore
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseMongoDBStore(XMLExtendedStreamReader reader, PersistenceConfigurationBuilder persistenceConfigurationBuilder)
throws XMLStreamException {
MongoDBStoreConfigurationBuilder builder = new MongoDBStoreConfigurationBuilder(persistenceConfigurationBuilder);
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
Element element = Element.forName(reader.getLocalName());
switch (element) {
case CONNECTION: {
this.parseConnection(reader, builder);
break;
}
default: {
Parser80.parseStoreElement(reader, builder);
}
}
}
persistenceConfigurationBuilder.addStore(builder);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-mongodb,代码行数:19,代码来源:MongoDBCacheStoreConfigurationParser.java
示例5: parseConnection
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseConnection(XMLExtendedStreamReader reader, MongoDBStoreConfigurationBuilder builder)
throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String value = replaceProperties(reader.getAttributeValue(i));
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case CONNECTION_URI: {
builder.connectionURI(value);
break;
}
case COLLECTION: {
builder.collection(value);
break;
}
default: {
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
ParseUtils.requireNoContent(reader);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-mongodb,代码行数:23,代码来源:MongoDBCacheStoreConfigurationParser.java
示例6: readElement
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
@Override
public void readElement(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder)
throws XMLStreamException {
ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
Element element = Element.forName(reader.getLocalName());
switch (element) {
case CASSANDRA_STORE: {
parseCassandraStore(reader, builder.persistence());
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}
}
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cassandra,代码行数:17,代码来源:CassandraStoreConfigurationParser82.java
示例7: parseCassandraStore
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseCassandraStore(final XMLExtendedStreamReader reader,
PersistenceConfigurationBuilder persistenceBuilder) throws XMLStreamException {
CassandraStoreConfigurationBuilder builder = new CassandraStoreConfigurationBuilder(persistenceBuilder);
parseCassAttributes(reader, builder);
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
Element element = Element.forName(reader.getLocalName());
switch (element) {
case CONNECTION_POOL: {
parseConnectionPool(reader, builder.connectionPool());
break;
}
case CASSANDRA_SERVER: {
parseServer(reader, builder.addServer());
break;
}
default: {
Parser.parseStoreElement(reader, builder);
break;
}
}
}
persistenceBuilder.addStore(builder);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cassandra,代码行数:25,代码来源:CassandraStoreConfigurationParser82.java
示例8: parseConnectionPool
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseConnectionPool(XMLExtendedStreamReader reader, CassandraStoreConnectionPoolConfigurationBuilder builder) throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String value = replaceProperties(reader.getAttributeValue(i));
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case POOL_TIMEOUT_MILLIS: {
builder.poolTimeoutMillis(Integer.parseInt(value));
break;
}
case HEARTBEAT_INTERVAL_SECONDS: {
builder.heartbeatIntervalSeconds(Integer.parseInt(value));
break;
}
case IDLE_TIMEOUT_SECONDS: {
builder.idleTimeoutSeconds(Integer.parseInt(value));
break;
}
default: {
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
ParseUtils.requireNoContent(reader);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cassandra,代码行数:26,代码来源:CassandraStoreConfigurationParser82.java
示例9: parseServer
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseServer(XMLExtendedStreamReader reader, CassandraStoreServerConfigurationBuilder builder)
throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String value = replaceProperties(reader.getAttributeValue(i));
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case HOST:
builder.host(value);
break;
case PORT:
builder.port(Integer.parseInt(value));
break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
ParseUtils.requireNoContent(reader);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cassandra,代码行数:20,代码来源:CassandraStoreConfigurationParser82.java
示例10: parseOffheapCacheStore
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseOffheapCacheStore(XMLExtendedStreamReader reader, OffheapStoreConfigurationBuilder builder) throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String attributeValue = reader.getAttributeValue(i);
String value = StringPropertyReplacer.replaceProperties(attributeValue);
String attrName = reader.getAttributeLocalName(i);
Attribute attribute = Attribute.forName(attrName);
switch (attribute) {
case EXPIRY_QUEUE_SIZE: {
builder.expiryQueueSize(Integer.valueOf(value));
}
case COMPRESSION: {
builder.compression(Boolean.valueOf(value));
break;
}
default: {
Parser60.parseCommonStoreAttributes(reader, builder, attrName, attributeValue, i);
}
}
}
if (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
ParseUtils.unexpectedElement(reader);
}
}
开发者ID:saturnism,项目名称:infinispan-cachestore-offheap,代码行数:27,代码来源:OffheapStoreConfigurationParser60.java
示例11: readElement
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, ConfigurationBuilderHolder holder) throws XMLStreamException {
ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
Element element = Element.forName(reader.getLocalName());
switch (element) {
case LEVELDB_STORE: {
parseLevelDBCacheStore(reader, builder.persistence().addStore(LevelDBStoreConfigurationBuilder.class));
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}
}
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:15,代码来源:LevelDBStoreConfigurationParser60.java
示例12: readElement
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, ConfigurationBuilderHolder holder) throws XMLStreamException {
ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
Element element = Element.forName(reader.getLocalName());
switch (element) {
case MAPDB_STORE: {
parseOffheapCacheStore(reader, builder.persistence().addStore(MapDBStoreConfigurationBuilder.class));
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}
}
}
开发者ID:saturnism,项目名称:infinispan-cachestore-mapdb,代码行数:15,代码来源:MapDBStoreConfigurationParser60.java
示例13: parseOffheapCacheStore
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseOffheapCacheStore(XMLExtendedStreamReader reader, MapDBStoreConfigurationBuilder builder) throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String attributeValue = reader.getAttributeValue(i);
String value = StringPropertyReplacer.replaceProperties(attributeValue);
String attrName = reader.getAttributeLocalName(i);
Attribute attribute = Attribute.forName(attrName);
switch (attribute) {
case EXPIRY_QUEUE_SIZE: {
builder.expiryQueueSize(Integer.valueOf(value));
}
case COMPRESSION: {
builder.compression(Boolean.valueOf(value));
break;
}
case LOCATION: {
builder.location(value);
break;
}
default: {
Parser60.parseCommonStoreAttributes(reader, builder, attrName, attributeValue, i);
}
}
}
if (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
ParseUtils.unexpectedElement(reader);
}
}
开发者ID:saturnism,项目名称:infinispan-cachestore-mapdb,代码行数:31,代码来源:MapDBStoreConfigurationParser60.java
示例14: readElement
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
@Override
public void readElement(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder) throws XMLStreamException {
ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
Element element = Element.forName(reader.getLocalName());
switch (element) {
case HBASE_STORE: {
parseHBaseStore(reader, builder.loaders(), holder.getClassLoader());
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}
}
}
开发者ID:infinispan,项目名称:infinispan-cachestore-hbase,代码行数:16,代码来源:HBaseCacheStoreConfigurationParser53.java
示例15: parseHBaseStore
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseHBaseStore(final XMLExtendedStreamReader reader, LoadersConfigurationBuilder loadersBuilder, ClassLoader classLoader) throws XMLStreamException {
HBaseCacheStoreConfigurationBuilder builder = new HBaseCacheStoreConfigurationBuilder(loadersBuilder);
parseHBaseStoreAttributes(reader, builder);
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
Parser52.parseCommonStoreChildren(reader, builder);
}
loadersBuilder.addStore(builder);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-hbase,代码行数:10,代码来源:HBaseCacheStoreConfigurationParser53.java
示例16: readElement
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, ConfigurationBuilderHolder holder) throws XMLStreamException {
ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
Element element = Element.forName(reader.getLocalName());
switch (element) {
case OFFHEAP_STORE: {
parseOffheapCacheStore(reader, builder.persistence().addStore(OffheapStoreConfigurationBuilder.class));
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}
}
}
开发者ID:saturnism,项目名称:infinispan-cachestore-offheap,代码行数:15,代码来源:OffheapStoreConfigurationParser60.java
示例17: parseCloudStoreAttributes
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseCloudStoreAttributes(XMLExtendedStreamReader reader, CloudStoreConfigurationBuilder builder, ClassLoader classLoader)
throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String value = replaceProperties(reader.getAttributeValue(i));
String attributeName = reader.getAttributeLocalName(i);
Attribute attribute = Attribute.forName(attributeName);
switch (attribute) {
case PROVIDER: {
builder.provider(value);
break;
}
case LOCATION: {
builder.location(value);
break;
}
case IDENTITY: {
builder.identity(value);
break;
}
case CREDENTIAL: {
builder.credential(value);
break;
}
case CONTAINER: {
builder.container(value);
break;
}
case ENDPOINT: {
builder.endpoint(value);
break;
}
case KEY_TO_STRING_MAPPER: {
builder.key2StringMapper(value);
break;
}
case COMPRESS: {
builder.compress(Boolean.parseBoolean(value));
break;
}
case OVERRIDES: {
try {
builder.overrides(parseProperties(value));
} catch(IllegalArgumentException e) {
ParseUtils.invalidAttributeValue(reader, i);
}
break;
}
case NORMALIZE_CACHE_NAMES: {
builder.normalizeCacheNames(Boolean.parseBoolean(value));
break;
}
default: {
Parser.parseStoreAttribute(reader, i, builder);
break;
}
}
}
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cloud,代码行数:60,代码来源:CloudStoreConfigurationParser.java
示例18: parseLevelDBCacheStore
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseLevelDBCacheStore(XMLExtendedStreamReader reader, LevelDBStoreConfigurationBuilder builder) throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String attributeValue = reader.getAttributeValue(i);
String value = StringPropertyReplacer.replaceProperties(attributeValue);
String attrName = reader.getAttributeLocalName(i);
Attribute attribute = Attribute.forName(attrName);
switch (attribute) {
case LOCATION: {
builder.location(value);
break;
}
case EXPIRED_LOCATION: {
builder.expiredLocation(value);
break;
}
case IMPLEMENTATION_TYPE: {
builder.implementationType(LevelDBStoreConfiguration.ImplementationType.valueOf(value));
break;
}
case CLEAR_THRESHOLD: {
builder.clearThreshold(Integer.valueOf(value));
break;
}
case EXPIRY_QUEUE_SIZE: {
builder.expiryQueueSize(Integer.valueOf(value));
}
case BLOCK_SIZE: {
builder.blockSize(Integer.valueOf(value));
break;
}
case CACHE_SIZE: {
builder.cacheSize(Long.valueOf(value));
break;
}
case COMPRESSION_TYPE: {
builder.compressionType(CompressionType.valueOf(value));
break;
}
default: {
Parser60.parseCommonStoreAttributes(reader, builder, attrName, attributeValue, i);
}
}
}
if (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
ParseUtils.unexpectedElement(reader);
}
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:51,代码来源:LevelDBStoreConfigurationParser60.java
示例19: parseCassAttributes
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseCassAttributes(XMLExtendedStreamReader reader, CassandraStoreConfigurationBuilder builder)
throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String value = replaceProperties(reader.getAttributeValue(i));
String attrName = reader.getAttributeLocalName(i);
Attribute attribute = Attribute.forName(attrName);
switch (attribute) {
case AUTO_CREATE_KEYSPACE:
builder.autoCreateKeyspace(Boolean.parseBoolean(value));
break;
case KEYSPACE:
builder.keyspace(value);
break;
case ENTRY_TABLE:
builder.entryTable(value);
break;
case READ_CONSISTENCY_LEVEL:
builder.readConsistencyLevel(ConsistencyLevel.valueOf(value));
break;
case READ_SERIAL_CONSISTENCY_LEVEL:
builder.readSerialConsistencyLevel(ConsistencyLevel.valueOf(value));
break;
case WRITE_CONSISTENCY_LEVEL:
builder.writeConsistencyLevel(ConsistencyLevel.valueOf(value));
break;
case WRITE_SERIAL_CONSISTENCY_LEVEL:
builder.writeSerialConsistencyLevel(ConsistencyLevel.valueOf(value));
break;
case REPLICATION_STRATEGY:
builder.replicationStrategy(value);
break;
case COMPRESSION:
builder.compression(value);
break;
case USE_SSL:
builder.useSsl(Boolean.parseBoolean(value));
break;
case USERNAME:
builder.username(value);
break;
case PASSWORD:
builder.password(value);
break;
default: {
Parser.parseStoreAttribute(reader, i, builder);
break;
}
}
}
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cassandra,代码行数:52,代码来源:CassandraStoreConfigurationParser82.java
示例20: parseHBaseStoreAttributes
import org.infinispan.configuration.parsing.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseHBaseStoreAttributes(XMLExtendedStreamReader reader, HBaseCacheStoreConfigurationBuilder builder) throws XMLStreamException {
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String value = replaceProperties(reader.getAttributeValue(i));
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case AUTO_CREATE_TABLE: {
builder.autoCreateTable(Boolean.parseBoolean(value));
break;
}
case ENTRY_COLUMN_FAMILY: {
builder.entryColumnFamily(value);
break;
}
case ENTRY_TABLE: {
builder.entryTable(value);
break;
}
case ENTRY_VALUE_FIELD: {
builder.entryValueField(value);
break;
}
case EXPIRATION_COLUMN_FAMILY: {
builder.expirationColumnFamily(value);
break;
}
case EXPIRATION_TABLE: {
builder.expirationTable(value);
break;
}
case EXPIRATION_VALUE_FIELD: {
builder.expirationValueField(value);
break;
}
case HBASE_ZOOKEEPER_QUORUM_HOST: {
builder.hbaseZookeeperQuorumHost(value);
break;
}
case HBASE_ZOOKEEPER_CLIENT_PORT: {
builder.hbaseZookeeperClientPort(Integer.parseInt(value));
break;
}
case KEY_MAPPER: {
builder.keyMapper(value);
break;
}
case SHARED_TABLE: {
builder.sharedTable(Boolean.parseBoolean(value));
break;
}
default: {
Parser52.parseCommonStoreAttributes(reader, i, builder);
break;
}
}
}
}
开发者ID:infinispan,项目名称:infinispan-cachestore-hbase,代码行数:58,代码来源:HBaseCacheStoreConfigurationParser53.java
注:本文中的org.infinispan.configuration.parsing.XMLExtendedStreamReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论