use of org.eclipse.wst.server.core.model.ModuleDelegate in project webtools.servertools by eclipse.
the class ModulePublishInfo method fillCache.
/**
* Fill the module cache.
*
* @param module
*/
private void fillCache(IModule[] module) {
if (!useCache)
return;
if (currentResources != null)
return;
try {
long time = System.currentTimeMillis();
IModule m = module[module.length - 1];
ModuleDelegate pm = (ModuleDelegate) m.loadAdapter(ModuleDelegate.class, null);
if (pm == null || (m.getProject() != null && !m.getProject().isAccessible()))
currentResources = EMPTY_MODULE_RESOURCE;
else
currentResources = pm.members();
delta = ServerPublishInfo.getDelta(resources, currentResources);
hasDelta = (delta != null && delta.length > 0);
if (Trace.PERFORMANCE) {
Trace.trace(Trace.STRING_PERFORMANCE, "Filling publish cache for " + m.getName() + ": " + (System.currentTimeMillis() - time));
}
} catch (CoreException ce) {
if (Trace.WARNING) {
Trace.trace(Trace.STRING_WARNING, "Couldn't fill publish cache for " + module);
}
}
if (delta == null)
delta = EMPTY_MODULE_RESOURCE_DELTA;
}
use of org.eclipse.wst.server.core.model.ModuleDelegate in project webtools.servertools by eclipse.
the class ModulePublishInfo method fill.
public void fill(IModule[] module) {
if (module == null)
return;
if (useCache) {
fillCache(module);
setResources(currentResources);
return;
}
IModule m = module[module.length - 1];
ModuleDelegate pm = (ModuleDelegate) m.loadAdapter(ModuleDelegate.class, null);
if (pm == null || (m.getProject() != null && !m.getProject().isAccessible())) {
setResources(EMPTY_MODULE_RESOURCE);
return;
}
try {
setResources(pm.members());
} catch (CoreException ce) {
if (Trace.WARNING) {
Trace.trace(Trace.STRING_WARNING, "Possible failure in fill", ce);
}
}
}
Aggregations