30 |
|
/** |
31 |
|
* Creates a new FilterServant. |
32 |
|
* |
33 |
– |
* @param TCPListenPort the TCP port this filter is listening on |
34 |
– |
* @param UDPListenPort the UDP port this filter is listening on |
33 |
|
* @param queue the Queue this filter is using |
34 |
|
*/ |
35 |
< |
public FilterServant(int TCPListenPort, int UDPListenPort, Queue queue) { |
38 |
< |
_TCPListenPort = TCPListenPort; |
39 |
< |
_UDPListenPort = UDPListenPort; |
35 |
> |
public FilterServant(Queue queue) { |
36 |
|
_queue = queue; |
37 |
|
_logger.write(toString(), Logger.SYSINIT, "started"); |
38 |
|
} |
68 |
|
|
69 |
|
//---ACCESSOR/MUTATOR METHODS--- |
70 |
|
|
75 |
– |
/** |
76 |
– |
* Provides information to the FilterManager |
77 |
– |
*/ |
78 |
– |
public String getUDPPort() { |
79 |
– |
return new Integer(_UDPListenPort).toString(); |
80 |
– |
} |
81 |
– |
|
82 |
– |
/** |
83 |
– |
* Provides information to the FilterManager |
84 |
– |
*/ |
85 |
– |
public String getTCPPort() { |
86 |
– |
return new Integer(_TCPListenPort).toString(); |
87 |
– |
} |
88 |
– |
|
89 |
– |
/** |
90 |
– |
* Provides information to the FilterManager |
91 |
– |
*/ |
92 |
– |
public String getHostName() { |
93 |
– |
try { |
94 |
– |
// hacky fix for windows boxes, where getHostName() returns the NetBIOS name ! |
95 |
– |
return InetAddress.getByName(InetAddress.getLocalHost().getHostAddress()).getHostName(); |
96 |
– |
} catch (java.net.UnknownHostException e) { |
97 |
– |
_logger.write(toString(), Logger.ERROR, e.getMessage()); |
98 |
– |
} |
99 |
– |
return null; |
100 |
– |
} |
101 |
– |
|
102 |
– |
|
71 |
|
//---ATTRIBUTES--- |
72 |
|
|
73 |
|
/** |
91 |
|
* Our Queue object |
92 |
|
*/ |
93 |
|
private Queue _queue; |
126 |
– |
|
127 |
– |
/** |
128 |
– |
* The UDP port we're listening on |
129 |
– |
*/ |
130 |
– |
private int _UDPListenPort; |
131 |
– |
|
132 |
– |
/** |
133 |
– |
* The TCP port we're listening on |
134 |
– |
*/ |
135 |
– |
private int _TCPListenPort; |
94 |
|
|
95 |
|
//---STATIC ATTRIBUTES--- |
96 |
|
|