1
2 /*
3 * Copyright (c) 2001 Peter Antman Tim <peter.antman@tim.se>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 package javaclients.j2ee.k2;
20
21 import org.xmlBlaster.j2ee.k2.client.*;
22 import org.xmlBlaster.j2ee.k2.*;
23
24 import org.xmlBlaster.util.MsgUnit;
25 /**
26 * TestClient.java
27 *
28 *
29 * Created: Wed Feb 7 21:11:49 2001
30 *
31 * @author
32 * @version
33 */
34
35 public class TestClient {
36
37 public TestClient() {
38
39 }
40
41 public static void main(String[] args) {
42 try {
43 BlasterManagedConnectionFactory f = new BlasterManagedConnectionFactory();
44 f.setClientProtocol("IOR");
45 f.setRmiRegistryPort("1199");
46 BlasterConnectionFactory cf = (BlasterConnectionFactory)f.createConnectionFactory();
47
48
49
50 BlasterConnection con = cf.getConnection("pra", "passw");
51
52 String key ="<key oid=\"News-35\" contentMime=\"text/xml\">" +
53 "<head> <title>Blodiga strider i Kongo-Kinshasa</title></head></key>";
54 String qos = "<qos></qos>";
55 String msg = "Meddelande";
56 con.publish( new MsgUnit(key,msg.getBytes(),qos));
57
58 con.close();
59
60
61 }catch(Exception ex) {
62 System.err.println("Error: " + ex);
63 ex.printStackTrace();
64 }
65 }
66
67 } // TestClient
syntax highlighted by Code2HTML, v. 0.9.1