use of io.fabric8.core.jmx.FileSystem in project docker-maven-plugin by fabric8io.
the class DockerAssemblyManager method getAssemblyFiles.
/**
* Extract all files with a tracking archiver. These can be used to track changes in the filesystem and triggering
* a rebuild of the image if needed ('docker:watch')
*/
public AssemblyFiles getAssemblyFiles(String name, BuildImageConfiguration buildConfig, MojoParameters mojoParams, Logger log) throws InvalidAssemblerConfigurationException, ArchiveCreationException, AssemblyFormattingException, MojoExecutionException {
BuildDirs buildDirs = createBuildDirs(name, mojoParams);
AssemblyConfiguration assemblyConfig = buildConfig.getAssemblyConfiguration();
String assemblyName = assemblyConfig.getName();
DockerAssemblyConfigurationSource source = new DockerAssemblyConfigurationSource(mojoParams, buildDirs, assemblyConfig);
Assembly assembly = getAssemblyConfig(assemblyConfig, source);
synchronized (trackArchiver) {
MappingTrackArchiver ta = (MappingTrackArchiver) trackArchiver;
ta.init(log, assemblyName);
assembly.setId("tracker");
assemblyArchiver.createArchive(assembly, assemblyName, "track", source, false);
return ta.getAssemblyFiles(mojoParams.getSession());
}
}
use of io.fabric8.core.jmx.FileSystem in project fabric8 by jboss-fuse.
the class GitHttpServerRegistrationHandler method unregisterServlet.
/**
* The complexity of this code is due to problems with jgit and Windows file system.
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=300084
*/
private void unregisterServlet() {
unregisterGitHttpEndpoint();
synchronized (gitRemoteUrl) {
if (basePath != null) {
try {
httpService.get().unregister("/git");
} catch (IllegalArgumentException e) {
LOGGER.warn("/git Servlet wasn't registered. Unregistration not required.");
}
// this should foul jgit to use flush its cache and release locks for .pack files on Windows
WindowCacheConfig cfg = new WindowCacheConfig();
cfg.install();
git.getRepository().close();
git = null;
boolean basePathExists = basePath.toFile().exists();
for (int i = 0; i < 10; i++) {
try {
if (basePathExists) {
recursiveDelete(basePath.toFile());
basePathExists = false;
}
break;
} catch (IOException e) {
LOGGER.debug("Failed to recursively delete this filesystem path: {}", basePath, e);
System.gc();
try {
Thread.sleep(3 * 1000);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
}
if (basePathExists) {
LOGGER.error("Failed to recursively delete this filesystem path: {}", basePath);
} else {
LOGGER.info("Correctly removed old git repo: {}", basePath);
}
}
}
}
use of io.fabric8.core.jmx.FileSystem in project fabric8 by jboss-fuse.
the class FabricMBeanRegistrationListener method registerFabricMBeans.
private void registerFabricMBeans() {
this.healthCheck = new HealthCheck(fabricService.get());
this.managerMBean = new FabricManager((FabricServiceImpl) fabricService.get());
this.zooKeeperMBean = new ZooKeeperFacade((FabricServiceImpl) fabricService.get());
this.fileSystemMBean = new FileSystem(runtimeProperties.get());
healthCheck.registerMBeanServer(shutdownTracker, mbeanServer.get());
managerMBean.registerMBeanServer(shutdownTracker, mbeanServer.get());
fileSystemMBean.registerMBeanServer(shutdownTracker, mbeanServer.get());
zooKeeperMBean.registerMBeanServer(shutdownTracker, mbeanServer.get());
}
Aggregations