edu.uiuc.ge.illigal.gale.io
Interface IOFactory

All Known Implementing Classes:
FileIOFactory

public interface IOFactory

Defines a simple IO factory with multiple channels.

Since:
0.9alpha
Version:
0.9alpha
Author:
Xavier Llorà <xllora@illigal.ge.uiuc.edu>

Method Summary
 void closeAllChannels()
          Closes all IO channels.
 void closeChannel(int iDesc)
          Closes an IO channel.
 void closeChannel(java.lang.String sName)
          Closes an IO channel.
 int openChannel(java.lang.String sName, java.lang.String sURL)
          Opens a new IO channel.
 void push(int iDesc, java.lang.Object obj)
          Pushes the information into the given channel.
 void push(java.lang.String sName, java.lang.Object obj)
          Pushes the information into the given channel.
 

Method Detail

openChannel

public int openChannel(java.lang.String sName,
                       java.lang.String sURL)
                throws IOFactoryException
Opens a new IO channel.

Parameters:
sName - The channel name
sURL - The channel URL
Returns:
The channel descriptor
Throws:
IOFactoryException - The channel could not be opened

closeChannel

public void closeChannel(int iDesc)
                  throws IOFactoryException
Closes an IO channel.

Parameters:
iDesc - The channel descriptor
Throws:
IOFactoryException - The channel could not be closed

closeChannel

public void closeChannel(java.lang.String sName)
                  throws IOFactoryException
Closes an IO channel.

Parameters:
sName - The channel name
Throws:
IOFactoryException - The channel could not be closed

closeAllChannels

public void closeAllChannels()
                      throws IOFactoryException
Closes all IO channels.

Throws:
IOFactoryException - The channel could not be closed

push

public void push(int iDesc,
                 java.lang.Object obj)
          throws IOFactoryException
Pushes the information into the given channel.

Parameters:
iDesc - The channel descriptor
obj - The object to be pushed
Throws:
IOFactoryException - The failure in channel

push

public void push(java.lang.String sName,
                 java.lang.Object obj)
          throws IOFactoryException
Pushes the information into the given channel.

Parameters:
obj - The object to be pushed
Throws:
IOFactoryException - The failure in channel