ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/PluginManager/PluginDemo.java
Revision: 1.1
Committed: Fri Dec 1 09:50:35 2000 UTC (23 years, 5 months ago) by pjm2
Branch: MAIN
Log Message:
An experimental Plugin Filter Pipeline "proof of concept" Demonstration.
Run "java PluginDemo" to see what it does.

PluginFilters implement the PluginFilter interface.

File Contents

# Content
1 // a demo program to make and use a plugin filter manager
2
3 // pjm2@ukc.ac.uk
4
5 class PluginDemo {
6
7
8 // Test the PluginFilterManager with some XMLPackets.
9 public static void main(String[] args){
10
11 PluginFilterManager pfm = PluginFilterManager.init();
12
13 // Some XMLPackets to test with...
14 XMLPacket validPacket = new XMLPacket();
15 XMLPacket emptyPacket = new XMLPacket();
16 XMLPacket nearlyEmptyPacket = new XMLPacket();
17
18 // Add some stuff to the valid packet (i.e. all essential info)
19 validPacket.addParam("machine_name", "raptor");
20 validPacket.addParam("ip", "129.12.225.53");
21 validPacket.addParam("seq_no", "552");
22 validPacket.addParam("date", "934999665636");
23
24 // Add nothing to the empty packet
25
26 // Add just the machine name to the nearly empty packet.
27 nearlyEmptyPacket.addParam("machine_name", "craptor");
28
29 // Run the XMLPackets through the filter pipeline.
30 System.out.println("");
31 System.out.println("Well, did they make it through the filter pipeline?!");
32 System.out.println("validPacket: "+pfm.runFilters(validPacket));
33 System.out.println("emptyPacket: "+pfm.runFilters(emptyPacket));
34 System.out.println("nearlyEmptyPacket: "+pfm.runFilters(nearlyEmptyPacket));
35
36 }
37
38 }