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 |
|
/** |