KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > joram > mom > proxies > MessageJMXWrapper


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

26 package org.objectweb.joram.mom.proxies;
27
28 import javax.management.openmbean.*;
29
30 import org.objectweb.joram.mom.messages.Message;
31
32 import java.util.Hashtable JavaDoc;
33 import java.util.Collection JavaDoc;
34
35 public class MessageJMXWrapper {
36
37   public final static String JavaDoc[] itemNames = {
38     "id", "priority"};
39
40   public final static String JavaDoc[] itemDescs = {
41     "xxx", "xxx"};
42
43   public final static OpenType[] itemTypes = {
44     SimpleType.STRING, SimpleType.INTEGER};
45
46   public static CompositeDataSupport createCompositeDataSupport(
47     Message msg) throws Exception JavaDoc {
48     return new CompositeDataSupport(
49       new CompositeType("Message",
50                         "xxx",
51                         itemNames,
52                         itemDescs,
53                         itemTypes),
54       itemNames,
55       new Object JavaDoc[]{msg.getIdentifier(),
56                    new Integer JavaDoc(msg.getPriority())});
57   }
58 }
59
Popular Tags