KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > time > TimeBeanHandler


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: TimeBeanHandler.java,v 1.3 2004/12/24 11:46:45 durieuxp Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.jonas.jtests.beans.time;
26
27 import javax.xml.namespace.QName JavaDoc;
28 import javax.xml.rpc.handler.GenericHandler JavaDoc;
29 import javax.xml.rpc.handler.HandlerInfo JavaDoc;
30 import javax.xml.rpc.handler.MessageContext JavaDoc;
31
32 import org.objectweb.jonas.common.Log;
33 import org.objectweb.util.monolog.api.BasicLevel;
34 import org.objectweb.util.monolog.api.Logger;
35
36
37 /**
38  *
39  *
40  * @author Guillaume Sauthier
41  */

42 public class TimeBeanHandler extends GenericHandler JavaDoc {
43
44     private Logger logger = null;
45
46     /**
47      * The <code>init</code> method to enable the Handler instance to
48      * initialize itself.
49      * @param config handler configuration
50      */

51     public void init(HandlerInfo JavaDoc hinfo) {
52         if (logger == null) {
53             logger = Log.getLogger("org.objectweb.jonas_tests");
54         }
55         logger.log(BasicLevel.DEBUG, "");
56         String JavaDoc val = (String JavaDoc) hinfo.getHandlerConfig().get("jonas.test.server.handler");
57         StaticPassValue spv = StaticPassValue.getInstance();
58         spv.setInitValue(val);
59     }
60
61     /**
62      * The <code>destroy</code> method indicates the end of lifecycle
63      * for a Handler instance.
64      */

65     public void destroy() {
66         logger.log(BasicLevel.DEBUG, "");
67     }
68
69     /**
70      * The <code>handleRequest</code> method processes the request
71      * SOAP message. The default implementation of this method returns
72      * <code>true</code>. This indicates that the handler chain
73      * should continue processing of the request SOAP message.
74      * @param context the message context
75      * @return true/false
76      */

77     public boolean handleRequest(MessageContext JavaDoc mc) {
78         logger.log(BasicLevel.DEBUG, "");
79         StaticPassValue spv = StaticPassValue.getInstance();
80         spv.setRequestValue("handlerRequest-Invoked");
81         return true;
82     }
83
84     /**
85      * The <code>handleResponse</code> method processes the response
86      * message. The default implementation of this method returns
87      * <code>true</code>. This indicates that the handler chain
88      * should continue processing of the response SOAP message.
89      * @param context the message context
90      * @return true/false
91      */

92     public boolean handleResponse(MessageContext JavaDoc context) {
93         logger.log(BasicLevel.DEBUG, "");
94         return true;
95     }
96
97     /**
98      * The <code>handleFault</code> method processes the SOAP faults
99      * based on the SOAP message processing model. The default
100      * implementation of this method returns <code>true</code>. This
101      * indicates that the handler chain should continue processing
102      * of the SOAP fault.
103      * @param context the message context
104      * @return true/false
105      */

106     public boolean handleFault(MessageContext JavaDoc context) {
107         logger.log(BasicLevel.DEBUG, "");
108         return true;
109     }
110
111     /**
112      * Gets the header blocks processed by this Handler instance.
113      *
114      * @return Array of QNames of header blocks processed by this handler instance.
115      * <code>QName</code> is the qualified name of the outermost element of the Header block.
116      */

117     public QName JavaDoc[] getHeaders() {
118         logger.log(BasicLevel.DEBUG, "");
119         return new QName JavaDoc[0];
120     }
121
122 }
123
Popular Tags