• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Util类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.infinispan.commons.util.Util的典型用法代码示例。如果您正苦于以下问题:Java Util类的具体用法?Java Util怎么用?Java Util使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Util类属于org.infinispan.commons.util包,在下文中一共展示了Util类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doPreSetup

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
protected void doPreSetup() throws IOException {
    ConfigurationBuilder builder = new ConfigurationBuilder()
        .addServer()
            .host("localhost")
            .port(11222)
        .marshaller(new ProtoStreamMarshaller());

    manager = new RemoteCacheManager(builder.build());

    RemoteCache<String, String> metadataCache = manager
            .getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
    metadataCache
            .put("sample_bank_account/bank.proto",
                    Util.read(InfinispanRemoteQueryProducerIT.class
                            .getResourceAsStream("/sample_bank_account/bank.proto")));
    MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller
            .getSerializationContext(manager));

    SerializationContext serCtx = ProtoStreamMarshaller
            .getSerializationContext(manager);
    serCtx.registerProtoFiles(FileDescriptorSource
            .fromResources("/sample_bank_account/bank.proto"));
    serCtx.registerMarshaller(new UserMarshaller());
    serCtx.registerMarshaller(new GenderMarshaller());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:27,代码来源:InfinispanRemoteQueryProducerIT.java


示例2: newDbFactory

import org.infinispan.commons.util.Util; //导入依赖的package包/类
protected DBFactory newDbFactory() {
   switch (configuration.implementationType()) {
      case JNI: {
         return Util.getInstance(JNI_DB_FACTORY_CLASS_NAME, LevelDBStore.class.getClassLoader());
      }
      case JAVA: {
         return Util.getInstance(JAVA_DB_FACTORY_CLASS_NAME, LevelDBStore.class.getClassLoader());
      }
      default: {
         for (String className : DB_FACTORY_CLASS_NAMES) {
            try {
               return Util.getInstance(className, LevelDBStore.class.getClassLoader());
            } catch (Throwable e) {
               if (log.isDebugEnabled())
                  log.debugUnableToInstantiateDbFactory(className, e);
            }
         }
      }
   }
   return null;
}
 
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:22,代码来源:LevelDBStore.java


示例3: loadProperties

import org.infinispan.commons.util.Util; //导入依赖的package包/类
public void loadProperties(String configFile) throws IOException {
    ClassLoader cl = Thread.currentThread().getContextClassLoader();

    InputStream stream = cl.getResourceAsStream(configFile);

    if (stream == null) {
        System.err.println("Can't Found configFile=" + configFile);
    } else {
        try {
            properties.load(stream);
        } finally {
            Util.close(stream);
        }
    }
}
 
开发者ID:opennaru-dev,项目名称:khan-session,代码行数:16,代码来源:RedisConfigurationProperties.java


示例4: doPreSetup

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
protected void doPreSetup() throws IOException {
    ConfigurationBuilder builder = new ConfigurationBuilder()
        .addServer()
        .host("localhost")
        .port(11222)
        .marshaller(new ProtoStreamMarshaller());

    manager = new RemoteCacheManager(builder.build());

    RemoteCache<String, String> metadataCache = manager.getCache(
        ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
    metadataCache.put(
        "sample_bank_account/bank.proto",
        Util.read(InfinispanContinuousQueryIT.class.getResourceAsStream("/sample_bank_account/bank.proto")));

    MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(manager));

    SerializationContext serCtx = ProtoStreamMarshaller.getSerializationContext(manager);
    serCtx.registerProtoFiles(FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"));
    serCtx.registerMarshaller(new UserMarshaller());
    serCtx.registerMarshaller(new GenderMarshaller());

    // pre-load data
    cache = manager.getCache("remote_query");
    cache.clear();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:28,代码来源:InfinispanContinuousQueryIT.java


示例5: initialize

import org.infinispan.commons.util.Util; //导入依赖的package包/类
/**
 * 초기화 함수, 설정파일을 읽어서 캐시를 초기화한다.
 *
 * @param configFile
 * @param cacheName
 * @param loginCacheName
 * @throws IOException
 */
@Override
public void initialize(String configFile, String cacheName, String loginCacheName)
        throws IOException {
    StringUtils.isNotNull("configFile", configFile);

    Configuration configuration = null;
    ConfigurationBuilder builder = new ConfigurationBuilder();
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    builder.classLoader(cl);

    InputStream stream = cl.getResourceAsStream(configFile);

    if (stream == null) {
        logger.error("Can't Found configFile=" + configFile);
    } else {
        try {
            builder.withProperties(loadFromStream(stream));
        } finally {
            Util.close(stream);
        }
    }
    configuration = builder.build();


    cacheManager = new RemoteCacheManager(configuration);

    cache = cacheManager.getCache(cacheName);
    loginCache = cacheManager.getCache(loginCacheName);

    waitForConnectionReady();
}
 
开发者ID:opennaru-dev,项目名称:khan-session,代码行数:40,代码来源:InfinispanHotRodImpl.java


示例6: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends HAKieSessionDeltaFact>> getTypeClasses() {
    return Util.asSet(HAKieSessionDeltaFact.class);
}
 
开发者ID:redhat-italy,项目名称:hacep,代码行数:5,代码来源:HAKieSessionDeltaFact.java


示例7: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends HAKieSessionDeltaEmpty>> getTypeClasses() {
    return Util.asSet(HAKieSessionDeltaEmpty.class);
}
 
开发者ID:redhat-italy,项目名称:hacep,代码行数:5,代码来源:HAKieSessionDeltaEmpty.java


示例8: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends LargeValue>> getTypeClasses() {
    return Util.<Class<? extends LargeValue>>asSet(LargeValue.class);
}
 
开发者ID:redhat-italy,项目名称:jdg-quickstarts,代码行数:5,代码来源:LargeValue.java


示例9: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends SimpleValue>> getTypeClasses() {
    return Util.<Class<? extends SimpleValue>>asSet(SimpleValue.class);
}
 
开发者ID:redhat-italy,项目名称:jdg-quickstarts,代码行数:5,代码来源:SimpleValue.java


示例10: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends KiWiStringLiteral>> getTypeClasses() {
    return Util.<Class<? extends KiWiStringLiteral>>asSet(KiWiStringLiteral.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:5,代码来源:StringLiteralExternalizer.java


示例11: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends KiWiIntLiteral>> getTypeClasses() {
    return Util.<Class<? extends KiWiIntLiteral>>asSet(KiWiIntLiteral.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:5,代码来源:IntLiteralExternalizer.java


示例12: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends KiWiDateLiteral>> getTypeClasses() {
    return Util.<Class<? extends KiWiDateLiteral>>asSet(KiWiDateLiteral.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:5,代码来源:DateLiteralExternalizer.java


示例13: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends KiWiAnonResource>> getTypeClasses() {
    return Util.<Class<? extends KiWiAnonResource>>asSet(KiWiAnonResource.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:5,代码来源:BNodeExternalizer.java


示例14: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends KiWiBooleanLiteral>> getTypeClasses() {
    return Util.<Class<? extends KiWiBooleanLiteral>>asSet(KiWiBooleanLiteral.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:5,代码来源:BooleanLiteralExternalizer.java


示例15: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends KiWiUriResource>> getTypeClasses() {
    return Util.<Class<? extends KiWiUriResource>>asSet(KiWiUriResource.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:5,代码来源:UriExternalizer.java


示例16: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends KiWiDoubleLiteral>> getTypeClasses() {
    return Util.<Class<? extends KiWiDoubleLiteral>>asSet(KiWiDoubleLiteral.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:5,代码来源:DoubleLiteralExternalizer.java


示例17: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public Set<Class<? extends KiWiTriple>> getTypeClasses() {
    return Util.<Class<? extends KiWiTriple>>asSet(KiWiTriple.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:5,代码来源:TripleExternalizer.java


示例18: start

import org.infinispan.commons.util.Util; //导入依赖的package包/类
@Override
public void start() {
   key2StringMapper = Util.getInstance(configuration.key2StringMapper(), initializationContext.getCache()
         .getAdvancedCache().getClassLoader());
   key2StringMapper.setMarshaller(initializationContext.getMarshaller());

   ContextBuilder contextBuilder = ContextBuilder.newBuilder(configuration.provider()).credentials(configuration.identity(), configuration.credential());
   if(configuration.overrides() != null)
      contextBuilder.overrides(configuration.overrides());
   if(configuration.endpoint() != null && !configuration.endpoint().isEmpty())
      contextBuilder.endpoint(configuration.endpoint());

   blobStoreContext = contextBuilder.buildView(BlobStoreContext.class);

   blobStore = blobStoreContext.getBlobStore();
   String cacheName = configuration.normalizeCacheNames() ? 
         initializationContext.getCache().getName().replaceAll("[^a-zA-Z0-9-]", "-") 
         : initializationContext.getCache().getName();
   containerName = String.format("%s-%s", configuration.container(), cacheName);

   if (!blobStore.containerExists(containerName)) {
      Location location = null;
      if (configuration.location() != null ) {
         location = new LocationBuilder()
            .scope(LocationScope.REGION)
            .id(configuration.location())
            .description(String.format("Infinispan cache store for %s", containerName))
            .build();
      }
      blobStore.createContainerInLocation(location, containerName);

      //make sure container is created
      if(!blobStore.containerExists(containerName)) {
         try {
            log.waitingForContainer();
            TimeUnit.SECONDS.sleep(10);
         } catch (InterruptedException e) {
            throw new PersistenceException(String.format("Aborted when creating blob container %s", containerName));
         }
         if(!blobStore.containerExists(containerName)) {
            throw new PersistenceException(String.format("Unable to create blob container %s", containerName));
         }
      }
   }
}
 
开发者ID:infinispan,项目名称:infinispan-cachestore-cloud,代码行数:46,代码来源:CloudStore.java


示例19: getTypeClasses

import org.infinispan.commons.util.Util; //导入依赖的package包/类
/**
 * Returns a collection of Class instances representing the types that this
 * AdvancedExternalizer can marshall.  Clearly, empty sets are not allowed.
 * The externalizer framework currently requires all individual types to be
 * listed since it does not make assumptions based on super classes or
 * interfaces.
 *
 * @return A set containing the Class instances that can be marshalled.
 */
@Override
public Set<Class<? extends TreeModel>> getTypeClasses() {
    return Util.<Class<? extends TreeModel>>asSet(TreeModel.class);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:14,代码来源:ModelExternalizer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UserInfoSuccessResponse类代码示例发布时间:2022-05-23
下一篇:
Java JAnnotationUse类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap