ServiceSkeleton.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2005-2009 WSO2, Inc. http://wso2.com
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef SERVICESKELETON_H
00018 #define SERVICESKELETON_H
00019 
00020 #include <WSFDefines.h>
00021 #include <OMElement.h>
00022 #include <string>
00023 #include <MessageContext.h>
00024 
00031 #define WSF_SERVICE_INIT(class_name) \
00032 extern "C" \
00033 {\
00034 \
00035         WSF_EXTERN int \
00036                 axis2_get_instance( \
00037                 ServiceSkeleton ** inst, \
00038                 const axutil_env_t * env) \
00039         { \
00040                 *inst = new class_name(); \
00041                 if (!(*inst)) \
00042                 { \
00043                         return AXIS2_FAILURE; \
00044                 } \
00045 \
00046                 return AXIS2_SUCCESS; \
00047         } \
00048 \
00049         WSF_EXTERN int \
00050                 axis2_remove_instance( \
00051                 ServiceSkeleton * inst, \
00052                 const axutil_env_t * env) \
00053         { \
00054                 axis2_status_t status = AXIS2_SUCCESS; \
00055                 if (inst) \
00056                 { \
00057                         delete  inst; \
00058                 } \
00059                 return status; \
00060         } \
00061 \
00062 } \
00063 
00064 
00073 namespace wso2wsf
00074 {
00087     class WSF_EXTERN ServiceSkeleton
00088     {
00089     public:
00101         virtual OMElement* WSF_CALL invoke(OMElement* omEle, MessageContext *msgCtx){ return NULL;};
00102 
00109         virtual OMElement* WSF_CALL onFault(OMElement* omEle){return NULL;};
00110 
00114         virtual void WSF_CALL init(){};
00118         virtual WSF_CALL ~ServiceSkeleton();
00119     };
00122     /* inline implementation of the service skeleton destructor. */
00123     inline WSF_CALL ServiceSkeleton::~ServiceSkeleton()
00124     {}
00125 }
00126 #endif // SERVICESKELETON_H

Generated on Wed Oct 14 00:43:25 2009 for WSF/CPP by  doxygen 1.5.7.1