001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019:
020: package org.apache.axis2.handlers;
021:
022: import org.apache.axis2.context.MessageContext;
023: import org.apache.axis2.description.HandlerDescription;
024: import org.apache.axis2.description.Parameter;
025: import org.apache.axis2.engine.Handler;
026:
027: /**
028: * Class AbstractHandler
029: */
030: public abstract class AbstractHandler implements Handler {
031:
032: /**
033: * Field handlerDesc
034: */
035: protected HandlerDescription handlerDesc;
036:
037: /**
038: * Constructor AbstractHandler.
039: */
040: public AbstractHandler() {
041: handlerDesc = new HandlerDescription("DefaultHandler");
042: }
043:
044: /**
045: * Since this might change the whole behavior of Axis2 handlers, and since this is still under discussion
046: * (http://marc.theaimsgroup.com/?l=axis-dev&m=114504084929285&w=2) implementation of this method is deferred.
047: * Note : This method will not be automatically called, from Axis2 engine, until this is fully implemented.
048: */
049: public void cleanup() {
050: }
051:
052: /**
053: * Method init.
054: *
055: */
056: public void init(HandlerDescription handlerdesc) {
057: this .handlerDesc = handlerdesc;
058: }
059:
060: /*
061: * (non-Javadoc)
062: * @see java.lang.Object#toString()
063: */
064: public String toString() {
065: String name = this .getName();
066:
067: return (name != null) ? name : null;
068: }
069:
070: /**
071: * Gets the phaseRule of a handler.
072: *
073: * @return Returns HandlerDescription.
074: */
075: public HandlerDescription getHandlerDesc() {
076: return handlerDesc;
077: }
078:
079: /**
080: * Method getName.
081: *
082: * @return Returns QName.
083: */
084: public String getName() {
085: return handlerDesc.getName();
086: }
087:
088: /**
089: * Method getParameter.
090: *
091: * @param name name of the parameter
092: * @return Returns Parameter.
093: */
094: public Parameter getParameter(String name) {
095: return handlerDesc.getParameter(name);
096: }
097:
098: public void flowComplete(MessageContext msgContext) {
099: }
100: }
|