ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/filter/FilterServant.java
Revision: 1.10
Committed: Thu Nov 30 02:38:09 2000 UTC (23 years, 5 months ago) by ajm
Branch: MAIN
Branch point for: SERVER_PACKAGEBUILD
Changes since 1.9: +4 -4 lines
Log Message:
Changed package structure
uk.ac.ukc.iscream.refman and xml -> uk.ac.ukc.iscream.util

File Contents

# Content
1 //---PACKAGE DECLARATION---
2 package uk.ac.ukc.iscream.filter;
3
4 //---IMPORTS---
5 import uk.ac.ukc.iscream.core.*;
6 import uk.ac.ukc.iscream.filter.*;
7 import uk.ac.ukc.iscream.util.*;
8 import java.net.InetAddress;
9
10 /**
11 * A test FilterServant, just prints it out.
12 *
13 * @author $Author: tdb1 $
14 * @version $Id: FilterServant.java,v 1.9 2000/11/30 02:00:54 tdb1 Exp $
15 */
16 class FilterServant extends FilterPOA {
17
18 //---FINAL ATTRIBUTES---
19
20 /**
21 * The current CVS revision of this class
22 */
23 public final String REVISION = "$Revision: 1.9 $";
24
25 //---STATIC METHODS---
26
27 //---CONSTRUCTORS---
28
29 /**
30 * Creates a new Filter.
31 *
32 * @param logger a Logger to use
33 */
34 public FilterServant(Filter parent, int TCPListenPort, int UDPListenPort) {
35 _TCPListenPort = TCPListenPort;
36 _UDPListenPort = UDPListenPort;
37 _parent = parent;
38 }
39
40 //---PUBLIC METHODS---
41
42 /**
43 * Method to receive a string over corba.
44 *
45 * @param xml the String of XML to print out
46 */
47 public void receiveXML(String xml) {
48 FilterThread t = new FilterThread(xml, _parent);
49 t.start();
50 }
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 * @return the name of this class and its CVS revision
57 */
58 public String toString() {
59 return this.getClass().getName() + "{" + _name + "}(" + REVISION.substring(11, REVISION.length() - 2) + ")";
60 }
61
62 //---PRIVATE METHODS---
63
64 //---ACCESSOR/MUTATOR METHODS---
65
66 public String getUDPPort() {
67 return new Integer(_UDPListenPort).toString();
68 }
69
70 public String getTCPPort() {
71 return new Integer(_TCPListenPort).toString();
72 }
73
74 public String getHostName() {
75 try {
76 return InetAddress.getLocalHost().getHostName();
77 } catch (java.net.UnknownHostException e) {
78 _logger.write(toString(), Logger.ERROR, e.getMessage());
79 }
80 return null;
81 }
82
83
84 //---ATTRIBUTES---
85
86 /**
87 * Reference to a Logger
88 */
89 private Logger _logger = ReferenceManager.getInstance().getLogger();
90
91 /**
92 * Our name
93 */
94 private String _name = ReferenceManager.getInstance().getName();
95
96 /**
97 * Our parent filter
98 */
99 private Filter _parent;
100
101 private int _UDPListenPort;
102 private int _TCPListenPort;
103
104 //---STATIC ATTRIBUTES---
105
106 }