org.jboss.vfs.TempFileProvider Java Examples

The following examples show how to use org.jboss.vfs.TempFileProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DeploymentMountProvider.java    From wildfly-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public void start(StartContext context) throws StartException {
    try {
        final JBossThreadFactory threadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() {
            public JBossThreadFactory run() {
                return new JBossThreadFactory(new ThreadGroup("ServerDeploymentRepository-temp-threads"), true, null, "%G - %t", null, null);
            }
        });
        scheduledExecutorService =  Executors.newScheduledThreadPool(2, threadFactory);
        tempFileProvider = TempFileProvider.create("temp", scheduledExecutorService, true);
        deploymentMountProviderConsumer.accept(this);
    } catch (IOException e) {
        throw ServerLogger.ROOT_LOGGER.failedCreatingTempProvider(e);
    }
    ServerLogger.ROOT_LOGGER.debugf("%s started", DeploymentMountProvider.class.getSimpleName());
}
 
Example #2
Source File: TempFileProviderProducer.java    From thorntail with Apache License 2.0 5 votes vote down vote up
@PostConstruct
void init() {
    File serverTmp;
    try {
        serverTmp = TempFileManager.INSTANCE.newTempDirectory(TEMP_DIR_NAME, ".d");
        System.setProperty("jboss.server.temp.dir", serverTmp.getAbsolutePath());

        ScheduledExecutorService tempFileExecutor = Executors.newSingleThreadScheduledExecutor();
        this.tempFileProvider = TempFileProvider.create(TEMP_DIR_NAME, tempFileExecutor, true);

    } catch (IOException e) {
        SwarmMessages.MESSAGES.errorSettingUpTempFileProvider(e);
    }
}
 
Example #3
Source File: TempFileProviderProducer.java    From thorntail with Apache License 2.0 4 votes vote down vote up
@Produces
@Singleton
TempFileProvider tempFileProvider() {
    return this.tempFileProvider;
}
 
Example #4
Source File: RuntimeDeployer.java    From ARCHIVE-wildfly-swarm with Apache License 2.0 4 votes vote down vote up
public RuntimeDeployer(List<ServerConfiguration<Fraction>> configurations, ModelControllerClient client, SimpleContentProvider contentProvider, TempFileProvider tempFileProvider) throws IOException {
    this.configurations = configurations;
    this.client = client;
    this.contentProvider = contentProvider;
    this.tempFileProvider = tempFileProvider;
}
 
Example #5
Source File: TempFileProviderService.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public TempFileProvider getValue() throws IllegalStateException {
    return provider();
}
 
Example #6
Source File: TempFileProviderService.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public static TempFileProvider provider() {
    return PROVIDER;
}
 
Example #7
Source File: MountedDeploymentOverlay.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public MountedDeploymentOverlay(Closeable closeable, File realFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) {
    this.closeable = closeable;
    this.realFile = realFile;
    this.mountPoint = mountPoint;
    this.tempFileProvider = tempFileProvider;
}
 
Example #8
Source File: DeploymentHandler.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected MountHandle extractArchive(File archive, TempFileProvider tempFileProvider) throws IOException {
    return ((MountHandle)VFS.mountZipExpanded(archive, VFS.getChild("cli"), tempFileProvider));
}
 
Example #9
Source File: DeployArchiveCommand.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
static MountHandle extractArchive(File archive,
        TempFileProvider tempFileProvider, String name) throws IOException {
    return ((MountHandle) VFS.mountZipExpanded(archive, VFS.getChild(name),
            tempFileProvider));
}