KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > classic > SSLClassicAdmin


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - 2004 ScalAgent Distributed Technologies
4  * Copyright (C) 2004 - Bull SA
5  * Copyright (C) 1996 - 2000 Dyade
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA.
21  *
22  * Initial developer(s): Frederic Maistre (INRIA)
23  * Contributor(s): ScalAgent Distributed Technologies
24  */

25 package classic;
26
27 import org.objectweb.joram.client.jms.admin.*;
28 import org.objectweb.joram.client.jms.*;
29 import org.objectweb.joram.client.jms.tcp.*;
30
31
32 /**
33  * Administers an agent server for the ssl classic samples.
34  */

35 public class SSLClassicAdmin
36 {
37   public static void main(String JavaDoc[] args) throws Exception JavaDoc
38   {
39     System.out.println();
40     System.out.println("SSL Classic administration...");
41
42     AdminModule.connect("root", "root", 60, "org.objectweb.joram.client.jms.tcp.ReliableSSLTcpClient");
43
44     Queue queue = (Queue) Queue.create("queue");
45     Topic topic = (Topic) Topic.create("topic");
46     
47     User user = User.create("anonymous", "anonymous");
48
49     queue.setFreeReading();
50     topic.setFreeReading();
51     queue.setFreeWriting();
52     topic.setFreeWriting();
53
54     javax.jms.ConnectionFactory JavaDoc cf =
55       TcpConnectionFactory.create("localhost",
56                                   16010,
57                                   "org.objectweb.joram.client.jms.tcp.ReliableSSLTcpClient");
58     javax.jms.QueueConnectionFactory JavaDoc qcf =
59       QueueTcpConnectionFactory.create("localhost",
60                                        16010,
61                                        "org.objectweb.joram.client.jms.tcp.ReliableSSLTcpClient");
62     javax.jms.TopicConnectionFactory JavaDoc tcf =
63       TopicTcpConnectionFactory.create("localhost",
64                                        16010,
65                                        "org.objectweb.joram.client.jms.tcp.ReliableSSLTcpClient");
66
67     javax.naming.Context JavaDoc jndiCtx = new javax.naming.InitialContext JavaDoc();
68     jndiCtx.bind("cf", cf);
69     jndiCtx.bind("qcf", qcf);
70     jndiCtx.bind("tcf", tcf);
71     jndiCtx.bind("queue", queue);
72     jndiCtx.bind("topic", topic);
73     jndiCtx.close();
74
75     AdminModule.disconnect();
76     System.out.println("SSL Admin closed.");
77   }
78 }
79
Popular Tags