mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix circular dependency with @PostConstruct
parent
ec2396d904
commit
ac64aeb2be
|
@ -157,9 +157,8 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
|||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
@DependsOn("rpcHandler")
|
||||
public RpcNotificationService notificationService(RpcHandler rpcHandler) {
|
||||
return new RpcNotificationService(rpcHandler);
|
||||
public RpcNotificationService notificationService() {
|
||||
return new RpcNotificationService();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.List;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
|
@ -83,6 +84,11 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
|||
|
||||
private ConcurrentMap<String, Boolean> webSocketEOFTransportError = new ConcurrentHashMap<>();
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
notificationService.setRpcHandler(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleRequest(Transaction transaction, Request<JsonObject> request) throws Exception {
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class RpcNotificationService {
|
|||
|
||||
private RpcHandler rpcHandler;
|
||||
|
||||
public RpcNotificationService(RpcHandler rpcHandler) {
|
||||
public void setRpcHandler(RpcHandler rpcHandler) {
|
||||
this.rpcHandler = rpcHandler;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue