Set<VirtualFile> overlayVirtualFiles = warMetaData.getOverlays();
if (overlayVirtualFiles != null) {
if (context.getResources() instanceof ProxyDirContext) {
ProxyDirContext resources = (ProxyDirContext) context.getResources();
for (VirtualFile overlay : overlayVirtualFiles) {
VFSDirContext dirContext = new VFSDirContext();
dirContext.setVirtualFile(overlay);
resources.addOverlay(dirContext);
}
} else if (overlayVirtualFiles.size() > 0) {
// Error, overlays need a ProxyDirContext to compose results
WebLogger.WEB_LOGGER.noOverlay(context.getName());
ok = false;
}
}
// Add other overlays, if any
for (String overlay : overlays) {
if (context.getResources() instanceof ProxyDirContext) {
ProxyDirContext resources = (ProxyDirContext) context.getResources();
FileDirContext dirContext = new FileDirContext();
dirContext.setDocBase(overlay);
resources.addOverlay(dirContext);
}
} // Invoke ServletContainerInitializer
final ScisMetaData scisMetaData = deploymentUnitContext.getAttachment(ScisMetaData.ATTACHMENT_KEY);
if (scisMetaData != null) {