1 |
tdb |
1.1 |
//---PACKAGE DECLARATION--- |
2 |
tdb |
1.7 |
package uk.ac.ukc.iscream.rootfilter; |
3 |
tdb |
1.1 |
|
4 |
|
|
//---IMPORTS--- |
5 |
|
|
import uk.ac.ukc.iscream.core.*; |
6 |
|
|
import uk.ac.ukc.iscream.filter.*; |
7 |
ajm |
1.10 |
import uk.ac.ukc.iscream.clientinterface.*; |
8 |
tdb |
1.8 |
import uk.ac.ukc.iscream.util.*; |
9 |
tdb |
1.1 |
|
10 |
|
|
/** |
11 |
ajm |
1.11 |
* A root filter servant has an array |
12 |
|
|
* of client interfaces where data should be |
13 |
|
|
* piped. |
14 |
tdb |
1.1 |
* |
15 |
ajm |
1.11 |
* @author $Author: ajm4 $ |
16 |
|
|
* @version $Id: RootFilterServant.java,v 1.10 2000/12/04 18:12:13 ajm4 Exp $ |
17 |
tdb |
1.1 |
*/ |
18 |
|
|
class RootFilterServant extends FilterPOA { |
19 |
|
|
|
20 |
|
|
//---FINAL ATTRIBUTES--- |
21 |
|
|
|
22 |
|
|
/** |
23 |
|
|
* The current CVS revision of this class |
24 |
|
|
*/ |
25 |
ajm |
1.11 |
public final String REVISION = "$Revision: 1.10 $"; |
26 |
tdb |
1.1 |
|
27 |
|
|
//---STATIC METHODS--- |
28 |
|
|
|
29 |
|
|
//---CONSTRUCTORS--- |
30 |
|
|
|
31 |
|
|
/** |
32 |
|
|
* Creates a new RootFilter. |
33 |
|
|
* |
34 |
|
|
* @param logger a Logger to use |
35 |
|
|
*/ |
36 |
ajm |
1.10 |
public RootFilterServant(ClientInterface[] clientInterfaces) { |
37 |
|
|
_clientInterfaces = clientInterfaces; |
38 |
ajm |
1.11 |
_logger.write(toString(), Logger.SYSINIT, "created"); |
39 |
tdb |
1.1 |
} |
40 |
|
|
|
41 |
|
|
//---PUBLIC METHODS--- |
42 |
|
|
|
43 |
|
|
/** |
44 |
|
|
* Method to receive a string over corba. |
45 |
|
|
* |
46 |
|
|
* @param xml the String of XML to print out |
47 |
|
|
*/ |
48 |
|
|
public void receiveXML(String xml) { |
49 |
ajm |
1.10 |
for (int x = 0; x < _clientInterfaces.length; x++) { |
50 |
|
|
RootFilterThread t = new RootFilterThread(_clientInterfaces[x], xml); |
51 |
|
|
t.start(); |
52 |
|
|
} |
53 |
tdb |
1.3 |
} |
54 |
|
|
|
55 |
tdb |
1.1 |
/** |
56 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
57 |
|
|
* method to provide clean logging (every class should have this). |
58 |
|
|
* |
59 |
ajm |
1.11 |
* This uses the uk.ac.ukc.iscream.util.NameFormat class |
60 |
|
|
* to format the toString() |
61 |
|
|
* |
62 |
tdb |
1.1 |
* @return the name of this class and its CVS revision |
63 |
|
|
*/ |
64 |
|
|
public String toString() { |
65 |
ajm |
1.11 |
return FormatName.getName( |
66 |
|
|
_name, |
67 |
|
|
getClass().getName(), |
68 |
|
|
REVISION); |
69 |
tdb |
1.1 |
} |
70 |
|
|
|
71 |
|
|
//---PRIVATE METHODS--- |
72 |
|
|
|
73 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
74 |
|
|
|
75 |
ajm |
1.11 |
public String getUDPPort() { |
76 |
|
|
return null; |
77 |
|
|
} |
78 |
|
|
|
79 |
|
|
public String getTCPPort() { |
80 |
|
|
return null; |
81 |
|
|
} |
82 |
|
|
|
83 |
|
|
public String getHostName() { |
84 |
|
|
return null; |
85 |
|
|
} |
86 |
|
|
|
87 |
tdb |
1.1 |
//---ATTRIBUTES--- |
88 |
|
|
|
89 |
|
|
/** |
90 |
ajm |
1.11 |
* This is the friendly identifier of the |
91 |
|
|
* component this class is running in. |
92 |
|
|
* eg, a Filter may be called "filter1", |
93 |
|
|
* If this class does not have an owning |
94 |
|
|
* component, a name from the configuration |
95 |
|
|
* can be placed here. This name could also |
96 |
|
|
* be changed to null for utility classes. |
97 |
|
|
*/ |
98 |
|
|
private String _name = RootFilter.NAME; |
99 |
|
|
|
100 |
|
|
/** |
101 |
|
|
* This holds a reference to the |
102 |
|
|
* system logger that is being used. |
103 |
tdb |
1.1 |
*/ |
104 |
tdb |
1.8 |
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
105 |
tdb |
1.1 |
|
106 |
|
|
/** |
107 |
ajm |
1.11 |
* An array of client interface that incoming |
108 |
|
|
* data should be passed to |
109 |
|
|
*/ |
110 |
ajm |
1.10 |
private ClientInterface[] _clientInterfaces; |
111 |
tdb |
1.1 |
|
112 |
|
|
//---STATIC ATTRIBUTES--- |
113 |
|
|
|
114 |
|
|
} |