CacheControlConstraints defaultRemoteCacheControlConstraints =
createRemoteCacheControlConstraints();
// Create the policy cache.
PolicyCache policyCache = createPolicyCache(
defaultRemoteCacheControlConstraints);
RemoteReadersFactory remoteReadersFactory =
createRemoteReadersFactory();
// Create the ProjectManager.
ProjectLoader projectLoader = createProjectLoader();
RepositoryContainer repositoryContainer =
new RepositoryContainer(jdbcRepository, xmlRepository);
// Create the remote project specific constraints.
CacheControlConstraintsMap defaultRemoteCacheControlConstraintsMap
= createRemoteCacheControlConstraintsMap(
defaultRemoteCacheControlConstraints);
// Create the local project specific constraints.
CacheControlConstraintsMap defaultLocalCacheControlConstraintsMap
= createLocalCacheControlConstraintsMap();
PopulatableProjectManager projectManager =
new ProjectManagerImpl(projectLoader,
new RuntimeProjectConfiguratorImpl(
defaultLocalCacheControlConstraintsMap,
defaultRemoteCacheControlConstraintsMap,
pathURLMapper, policyCache),
repositoryContainer,
remoteReadersFactory);
// Create the activator.
PolicyReferenceFactory referenceFactory =
new PolicyReferenceFactoryImpl(projectManager);
PolicyActivator policyActivator =
initializeRepositoryObjectActivators(referenceFactory);
// Create the retriever to use to retrieve activated policies from
// any source.
RuntimePolicyFactory runtimePolicyFactory =
RuntimePolicyFactory.getDefaultInstance();
ActivatedPolicyRetriever activatedPolicyRetriever =
runtimePolicyFactory.createCachingRetriever(
policyActivator, projectManager, policyCache);
policyFetcher = new PolicyFetcherImpl(activatedPolicyRetriever);
// Initialize the projects
projectManager.createPredefinedProjects(projects, configContext,
defaultLocalCacheControlConstraintsMap,
policyCache.getLocalDefaultGroup());
RuntimeProject defaultProject = projectManager.getDefaultProject();
// Determine the repository within which the default project
// resides.
LocalRepository defaultRepository;