org.redisson.Redisson.shutdown()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(504)

本文整理了Java中org.redisson.Redisson.shutdown方法的一些代码示例,展示了Redisson.shutdown的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Redisson.shutdown方法的具体详情如下:
包路径:org.redisson.Redisson
类名称:Redisson
方法名:shutdown

Redisson.shutdown介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

@Override
public void close() {
  if (isClosed()) {
    return;
  }
  
  synchronized (cacheManager) {
    if (!isClosed()) {
      if (hasOwnRedisson) {
        redisson.shutdown();
      }
      cacheManager.closeCache(this);
      for (CacheEntryListenerConfiguration<K, V> config : listeners.keySet()) {
        deregisterCacheEntryListener(config);
      }
      
      closed = true;
    }
  }
}

代码示例来源:origin: redisson/redisson

@Override
public void close() {
  if (isClosed()) {
    return;
  }
  
  synchronized (cacheManager) {
    if (!isClosed()) {
      if (hasOwnRedisson) {
        redisson.shutdown();
      }
      cacheManager.closeCache(this);
      for (CacheEntryListenerConfiguration<K, V> config : listeners.keySet()) {
        deregisterCacheEntryListener(config);
      }
      
      closed = true;
    }
  }
}

代码示例来源:origin: redisson/redisson

@Override
public void close() {
  if (isClosed()) {
    return;
  }
  synchronized (cacheProvider) {
    if (!isClosed()) {
      cacheProvider.close(uri, classLoader);
      for (Cache<?, ?> cache : caches.values()) {
        try {
          cache.close();
        } catch (Exception e) {
          // skip
        }
      }
      if (redisson != null) {
        redisson.shutdown();
      }
      closed = true;
    }
  }
}

代码示例来源:origin: redisson/redisson

@Override
public void close() {
  if (isClosed()) {
    return;
  }
  synchronized (cacheProvider) {
    if (!isClosed()) {
      cacheProvider.close(uri, classLoader);
      for (Cache<?, ?> cache : caches.values()) {
        try {
          cache.close();
        } catch (Exception e) {
          // skip
        }
      }
      if (redisson != null) {
        redisson.shutdown();
      }
      closed = true;
    }
  }
}

代码示例来源:origin: redisson/redisson

if (oldManager != null) {
  if (redisson != null) {
    redisson.shutdown();

代码示例来源:origin: redisson/redisson

if (oldManager != null) {
  if (redisson != null) {
    redisson.shutdown();

代码示例来源:origin: Atmosphere/atmosphere-extensions

public void disconnectRedisson() {
  redisson.shutdown();
}

代码示例来源:origin: stackoverflow.com

Redisson redisson = Redisson.create(config);

Lock lock = redisson.getLock("anyLock");
try {
  // unlock automatically after 10 seconds of hold
  lock.lock(10, TimeUnit.SECONDS);

} finally {
  lock.unlock();
}

...

redisson.shutdown();

代码示例来源:origin: stackoverflow.com

Redisson redisson = Redisson.create();

ConcurrentMap<String, SomeObject> map = redisson.getMap("anyMap");

...

redisson.shutdown();

代码示例来源:origin: stackoverflow.com

Redisson redisson = Redisson.create();

RQueue<SomeObject> queue = redisson.getQueue("anyQueue");
queue.add(new SomeObject());
queue.peek();
queue.pool();

...

redisson.shutdown();

代码示例来源:origin: stackoverflow.com

Config config = new Config();
config.addAddress("some.server.com:8291");
Redisson redisson = Redisson.create(config);

Lock lock = redisson.getLock("anyLock");
lock.lock();
try {
  ...
} finally {
  lock.unlock();
}

redisson.shutdown();

代码示例来源:origin: stackoverflow.com

Redisson redisson = Redisson.create();

ConcurrentMap<String, SomeObject> map = redisson.getMap("anyMap");
map.put("123", new SomeObject());
map.putIfAbsent("323", new SomeObject());
map.remove("123");

...

redisson.shutdown();

代码示例来源:origin: stackoverflow.com

Redisson redisson = Redisson.create();

RDeque<SomeObject> queue = redisson.getDeque("anyDeque");
queue.addFirst(new SomeObject());
queue.addLast(new SomeObject());
SomeObject obj = queue.removeFirst();
SomeObject someObj = queue.removeLast();

redisson.shutdown();

代码示例来源:origin: stackoverflow.com

Config config = new Config();
// for single server
config.useSingleServer()
   .setAddress("127.0.0.1:6379");
// or 
// for master/slave servers
config.useSentinelConnection()
   .setMasterName("mymaster")
   .addSentinelAddress("127.0.0.1:26389", "127.0.0.1:26379");

Redisson redisson = Redisson.create(config);

Lock lock = redisson.getLock("anyLock");
try {
  // unlock automatically after 10 seconds of hold
  lock.lock(10, TimeUnit.SECONDS);

} finally {
  lock.unlock();
}

...

redisson.shutdown();

代码示例来源:origin: org.redisson/redisson

@Override
public void close() {
  if (isClosed()) {
    return;
  }
  
  synchronized (cacheManager) {
    if (!isClosed()) {
      if (hasOwnRedisson) {
        redisson.shutdown();
      }
      cacheManager.closeCache(this);
      for (CacheEntryListenerConfiguration<K, V> config : listeners.keySet()) {
        deregisterCacheEntryListener(config);
      }
      
      closed = true;
    }
  }
}

代码示例来源:origin: org.redisson/redisson

if (oldManager != null) {
  if (redisson != null) {
    redisson.shutdown();

代码示例来源:origin: org.redisson/redisson

@Override
public void close() {
  if (isClosed()) {
    return;
  }
  synchronized (cacheProvider) {
    if (!isClosed()) {
      cacheProvider.close(uri, classLoader);
      for (Cache<?, ?> cache : caches.values()) {
        try {
          cache.close();
        } catch (Exception e) {
          // skip
        }
      }
      if (redisson != null) {
        redisson.shutdown();
      }
      closed = true;
    }
  }
}

相关文章