if ((resource.getAspects() == null) || (!resource.getAspects().contains(aspectName))) {
Aspect aspect = getAspect(aspectName);
if (aspect == null) {
throw new RegistryException("Couldn't find aspectName '" + aspectName + "'");
}
aspect.associate(resource, this);
resource.addAspect(aspectName);
put(resource.getPath(), resource);
registryContext.getLogWriter().addLog(
resource.getPath(), CurrentSession.getUser(), LogEntry.ASSOCIATE_ASPECT,
aspectName);