KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > client > handler > ConverterHandlerFactory


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.appserv.management.client.handler;
24
25 import java.lang.reflect.Method JavaDoc;
26
27 import java.util.List JavaDoc;
28
29 import java.io.Serializable JavaDoc;
30 import java.io.IOException JavaDoc;
31
32 import javax.management.ObjectName JavaDoc;
33
34 import com.sun.appserv.management.client.ConnectionSource;
35
36 import com.sun.appserv.management.base.XTypes;
37 import com.sun.appserv.management.base.Util;
38
39 import static com.sun.appserv.management.j2ee.J2EETypes.WEB_SERVICE_ENDPOINT;
40 import static com.sun.appserv.management.base.XTypes.LOGGING;
41 import static com.sun.appserv.management.base.XTypes.WEB_SERVICE_MGR;
42
43 import com.sun.appserv.management.util.misc.TypeCast;
44 import com.sun.appserv.management.util.jmx.MBeanProxyHandler;
45
46 import com.sun.appserv.management.ext.logging.LogQueryResult;
47 import com.sun.appserv.management.ext.logging.LogQueryResultImpl;
48
49
50 /**
51     <b>Private class, not for public use</b>
52  */

53 public final class ConverterHandlerFactory
54 {
55     private ConverterHandlerFactory() {}
56     
57         public static MBeanProxyHandler
58     createHandler(
59         final ConnectionSource connSource,
60         final ObjectName JavaDoc objectName )
61         throws IOException JavaDoc
62     {
63         final String JavaDoc j2eeType = Util.getJ2EEType( objectName );
64         
65         AMXProxyHandler handler = null;
66         
67         if ( LOGGING.equals( j2eeType ) )
68         {
69             handler = new LoggingConverterHandler( connSource, objectName );
70         }
71         else if ( WEB_SERVICE_ENDPOINT.equals( j2eeType ) )
72         {
73             handler = new WebServiceEndpointConverterHandler( connSource, objectName );
74             // getMessagesInHistory()
75
}
76         else if ( WEB_SERVICE_MGR.equals( j2eeType ) )
77         {
78             handler = new WebServiceMgrConverterHandler( connSource, objectName );
79             // getWebServiceEndpointInfo()
80
}
81         else
82         {
83             handler = new AMXProxyHandler( connSource, objectName );
84         }
85         
86         return handler;
87     }
88     
89 }
90
91
92
93
94
95
Popular Tags