1 |
|
//---PACKAGE DECLARATION--- |
2 |
< |
package uk.ac.ukc.iscream.rootfilter; |
2 |
> |
package uk.org.iscream.cms.server.rootfilter; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
< |
import uk.ac.ukc.iscream.core.*; |
6 |
< |
import uk.ac.ukc.iscream.componentmanager.*; |
7 |
< |
import uk.ac.ukc.iscream.clientinterface.*; |
8 |
< |
import uk.ac.ukc.iscream.util.*; |
5 |
> |
import uk.org.iscream.cms.server.core.*; |
6 |
> |
import uk.org.iscream.cms.server.componentmanager.*; |
7 |
> |
import uk.org.iscream.cms.server.clientinterface.*; |
8 |
> |
import uk.org.iscream.cms.server.util.*; |
9 |
|
|
10 |
|
/** |
11 |
|
* A ClientInterface wrapper - the CI objects are pushed data, |
50 |
|
*/ |
51 |
|
public void run() { |
52 |
|
String xml = null; |
53 |
< |
while(true) { |
53 |
> |
boolean run = true; |
54 |
> |
while(run) { |
55 |
> |
// get a line of XML from the queue |
56 |
|
try { |
57 |
|
xml = (String) _queue.get(_queueID); |
58 |
|
} |
59 |
|
catch (InvalidQueueException e) { |
60 |
|
_logger.write(toString(), Logger.ERROR, "Queue error: "+e); |
61 |
|
} |
62 |
< |
_destination.receiveXML(xml); |
62 |
> |
// pass it on to the destination |
63 |
> |
try { |
64 |
> |
_destination.receiveXML(xml); |
65 |
> |
} |
66 |
> |
catch (org.omg.CORBA.COMM_FAILURE e) { |
67 |
> |
run = false; |
68 |
> |
_logger.write(toString(), Logger.ERROR, "Connection failure (COMM_FAILURE), client interface shutdown? : "+e); |
69 |
> |
} |
70 |
> |
catch (org.omg.CORBA.TRANSIENT e) { |
71 |
> |
run = false; |
72 |
> |
_logger.write(toString(), Logger.ERROR, "Connection failure (TRANSIENT), client interface shutdown? : "+e); |
73 |
> |
} |
74 |
|
} |
75 |
+ |
// looks like something when wrong in communication |
76 |
+ |
// rather than fall over in a heap, lets just stop |
77 |
+ |
// cleanly and shutdown our queue... |
78 |
+ |
_logger.write(toString(), Logger.SYSMSG, "Shutting Down..."); |
79 |
+ |
_queue.removeQueue(_queueID); |
80 |
|
} |
81 |
|
|
82 |
|
/** |
83 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
84 |
|
* method to provide clean logging (every class should have this). |
85 |
|
* |
86 |
< |
* This uses the uk.ac.ukc.iscream.util.NameFormat class |
86 |
> |
* This uses the uk.org.iscream.cms.server.util.NameFormat class |
87 |
|
* to format the toString() |
88 |
|
* |
89 |
|
* @return the name of this class and its CVS revision |