This commit is contained in:
Redkale
2020-07-17 18:21:09 +08:00
parent 47315f188a
commit 714b188560
2 changed files with 2 additions and 1 deletions

View File

@@ -353,7 +353,7 @@ public abstract class NodeServer {
final Class sourceType = sourceType0;
Object source = null;
if (CacheSource.class.isAssignableFrom(sourceType)) { // CacheSource
source = (CacheSource) Sncp.createLocalService(serverClassLoader, resourceName, sourceType, client == null ? null : client.getMessageAgent(), appResFactory, appSncpTranFactory, sncpAddr, null, Sncp.getConf(srcService));
source = Modifier.isFinal(sourceType.getModifiers()) ? sourceType.getConstructor().newInstance() : (CacheSource) Sncp.createLocalService(serverClassLoader, resourceName, sourceType, client == null ? null : client.getMessageAgent(), appResFactory, appSncpTranFactory, sncpAddr, null, Sncp.getConf(srcService));
Type genericType = field.getGenericType();
ParameterizedType pt = (genericType instanceof ParameterizedType) ? (ParameterizedType) genericType : null;
Type valType = pt == null ? null : pt.getActualTypeArguments()[0];

View File

@@ -98,6 +98,7 @@ public class SncpServer extends Server<DLong, SncpContext, SncpRequest, SncpResp
}
public SncpDynServlet addSncpServlet(Service sncpService) {
if (!Sncp.isSncpDyn(sncpService)) return null;
SncpDynServlet sds = new SncpDynServlet(BsonFactory.root().getConvert(), Sncp.getResourceName(sncpService),
Sncp.getResourceType(sncpService), sncpService, maxClassNameLength, maxNameLength);
this.prepare.addServlet(sds, null, Sncp.getConf(sncpService));