KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soap > SoapAdmin


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2004 - Bull SA
4  * Copyright (C) 2004 - ScalAgent Distributed Technologies
5  * Copyright (C) 1996 - 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):
24  */

25 package soap;
26
27 import org.objectweb.joram.client.jms.admin.*;
28 import org.objectweb.joram.client.jms.*;
29 import org.objectweb.joram.client.jms.soap.TopicSoapConnectionFactory;
30
31
32 /**
33  * Administers a platform for the soap samples.
34  */

35 public class SoapAdmin
36 {
37   public static void main(String JavaDoc[] args) throws Exception JavaDoc
38   {
39     System.out.println();
40     System.out.println("Soap administration...");
41
42     TopicSoapConnectionFactory soapCf = (TopicSoapConnectionFactory)
43       TopicSoapConnectionFactory.create("localhost", 8080, 60);
44     soapCf.getParameters().connectingTimer = 60;
45
46     AdminModule.connect(soapCf, "root", "root");
47
48     Queue queue = (Queue) Queue.create(0);
49     Topic topic = (Topic) Topic.create(0);
50
51     User soapUser = User.create("anonymous", "anonymous", 1);
52
53     queue.setFreeReading();
54     queue.setFreeWriting();
55     topic.setFreeReading();
56     topic.setFreeWriting();
57
58     AdminModule.disconnect();
59
60     javax.naming.Context JavaDoc jndiCtx = new javax.naming.InitialContext JavaDoc();
61     jndiCtx.bind("soapCf", soapCf);
62     jndiCtx.bind("queue", queue);
63     jndiCtx.bind("topic", topic);
64     jndiCtx.close();
65
66     System.out.println("Admin finished.");
67   }
68 }
69
Popular Tags