Исходный код можно найти на Github здесь:
https://github.com/SabreDevStudio/SACS- ... /README.md
Мне удалось исправить одну, однако я застрял на более сложной циклической зависимости от A -> B -> C до A. Вот три фрагмента кода, вызывающие циклическую зависимость:
Код: Выделить всё
@Service
public class SessionPool {
Код: Выделить всё
@Controller
@Scope("prototype")
public class SessionCreateWrapper extends WebServiceGatewaySupport {
Код: Выделить всё
@Component
@Scope("prototype")
public class SessionCreateInterceptor extends AbstractSessionInterceptor {
Я попытался создать интерфейс менеджера сеансов, чтобы разделить зависимости
Код: Выделить всё
public interface SessionManager {
void addToPool(Security session);
Security getFromPool(SharedContext context);
}
Так что SessionCreateWrapper зависит от SessionManager
SessionCreateInterceptor реализует SessionManager
Код: Выделить всё
But then I get this error:
Parameter 0 of constructor in com.sabre.api.sacs.soap.session.SessionCreateWrapper required a single bean, but 2 were found:
- sessionCreateInterceptor: defined in file [C:\CODE\SACS-Java\soap\target\classes\com\sabre\api\sacs\soap\interceptor\SessionCreateInterceptor.class]
- sessionPool: defined in file [C:\CODE\SACS-Java\soap\target\classes\com\sabre\api\sacs\soap\pool\SessionPool.class]
Код: Выделить всё
workflowTrigger (field private com.sabre.api.sacs.soap.pool.SessionPool com.sabre.api.sacs.flowtrigger.WorkflowTrigger.sessionPool)
┌─────┐
| sessionPool
└─────┘
Подробнее здесь: https://stackoverflow.com/questions/783 ... ot-applica