本文整理汇总了Java中org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl类的典型用法代码示例。如果您正苦于以下问题:Java AddonRepositoryImpl类的具体用法?Java AddonRepositoryImpl怎么用?Java AddonRepositoryImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AddonRepositoryImpl类属于org.jboss.forge.furnace.impl.addons包,在下文中一共展示了AddonRepositoryImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllEnabledAddonsInAllRepositories
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
private Set<AddonId> getAllEnabledAddonsInAllRepositories(Collection<AddonRepository> repositories)
{
Set<AddonId> result = new HashSet<AddonId>();
for (AddonRepository repository : repositories)
{
List<AddonId> all = repository.listAll();
List<AddonId> enabled = repository.listEnabled();
result.addAll(enabled);
List<AddonId> incompatible = new ArrayList<>(all);
incompatible.removeAll(enabled);
for (AddonId addon : incompatible)
{
if (addon.getApiVersion() != null)
logger.warning("Addon [" + addon + "] with API version [" + addon.getApiVersion()
+ "] is incompatible with the current Furnace runtime version ["
+ AddonRepositoryImpl.getRuntimeAPIVersion() + "] and will not be loaded, from repository ["
+ repository + "]");
}
}
return result;
}
示例2: findCompatibleInstalledModule
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
private ModuleIdentifier findCompatibleInstalledModule(AddonId addonId)
{
ModuleIdentifier result = null;
Addon addon = currentAddon.get();
Version runtimeAPIVersion = AddonRepositoryImpl.getRuntimeAPIVersion();
for (AddonRepository repository : stateManager.getViewsOf(addon).iterator().next().getRepositories())
{
List<AddonId> enabled = repository.listEnabledCompatibleWithVersion(runtimeAPIVersion);
for (AddonId id : enabled)
{
if (id.getName().equals(addonId.getName()))
{
result = moduleCache.getModuleId(addon);
break;
}
}
}
return result;
}
示例3: FurnaceImpl
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
public FurnaceImpl()
{
if (!AddonRepositoryImpl.hasRuntimeAPIVersion())
logger.warning("Could not detect Furnace runtime version - " +
"loading all addons, but failures may occur if versions are not compatible.");
if (Boolean.getBoolean("furnace.debug"))
enableLogging();
try
{
watcher = FileSystems.getDefault().newWatchService();
}
catch (IOException e)
{
logger.log(Level.WARNING, "File monitoring could not be started.", e);
}
}
示例4: testMinorVersionCompatible
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Test
public void testMinorVersionCompatible() throws Exception
{
AddonId entry = AddonId.fromCoordinates("com.example.plugin,40,1.0.0-SNAPSHOT");
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.1.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.2.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.2000.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.2-SNAPSHOT"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.1000-SNAPSHOT"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.1000-adsfasfsd"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.1.0.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.1.1.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.2.0.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.2.1.Final"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("2.0.0.Final"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("s1.0.0.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(null, entry));
}
示例5: testMinorVersionCompatibleBackwards
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Test
public void testMinorVersionCompatibleBackwards() throws Exception
{
AddonId entry = AddonId.fromCoordinates("com.example.plugin,20.0i,1.1.0-SNAPSHOT");
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.1.Final"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.2.Final"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.2000.Final"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.2-SNAPSHOT"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.1000-SNAPSHOT"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.0.1000-adsfasfsd"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.1.0.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.1.1.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.2.0.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion("1.2.1.Final"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("2.0.0.Final"), entry));
Assert.assertFalse(AddonRepositoryImpl.isApiCompatible(new SingleVersion("s1.0.0.Final"), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(new SingleVersion(""), entry));
Assert.assertTrue(AddonRepositoryImpl.isApiCompatible(null, entry));
}
示例6: testDeployAddonEntryNoDependencies
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Test
public void testDeployAddonEntryNoDependencies() throws Exception
{
File temp = File.createTempFile("addonDir", "test");
temp.deleteOnExit();
MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);
AddonId addon = AddonId.from("1", "2");
ArrayList<File> resourceJars = new ArrayList<File>();
File tempJar = File.createTempFile("addon" + addon.getName(), ".jar");
tempJar.createNewFile();
resourceJars.add(tempJar);
Assert.assertFalse(repository.isDeployed(addon));
repository.deploy(addon, new ArrayList<AddonDependencyEntry>(), resourceJars);
Assert.assertTrue(repository.isDeployed(addon));
Assert.assertFalse(repository.isEnabled(addon));
repository.enable(addon);
Assert.assertTrue(repository.isEnabled(addon));
Assert.assertEquals(0, repository.getAddonDependencies(addon).size());
}
示例7: testDeployAddonEntryNoDependenciesOrResources
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Test
public void testDeployAddonEntryNoDependenciesOrResources() throws Exception
{
File temp = File.createTempFile("addonDir", "test");
temp.deleteOnExit();
MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);
AddonId addon = AddonId.from("1", "2");
Assert.assertFalse(repository.isDeployed(addon));
repository.deploy(addon, new ArrayList<AddonDependencyEntry>(), new ArrayList<File>());
Assert.assertTrue(repository.isDeployed(addon));
Assert.assertFalse(repository.isEnabled(addon));
repository.enable(addon);
Assert.assertTrue(repository.isEnabled(addon));
Assert.assertEquals(0, repository.getAddonDependencies(addon).size());
}
示例8: testDeployAddonEntryMultipleDependencies
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Test
public void testDeployAddonEntryMultipleDependencies() throws Exception
{
File temp = File.createTempFile("addonDir", "test");
temp.deleteOnExit();
MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);
AddonId addon = AddonId.from("1", "2");
AddonDependencyEntry dependency0 = AddonDependencyEntry.create("nm1", "ver", true, false);
AddonDependencyEntry dependency1 = AddonDependencyEntry.create("nm2", "ver");
repository.deploy(addon, Arrays.asList(dependency0, dependency1), new ArrayList<File>());
Assert.assertEquals(2, repository.getAddonDependencies(addon).size());
Assert.assertTrue(repository.getAddonDependencies(addon).contains(dependency0));
Assert.assertTrue(repository.getAddonDependencies(addon).contains(dependency1));
}
示例9: getEnabledAddons
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
private Set<String> getEnabledAddons()
{
Set<String> addons = new HashSet<>();
try
{
for (AddonRepository repository : furnace.getRepositories())
{
System.out.println(repository.getRootDirectory().getCanonicalPath() + ":");
List<AddonId> enabledAddons = repository.listEnabled();
for (AddonId addon : enabledAddons)
{
addons.add(addon.toCoordinates());
}
}
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("> Forge version [" + AddonRepositoryImpl.getRuntimeAPIVersion() + "]");
}
return addons;
}
示例10: addRepository
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Override
public AddonRepository addRepository(AddonRepositoryMode mode, File directory)
{
Assert.notNull(mode, "Addon repository mode must not be null.");
Assert.notNull(directory, "Addon repository directory must not be null.");
AddonRepository repository = AddonRepositoryImpl.forDirectory(this, directory);
if (mode.isImmutable())
repository = new ImmutableAddonRepository(repository);
return addRepository(repository);
}
示例11: addRepository
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Override
public AddonRepository addRepository(AddonRepositoryMode mode, File directory)
{
Assert.notNull(mode, "Addon repository mode must not be null.");
Assert.notNull(directory, "Addon repository directory must not be null.");
AddonRepository repository = AddonRepositoryImpl.forDirectory(this, directory);
if (mode.isImmutable())
repository = new ImmutableAddonRepository(repository);
try
{
if (watcher != null)
{
if ((directory.exists() && directory.isDirectory()) || directory.mkdirs())
{
directory.toPath().register(watcher,
StandardWatchEventKinds.ENTRY_MODIFY,
StandardWatchEventKinds.ENTRY_CREATE,
StandardWatchEventKinds.ENTRY_DELETE,
StandardWatchEventKinds.OVERFLOW);
logger.log(Level.INFO, "Monitoring repository [" + directory.toString() + "] for file changes.");
}
else
{
logger.log(Level.WARNING, "Cannot monitor repository [" + directory
+ "] for changes because it is not a directory.");
}
}
}
catch (IOException e)
{
logger.log(Level.WARNING, "Could not monitor repository [" + directory.toString() + "] for file changes.", e);
}
return addRepository(repository);
}
示例12: getAllEnabledAddonsInAllRepositories
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
private Set<AddonId> getAllEnabledAddonsInAllRepositories(Collection<AddonRepository> repositories)
{
Set<AddonId> result = new HashSet<AddonId>();
for (AddonRepository repository : repositories)
{
for (AddonId enabled : repository.listEnabledCompatibleWithVersion(AddonRepositoryImpl.getRuntimeAPIVersion()))
{
result.add(enabled);
}
}
return result;
}
示例13: testAddonDirNaming
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Test
public void testAddonDirNaming() throws Exception
{
File temp = File.createTempFile("addonDir", "test");
temp.deleteOnExit();
MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);
File dir = repository.getAddonBaseDir(AddonId.from("123#$%456", "[email protected]#789*-0"));
Assert.assertEquals("123-456-789-0", dir.getName());
}
示例14: testDeployAddonEntrySingleDependency
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
@Test
public void testDeployAddonEntrySingleDependency() throws Exception
{
File temp = File.createTempFile("addonDir", "test");
temp.deleteOnExit();
MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);
AddonId addon = AddonId.from("1", "2");
AddonDependencyEntry dependency = AddonDependencyEntry.create("nm", "ver", false, true);
repository.deploy(addon, Arrays.asList(dependency), new ArrayList<File>());
Assert.assertEquals(1, repository.getAddonDependencies(addon).size());
Assert.assertTrue(repository.getAddonDependencies(addon).contains(dependency));
}
示例15: FurnaceImpl
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入依赖的package包/类
public FurnaceImpl()
{
if (!AddonRepositoryImpl.hasRuntimeAPIVersion())
{
logger.warning("Could not detect Furnace runtime version - " +
"loading all addons, but failures may occur if versions are not compatible.");
}
String addonCompatibilityValue = System.getProperty(FURNACE_ADDON_COMPATIBILITY_PROPERTY);
if (!Strings.isNullOrEmpty(addonCompatibilityValue))
{
AddonCompatibilityStrategy strategy = null;
try
{
strategy = AddonCompatibilityStrategies.valueOf(addonCompatibilityValue);
}
catch (IllegalArgumentException iae)
{
try
{
strategy = (AddonCompatibilityStrategy) Class.forName(addonCompatibilityValue).newInstance();
}
catch (Exception e)
{
logger.log(Level.SEVERE, "Error loading [" + addonCompatibilityValue
+ "] defined by system property `" + FURNACE_ADDON_COMPATIBILITY_PROPERTY + "` ", e);
}
}
if (strategy == null)
{
logger.warning("'" + addonCompatibilityValue + "' is not a valid value for the '"
+ FURNACE_ADDON_COMPATIBILITY_PROPERTY + "' property. Possible values are: "
+ Arrays.toString(AddonCompatibilityStrategies.values())
+ " or a fully qualified class name. Assuming default value.");
}
else
{
setAddonCompatibilityStrategy(strategy);
}
}
if (!Boolean.getBoolean(FURNACE_LOGGING_LEAK_CLASSLOADERS_PROPERTY))
{
/*
* If enabled, allows the JDK java.util.logging.Level to leak ClassLoaders (memory leak).
*/
LoggingRepair.init();
}
if (Boolean.getBoolean(FURNACE_DEBUG_PROPERTY))
{
/*
* If enabled, prints a LOT of debug logging from JBoss Modules.
*/
enableLogging();
}
}