Configuration config, GeoServer gs, FeatureTypeSchemaBuilder schemaBuilder) {
MutablePicoContainer context = config.getContext();
//seed the cache with entries from the catalog
FeatureTypeCache featureTypeCache = new FeatureTypeCache();
Collection featureTypes = gs.getCatalog().getFeatureTypes();
for (Iterator f = featureTypes.iterator(); f.hasNext();) {
FeatureTypeInfo meta = (FeatureTypeInfo) f.next();
if ( !meta.enabled() ) {
continue;
}
FeatureType featureType = null;
try {
featureType = meta.getFeatureType();
}
catch(Exception e) {
throw new RuntimeException(e);
}
featureTypeCache.put(featureType);
}
//add the wfs handler factory to handle feature elements
context.registerComponentInstance(featureTypeCache);
context.registerComponentInstance(new WFSHandlerFactory(gs.getCatalog(), schemaBuilder));