Module jtrim.query
Package org.jtrim2.concurrent.query.io
Interface ChannelOpener<ChannelType extends Channel>
- Type Parameters:
ChannelType- the type of the channel opened by theChannelOpener
- All Known Implementing Classes:
FileChannelOpener
public interface ChannelOpener<ChannelType extends Channel>
Defines an interface to open a new
Channel for processing. This
interface must open a new channel each new request.
This interface was designed for the AsyncChannelLink and so to
preserve the contract of AsyncDataLink instances of
ChannelOpener must always open the channel to the same source
(e.g.: to the same file) whenever requested.
Thread safety
Implementations of this interface must be safe to be accessed by multiple threads concurrently.Synchronization transparency
Implementations of this interface are not required to be synchronization transparent.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionOpens a new channel to the source defined by thisChannelOpenerinstance.
-
Method Details
-
openChanel
Opens a new channel to the source defined by thisChannelOpenerinstance. This method opens a new channel each time called an these opened channels must beclosedseparately.- Returns:
- new channel to the source defined by this
ChannelOpenerinstance. The returned instance must beclosedin order to prevent resource leakage. This method never returnsnull. - Throws:
IOException- thrown if the channel could not be opened for some reasons
-