/** * Maps application to its mount path. If the mount path already exists or if the application is already mapped to another mount path, * throws an exception * * @param application * @param mountPath */ public void addApplication(Application<ApplicationConfiguration> application) { String mountPath = structureUrl(application.getConfiguration().getBasePath()); String path = getAbsolutePath(mountPath); if (applications.containsKey(path)) { throw new IllegalArgumentException("Mount path - " + mountPath + " already exists. Either change the application base path or override it in container"); } if (applications.containsValue(application)) { throw new IllegalArgumentException("Application - " + application + " is already mounted on a different mount path"); } application.setPath(HttpUtil.createURI(path)); applications.put(path, application); }