KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.misc.TypeCast;
37
38 import com.sun.appserv.management.ext.logging.LogQueryResult;
39 import com.sun.appserv.management.ext.logging.LogQueryResultImpl;
40
41
42 /**
43     Specialized handler for {@link com.sun.appserv.management.ext.logging.Logging}.
44  */

45 final class LoggingConverterHandler extends ConverterHandler
46 {
47         public
48     LoggingConverterHandler(
49         final ConnectionSource connectionSource,
50         final ObjectName JavaDoc proxiedMBeanObjectName )
51         throws IOException JavaDoc
52     {
53         super( connectionSource, proxiedMBeanObjectName );
54     }
55     
56     /**
57         @override
58      */

59         protected Object JavaDoc
60     convertResult(
61         final Method JavaDoc method,
62         final Object JavaDoc resultIn )
63     {
64         Object JavaDoc resultOut = resultIn;
65         
66         if ( method.getName().equals( "queryServerLog" ) )
67         {
68             final List JavaDoc<Serializable JavaDoc[]> ls = TypeCast.asList( resultIn );
69             
70             final LogQueryResult converted = new LogQueryResultImpl( ls );
71             resultOut = converted;
72         }
73         
74         return resultOut;
75     }
76 }
77
78
79
80
81
82
Popular Tags