Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Export artifact(gav,asName) via Swarm.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmcwhirter committed Nov 18, 2015
1 parent 7500db5 commit cbd9e2d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions container/api/src/main/java/org/wildfly/swarm/Swarm.java
Expand Up @@ -15,6 +15,7 @@
*/
package org.wildfly.swarm;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.ServiceLoader;
Expand Down Expand Up @@ -67,17 +68,22 @@ public static void factoryMain(ContainerFactory factory, String...args) throws E
container.deploy();
}

public static JavaArchive artifact(String gav) throws Exception {
public static ArtifactManager artifactManager() throws IOException {
if ( ARTIFACT_MANAGER == null ) {
ARTIFACT_MANAGER = new ArtifactManager();
}
return ARTIFACT_MANAGER.artifact( gav );
return ARTIFACT_MANAGER;
}

public static JavaArchive artifact(String gav) throws Exception {
return artifactManager().artifact( gav );
}

public static JavaArchive artifact(String gav, String asName) throws Exception {
return artifactManager().artifact( gav, asName );
}

public static List<JavaArchive> allArtifacts() throws Exception {
if ( ARTIFACT_MANAGER == null ) {
ARTIFACT_MANAGER = new ArtifactManager();
}
return ARTIFACT_MANAGER.allArtifacts();
return artifactManager().allArtifacts();
}
}

0 comments on commit cbd9e2d

Please sign in to comment.