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.7
Committed: Wed Nov 29 19:26:00 2000 UTC (23 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.6: +3 -2 lines
Log Message:
Made changes to fit into the new package structure. Also made all classes, namely
the UDPReader and FilterThread, conform to the Template class specification.

File Contents

# User Rev Content
1 tdb 1.1 //---PACKAGE DECLARATION---
2 tdb 1.7 package uk.ac.ukc.iscream.filter;
3 tdb 1.1
4     //---IMPORTS---
5     import uk.ac.ukc.iscream.core.*;
6     import uk.ac.ukc.iscream.filter.*;
7 tdb 1.4 import java.net.InetAddress;
8 tdb 1.1
9     /**
10     * A test FilterServant, just prints it out.
11     *
12 tdb 1.2 * @author $Author: tdb1 $
13 tdb 1.7 * @version $Id: FilterServant.java,v 1.6 2000/11/27 21:46:50 tdb1 Exp $
14 tdb 1.1 */
15     class FilterServant extends FilterPOA {
16    
17     //---FINAL ATTRIBUTES---
18    
19     /**
20     * The current CVS revision of this class
21     */
22 tdb 1.7 public final String REVISION = "$Revision: 1.6 $";
23 tdb 1.1
24     //---STATIC METHODS---
25    
26     //---CONSTRUCTORS---
27    
28     /**
29     * Creates a new Filter.
30     *
31     * @param logger a Logger to use
32     */
33 tdb 1.4 public FilterServant(Logger logger, Filter parent, String name, String TCPPort, String UDPPort) {
34 tdb 1.1 _logRef = logger;
35     _name = name;
36 tdb 1.3 _parent = parent;
37 tdb 1.4 _TCPPort = TCPPort;
38     _UDPPort = UDPPort;
39 tdb 1.1 _logRef.write(this.toString(), Logger.SYSINIT, "created");
40     }
41    
42     //---PUBLIC METHODS---
43    
44     /**
45     * Method to receive a string over corba.
46     *
47     * @param xml the String of XML to print out
48     */
49     public void receiveXML(String xml) {
50 tdb 1.6 //_logRef.write(this.toString(), Logger.SYSMSG, "received XML: "+xml);
51 tdb 1.5 FilterThread t = new FilterThread(xml, _parent, _logRef);
52     t.start();
53 tdb 1.1 }
54    
55     /**
56     * Overrides the {@link java.lang.Object#toString() Object.toString()}
57     * method to provide clean logging (every class should have this).
58     *
59     * @return the name of this class and its CVS revision
60     */
61     public String toString() {
62     return this.getClass().getName() + "{" + _name + "}(" + REVISION.substring(11, REVISION.length() - 2) + ")";
63     }
64    
65     //---PRIVATE METHODS---
66    
67     //---ACCESSOR/MUTATOR METHODS---
68    
69 tdb 1.4 public String getUDPPort() {
70     return _UDPPort;
71     }
72    
73     public String getTCPPort() {
74     return _TCPPort;
75     }
76    
77     public String getHostName() {
78     try {
79     return InetAddress.getLocalHost().getHostName();
80     } catch (java.net.UnknownHostException e) {
81     _logRef.write(toString(), Logger.ERROR, e.getMessage());
82     }
83     return null;
84     }
85    
86    
87 tdb 1.1 //---ATTRIBUTES---
88    
89     /**
90     * Reference to a Logger
91     */
92     private Logger _logRef;
93    
94     /**
95     * Our name
96     */
97     private String _name;
98 tdb 1.3
99     /**
100     * Our parent filter
101     */
102     private Filter _parent;
103 tdb 1.4
104     private String _UDPPort;
105     private String _TCPPort;
106 tdb 1.1
107     //---STATIC ATTRIBUTES---
108    
109     }