import javax.jcr.RepositoryException;
import javax.jcr.Session;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.argeo.api.cms.CmsLog;
import org.argeo.jcr.JcrUtils;
import org.argeo.slc.CategoryNameVersion;
import org.argeo.slc.NameVersion;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
-/** Executes the processes required so that all managed bundles are available. */
+/**
+ * Executes the processes required so that all managed bundles are available.
+ */
public class ProcessDistribution implements Runnable {
- private final static Log log = LogFactory.getLog(ProcessDistribution.class);
+ private final static CmsLog log = CmsLog.getLog(ProcessDistribution.class);
private ArgeoOsgiDistribution osgiDistribution;
private OsgiFactory osgiFactory;
Session javaSession = null;
try {
javaSession = osgiFactory.openJavaSession();
- for (Iterator<? extends NameVersion> it = osgiDistribution
- .nameVersions(); it.hasNext();)
+ for (Iterator<? extends NameVersion> it = osgiDistribution.nameVersions(); it.hasNext();)
processNameVersion(javaSession, it.next());
// Check sources
- for (Iterator<? extends NameVersion> it = osgiDistribution
- .nameVersions(); it.hasNext();) {
+ for (Iterator<? extends NameVersion> it = osgiDistribution.nameVersions(); it.hasNext();) {
CategoryNameVersion nv = (CategoryNameVersion) it.next();
- Artifact artifact = new DefaultArtifact(nv.getCategory(),
- nv.getName() + ".source", "jar", nv.getVersion());
+ Artifact artifact = new DefaultArtifact(nv.getCategory(), nv.getName() + ".source", "jar",
+ nv.getVersion());
String path = MavenConventionsUtils.artifactPath("/", artifact);
if (!javaSession.itemExists(path))
log.warn("No source available for " + nv);
// explicitly create the corresponding modular distribution as we
// have here all necessary info.
- ModularDistributionFactory mdf = new ModularDistributionFactory(
- osgiFactory, osgiDistribution);
+ ModularDistributionFactory mdf = new ModularDistributionFactory(osgiFactory, osgiDistribution);
mdf.run();
} catch (RepositoryException e) {
- throw new SlcException("Cannot process distribution "
- + osgiDistribution, e);
+ throw new SlcException("Cannot process distribution " + osgiDistribution, e);
} finally {
JcrUtils.logoutQuietly(javaSession);
}
}
- protected void processNameVersion(Session javaSession,
- NameVersion nameVersion) throws RepositoryException {
+ protected void processNameVersion(Session javaSession, NameVersion nameVersion) throws RepositoryException {
if (log.isTraceEnabled())
log.trace("Check " + nameVersion + "...");
if (!(nameVersion instanceof CategoryNameVersion))
throw new SlcException("Unsupported type " + nameVersion.getClass());
CategoryNameVersion nv = (CategoryNameVersion) nameVersion;
- Artifact artifact = new DefaultArtifact(nv.getCategory(), nv.getName(),
- "jar", nv.getVersion());
+ Artifact artifact = new DefaultArtifact(nv.getCategory(), nv.getName(), "jar", nv.getVersion());
String path = MavenConventionsUtils.artifactPath("/", artifact);
if (!javaSession.itemExists(path)) {
if (nv instanceof BndWrapper) {