| 1 |
tdb |
1.1 |
//---PACKAGE DECLARATION--- |
| 2 |
tdb |
1.18 |
package uk.org.iscream.cms.server.filter; |
| 3 |
tdb |
1.1 |
|
| 4 |
|
|
//---IMPORTS--- |
| 5 |
tdb |
1.18 |
import uk.org.iscream.cms.server.core.*; |
| 6 |
|
|
import uk.org.iscream.cms.server.componentmanager.*; |
| 7 |
|
|
import uk.org.iscream.cms.server.filter.*; |
| 8 |
|
|
import uk.org.iscream.cms.server.util.*; |
| 9 |
tdb |
1.4 |
import java.net.InetAddress; |
| 10 |
tdb |
1.1 |
|
| 11 |
|
|
/** |
| 12 |
ajm |
1.11 |
* Passes inbound data from other Filters to a FilterThread |
| 13 |
tdb |
1.1 |
* |
| 14 |
tdb |
1.19 |
* @author $Author: tdb $ |
| 15 |
|
|
* @version $Id: FilterServant.java,v 1.18 2001/05/29 17:02:35 tdb Exp $ |
| 16 |
tdb |
1.1 |
*/ |
| 17 |
|
|
class FilterServant extends FilterPOA { |
| 18 |
|
|
|
| 19 |
|
|
//---FINAL ATTRIBUTES--- |
| 20 |
|
|
|
| 21 |
|
|
/** |
| 22 |
|
|
* The current CVS revision of this class |
| 23 |
|
|
*/ |
| 24 |
tdb |
1.19 |
public final String REVISION = "$Revision: 1.18 $"; |
| 25 |
tdb |
1.1 |
|
| 26 |
|
|
//---STATIC METHODS--- |
| 27 |
|
|
|
| 28 |
|
|
//---CONSTRUCTORS--- |
| 29 |
|
|
|
| 30 |
|
|
/** |
| 31 |
tdb |
1.14 |
* Creates a new FilterServant. |
| 32 |
tdb |
1.1 |
* |
| 33 |
tdb |
1.14 |
* @param queue the Queue this filter is using |
| 34 |
tdb |
1.1 |
*/ |
| 35 |
tdb |
1.19 |
public FilterServant(Queue queue) { |
| 36 |
tdb |
1.12 |
_queue = queue; |
| 37 |
tdb |
1.15 |
_logger.write(toString(), Logger.SYSINIT, "started"); |
| 38 |
tdb |
1.1 |
} |
| 39 |
tdb |
1.9 |
|
| 40 |
tdb |
1.1 |
//---PUBLIC METHODS--- |
| 41 |
|
|
|
| 42 |
|
|
/** |
| 43 |
|
|
* Method to receive a string over corba. |
| 44 |
|
|
* |
| 45 |
tdb |
1.14 |
* @param xml the String of XML to queue |
| 46 |
tdb |
1.1 |
*/ |
| 47 |
|
|
public void receiveXML(String xml) { |
| 48 |
tdb |
1.12 |
_queue.add(xml); |
| 49 |
tdb |
1.1 |
} |
| 50 |
|
|
|
| 51 |
|
|
/** |
| 52 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
| 53 |
|
|
* method to provide clean logging (every class should have this). |
| 54 |
|
|
* |
| 55 |
tdb |
1.18 |
* This uses the uk.org.iscream.cms.server.util.NameFormat class |
| 56 |
ajm |
1.11 |
* to format the toString() |
| 57 |
|
|
* |
| 58 |
tdb |
1.1 |
* @return the name of this class and its CVS revision |
| 59 |
|
|
*/ |
| 60 |
|
|
public String toString() { |
| 61 |
ajm |
1.11 |
return FormatName.getName( |
| 62 |
|
|
_name, |
| 63 |
|
|
getClass().getName(), |
| 64 |
|
|
REVISION); |
| 65 |
tdb |
1.1 |
} |
| 66 |
|
|
|
| 67 |
|
|
//---PRIVATE METHODS--- |
| 68 |
|
|
|
| 69 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
| 70 |
|
|
|
| 71 |
|
|
//---ATTRIBUTES--- |
| 72 |
|
|
|
| 73 |
|
|
/** |
| 74 |
ajm |
1.11 |
* This is the friendly identifier of the |
| 75 |
|
|
* component this class is running in. |
| 76 |
|
|
* eg, a Filter may be called "filter1", |
| 77 |
|
|
* If this class does not have an owning |
| 78 |
|
|
* component, a name from the configuration |
| 79 |
|
|
* can be placed here. This name could also |
| 80 |
|
|
* be changed to null for utility classes. |
| 81 |
tdb |
1.1 |
*/ |
| 82 |
ajm |
1.11 |
private String _name = FilterMain.NAME; |
| 83 |
|
|
|
| 84 |
tdb |
1.1 |
/** |
| 85 |
ajm |
1.11 |
* This holds a reference to the |
| 86 |
|
|
* system logger that is being used. |
| 87 |
tdb |
1.1 |
*/ |
| 88 |
ajm |
1.11 |
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
| 89 |
tdb |
1.3 |
|
| 90 |
|
|
/** |
| 91 |
tdb |
1.12 |
* Our Queue object |
| 92 |
tdb |
1.3 |
*/ |
| 93 |
tdb |
1.12 |
private Queue _queue; |
| 94 |
tdb |
1.1 |
|
| 95 |
|
|
//---STATIC ATTRIBUTES--- |
| 96 |
|
|
|
| 97 |
|
|
} |