All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gc.iotools.stream.base.ExecutionModel Maven / Gradle / Ivy

Go to download

EasyStream is a small set of utilities for dealing with streams (InputStreams and OutputStreams). The aim is to ease the use of pipes when they're required. Main features are: * "Convert" an OutputStream to an InputStream. * Count the number of bytes read or wrote to a given stream. * While reading the data from an InputStream copy it to a supplied OutputStream. * Read the content of an InputStream multiple times or seek to a definite position

The newest version!
package com.gc.iotools.stream.base;

/*
 * Copyright (c) 2008, 2015 Gabriele Contini. This source code is released
 * under the BSD License.
 */

/**
 * 

* This class enumerates the policies for instantiating Threads * in classes of EasyStream library that needs of them. *

* * @author dvd.smnt * @since 1.0 * @version $Id: 1$ */ public enum ExecutionModel { /** *

* Only one thread is shared by all instances (slow). *

*/ SINGLE_THREAD, /** *

* Threads are taken from a static pool. *

*

* Some slow thread might lock up the pool and other processes might be * slowed down. *

* * @see java.util.concurrent.ThreadPoolExecutor */ STATIC_THREAD_POOL, /** *

* One thread per instance of class. Slow but each instance can work in * isolation. Also if some thread is not correctly closed there might be * threads leaks. *

*/ THREAD_PER_INSTANCE }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy