This commit is contained in:
wentch
2015-12-17 10:50:22 +08:00
parent a947f147cc
commit a6b627863a

View File

@@ -211,6 +211,16 @@ public abstract class NodeServer {
field.set(src, source); field.set(src, source);
rf.inject(source, self); // rf.inject(source, self); //
((Service) source).init(null); ((Service) source).init(null);
if (getSncpAddress() != null) {
NodeSncpServer sncpServer = null;
for (NodeServer node : application.servers) {
if (node.isSNCP() && getSncpAddress().equals(node.getSncpAddress())) {
sncpServer = (NodeSncpServer) node;
}
}
ServiceWrapper wrapper = new ServiceWrapper(CacheSourceService.class, (Service) source, resourceName, getSncpGroup(), sncpDefaultGroups, null);
sncpServer.getSncpServer().addService(wrapper);
}
} catch (Exception e) { } catch (Exception e) {
logger.log(Level.SEVERE, "DataSource inject error", e); logger.log(Level.SEVERE, "DataSource inject error", e);
} }