This commit is contained in:
wentch
2015-12-11 17:44:01 +08:00
parent a44b803e07
commit a920d6c851
3 changed files with 44 additions and 2 deletions

View File

@@ -71,7 +71,7 @@ public final class NodeHttpServer extends NodeServer {
if (rs == null) return;
if (!(src instanceof WebSocketServlet)) return;
String rcname = rs.name();
if (rcname.equals(ResourceFactory.RESOURCE_PARENT_NAME)) rcname = ((WebSocketServlet) src).name();
if (rcname.contains(ResourceFactory.RESOURCE_PARENT_NAME)) rcname = rcname.replace(ResourceFactory.RESOURCE_PARENT_NAME, ((WebSocketServlet) src).name());
synchronized (regFactory) {
Service nodeService = (Service) rf.find(rcname, WebSocketNode.class);
if (nodeService == null) {

View File

@@ -0,0 +1,42 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.redkale.source;
import java.io.*;
/**
*
* @author zhangjx
*/
public interface CacheSource {
default boolean isOpen() {
return true;
}
public boolean exists(final Serializable key);
public <T> T get(final Serializable key);
public <T> T refreshAndGet(final Serializable key);
public void refresh(final Serializable key);
public <T> void set(final Serializable key, final T value);
public <T> void set(final int expireSeconds, final Serializable key, final T value);
public void remove(final Serializable key);
public <V> void appendListItem(final Serializable key, final V value);
public <V> void removeListItem(final Serializable key, final V value);
public <V> void appendSetItem(final Serializable key, final V value);
public <V> void removeSetItem(final Serializable key, final V value);
}

View File

@@ -177,7 +177,7 @@ public final class ResourceFactory {
continue;
}
if (Modifier.isFinal(field.getModifiers())) continue;
final String rcname = (rc.name().equals(RESOURCE_PARENT_NAME) && src instanceof Nameable) ? ((Nameable) src).name() : rc.name();
final String rcname = (rc.name().contains(RESOURCE_PARENT_NAME) && src instanceof Nameable) ? rc.name().replace(RESOURCE_PARENT_NAME, ((Nameable) src).name()) : rc.name();
Object rs = genctype == classtype ? null : find(rcname, genctype);
if (rs == null) {
if (Map.class.isAssignableFrom(classtype)) {