KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > util > log > output > io > rotate > RotateStrategy


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE file.
7  */

8 package org.jivesoftware.util.log.output.io.rotate;
9
10 import java.io.File JavaDoc;
11
12 /**
13  * Strategy that checks condition under which file rotation is needed.
14  *
15  * @author <a HREF="mailto:bh22351@i-one.at">Bernhard Huber</a>
16  */

17 public interface RotateStrategy {
18     /**
19      * reset cumulative rotation history data.
20      * Called after rotation.
21      */

22     void reset();
23
24     /**
25      * Check if a log rotation is neccessary at this time.
26      *
27      * @param data the serialized version of last message written to the log system
28      * @param file the File that we are writing to
29      * @return boolean return true if log rotation is neccessary, else false
30      */

31     boolean isRotationNeeded(String JavaDoc data, File JavaDoc file);
32 }
33
34
Popular Tags