Listing of Source server/EventInterface.javapackage se.entra.phantom.server;
import java.io.IOException;
/**
* The server has a global event manager running in a thread. A static method
* queueEvent is used to create and queue an event. The thread will then empty
* the event queue and passing it on to the ServerInterface. This user exit
* is dynamically loaded from a definition in SERVER.INI.
*/
public interface EventInterface
{
/**
* Processes a single queued event, e.g. writes it to a file.
*
* <p>Note that the methods in this interface can be called from different
* threads, so the implementing code may have to be e.g. <code>synchronized</code>.
*
* @throws IOException for file errors.
*/
public abstract void logEvent(ServerEvent e) throws IOException;
/**
* Gets the current event file name.
*
* @return null for no file name.
*/
public abstract String getEventFileName();
/**
* Gets the current event file length.
*
* @return -1 if no file is used.
*/
public abstract long getEventFileLength();
/**
* Sets the maximum file size of a trace file. If set to
* zero, no limit is used.
*
* @return true successful, false for invalid size (100 KB minimum [102400]).
*/
public abstract boolean setMaximumFileSize(long maxSize);
/**
* Gets the maximum file size of a trace file. If set to
* zero, no limit is used.
*
* @return -1 if no file is used.
*/
public long getMaximumFileSize();
/**
* Rotates the event information if stored in e.g. a file.
*
* <p>Note that the methods in this interface can be called from different
* threads, so the implementing code may have to be e.g. <code>synchronized</code>.
*
* @return true for success or false for failure.
*/
public abstract boolean rotateInformation();
/**
* Disposes of the class instance.
*
* <p>Note that the methods in this interface can be called from different
* threads, so the implementing code may have to be e.g. <code>synchronized</code>.
*/
public abstract void dispose();
}