KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > management > j2ee > AppClientModule


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software 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 software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.management.j2ee;
23
24 import javax.management.MalformedObjectNameException JavaDoc;
25 import javax.management.ObjectName JavaDoc;
26 import java.security.InvalidParameterException JavaDoc;
27 import java.util.Hashtable JavaDoc;
28
29 /**
30  * Root class of the JBoss JSR-77 implementation of AppClientModule.
31  *
32  * @author <a HREF="mailto:andreas@jboss.org">Andreas Schaefer</a>
33  * @author <a HREF="mailto:thomas.diesler@jboss.org">Thomas Diesler</a>
34  */

35 public class AppClientModule extends J2EEModule
36    implements AppClientModuleMBean
37 {
38
39    // Constants -----------------------------------------------------
40

41    // Attributes ----------------------------------------------------
42

43    // Static --------------------------------------------------------
44

45    // Constructors --------------------------------------------------
46

47    /**
48     * Constructor taking the Name of this Object
49     *
50     * @param pName Name to be set which must not be null
51     * @param pDeploymentDescriptor
52     * @throws InvalidParameterException If the given Name is null
53     */

54    public AppClientModule(String JavaDoc pName, ObjectName JavaDoc pApplication, String JavaDoc[] pJVMs, String JavaDoc pDeploymentDescriptor)
55            throws
56            MalformedObjectNameException JavaDoc,
57            InvalidParentException
58    {
59       super(J2EETypeConstants.AppClientModule, pName, pApplication, pJVMs, pDeploymentDescriptor);
60    }
61    
62    // Public --------------------------------------------------------
63

64    // Object overrides ---------------------------------------------------
65

66    public String JavaDoc toString()
67    {
68       return "AppClientModule { " + super.toString() +
69               " } []";
70    }
71    
72    // Package protected ---------------------------------------------
73

74    // Protected -----------------------------------------------------
75

76    /**
77     * @return A hashtable with the J2EE-Application and J2EE-Server as parent
78     */

79    protected Hashtable JavaDoc getParentKeys(ObjectName JavaDoc pParent)
80    {
81       Hashtable JavaDoc lReturn = new Hashtable JavaDoc();
82       Hashtable JavaDoc lProperties = pParent.getKeyPropertyList();
83       lReturn.put(J2EETypeConstants.J2EEApplication, lProperties.get("name"));
84       // J2EE-Server is already parent of J2EE-Application therefore lookup
85
// the name by the J2EE-Server type
86
lReturn.put(J2EETypeConstants.J2EEServer, lProperties.get(J2EETypeConstants.J2EEServer));
87
88       return lReturn;
89    }
90    
91    // Private -------------------------------------------------------
92

93    // Inner classes -------------------------------------------------
94

95 }
96
Popular Tags