1 |
ajm |
1.3 |
//---PACKAGE DECLARATION--- |
2 |
tdb |
1.10 |
package uk.org.iscream.clientinterface; |
3 |
ajm |
1.3 |
|
4 |
|
|
//---IMPORTS--- |
5 |
tdb |
1.10 |
import uk.org.iscream.core.*; |
6 |
|
|
import uk.org.iscream.util.*; |
7 |
|
|
import uk.org.iscream.componentmanager.*; |
8 |
ajm |
1.3 |
|
9 |
|
|
/** |
10 |
tdb |
1.9 |
* This class, a servant, listens for incoming data sent to it |
11 |
|
|
* using CORBA. This data is then queued in the PacketSorter. |
12 |
|
|
* It does no processing of the data, and is only a seperate |
13 |
|
|
* class to keep the CORBA stuff out of the PacketSorter. |
14 |
ajm |
1.3 |
* |
15 |
tdb |
1.6 |
* @author $Author: tdb1 $ |
16 |
tdb |
1.10 |
* @version $Id: ClientInterfaceServant.java,v 1.9 2001/01/27 23:30:40 tdb1 Exp $ |
17 |
ajm |
1.3 |
*/ |
18 |
|
|
class ClientInterfaceServant extends ClientInterfacePOA { |
19 |
|
|
|
20 |
|
|
//---FINAL ATTRIBUTES--- |
21 |
|
|
|
22 |
|
|
/** |
23 |
|
|
* The current CVS revision of this class |
24 |
|
|
*/ |
25 |
tdb |
1.10 |
public final String REVISION = "$Revision: 1.9 $"; |
26 |
ajm |
1.3 |
|
27 |
|
|
//---STATIC METHODS--- |
28 |
|
|
|
29 |
|
|
//---CONSTRUCTORS--- |
30 |
|
|
|
31 |
|
|
/** |
32 |
|
|
* Creates a new ClientInterfaceServant. |
33 |
tdb |
1.9 |
* |
34 |
|
|
* @param packetSorter a reference to the PacketSorter object being used |
35 |
ajm |
1.3 |
*/ |
36 |
tdb |
1.9 |
public ClientInterfaceServant(PacketSorter packetSorter) { |
37 |
|
|
_queue = packetSorter.getQueue(); |
38 |
ajm |
1.3 |
_logger.write(toString(), Logger.SYSINIT, "created"); |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
//---PUBLIC METHODS--- |
42 |
|
|
|
43 |
|
|
/** |
44 |
tdb |
1.9 |
* Method to receive a string over CORBA. |
45 |
ajm |
1.3 |
* |
46 |
tdb |
1.9 |
* @param xml the XML string to be queued for processing. |
47 |
ajm |
1.3 |
*/ |
48 |
|
|
public void receiveXML(String xml) { |
49 |
tdb |
1.7 |
_queue.add(xml); |
50 |
ajm |
1.3 |
} |
51 |
|
|
|
52 |
|
|
/** |
53 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
54 |
|
|
* method to provide clean logging (every class should have this). |
55 |
|
|
* |
56 |
tdb |
1.10 |
* This uses the uk.org.iscream.util.NameFormat class |
57 |
ajm |
1.3 |
* to format the toString() |
58 |
|
|
* |
59 |
|
|
* @return the name of this class and its CVS revision |
60 |
|
|
*/ |
61 |
|
|
public String toString() { |
62 |
|
|
return FormatName.getName( |
63 |
|
|
_name, |
64 |
|
|
getClass().getName(), |
65 |
|
|
REVISION); |
66 |
|
|
} |
67 |
|
|
|
68 |
|
|
//---PRIVATE METHODS--- |
69 |
|
|
|
70 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
71 |
|
|
|
72 |
|
|
//---ATTRIBUTES--- |
73 |
|
|
|
74 |
|
|
/** |
75 |
|
|
* This is the friendly identifier of the |
76 |
|
|
* component this class is running in. |
77 |
|
|
* eg, a Filter may be called "filter1", |
78 |
|
|
* If this class does not have an owning |
79 |
|
|
* component, a name from the configuration |
80 |
|
|
* can be placed here. This name could also |
81 |
|
|
* be changed to null for utility classes. |
82 |
|
|
*/ |
83 |
|
|
private String _name = ClientInterfaceMain.NAME; |
84 |
|
|
|
85 |
|
|
/** |
86 |
|
|
* This holds a reference to the |
87 |
|
|
* system logger that is being used. |
88 |
|
|
*/ |
89 |
|
|
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
90 |
|
|
|
91 |
tdb |
1.9 |
/** |
92 |
|
|
* A reference to the Queue we'll add data to. This is |
93 |
|
|
* actually located in the PacketSorter. |
94 |
|
|
*/ |
95 |
tdb |
1.7 |
private Queue _queue; |
96 |
ajm |
1.3 |
|
97 |
|
|
//---STATIC ATTRIBUTES--- |
98 |
|
|
|
99 |
|
|
} |