cluster
This commit is contained in:
@@ -1171,9 +1171,11 @@ public final class Application {
|
|||||||
this.resourceFactory.inject(agent);
|
this.resourceFactory.inject(agent);
|
||||||
agent.init(agent.getConfig());
|
agent.init(agent.getConfig());
|
||||||
this.resourceFactory.register(agent.getName(), MessageAgent.class, agent);
|
this.resourceFactory.register(agent.getName(), MessageAgent.class, agent);
|
||||||
|
if (this.clusterAgent == null) {
|
||||||
this.resourceFactory.register(agent.getName(), HttpMessageClient.class, agent.getHttpMessageClient());
|
this.resourceFactory.register(agent.getName(), HttpMessageClient.class, agent.getHttpMessageClient());
|
||||||
//this.resourceFactory.register(agent.getName(), SncpMessageClient.class, agent.getSncpMessageClient()); //不需要给开发者使用
|
//this.resourceFactory.register(agent.getName(), SncpMessageClient.class, agent.getSncpMessageClient()); //不需要给开发者使用
|
||||||
}
|
}
|
||||||
|
}
|
||||||
logger.info("MessageAgent init in " + (System.currentTimeMillis() - s) + " ms");
|
logger.info("MessageAgent init in " + (System.currentTimeMillis() - s) + " ms");
|
||||||
}
|
}
|
||||||
//------------------------------------ 注册 ResourceProducer MessageProducer ------------------------------------
|
//------------------------------------ 注册 ResourceProducer MessageProducer ------------------------------------
|
||||||
|
|||||||
@@ -171,6 +171,9 @@ public abstract class ClusterAgent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean canRegister(NodeServer ns, String protocol, Service service) {
|
protected boolean canRegister(NodeServer ns, String protocol, Service service) {
|
||||||
|
if (service.getClass().getAnnotation(Component.class) != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if ("SNCP".equalsIgnoreCase(protocol) && service.getClass().getAnnotation(Local.class) != null) {
|
if ("SNCP".equalsIgnoreCase(protocol) && service.getClass().getAnnotation(Local.class) != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user