00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef AXIS2_PHASE_H
00018 #define AXIS2_PHASE_H
00019
00025 #include <axis2_defines.h>
00026 #include <axis2_env.h>
00027 #include <axis2_handler.h>
00028 #include <axis2_handler_desc.h>
00029 #include <axis2_array_list.h>
00030 #include <axis2_qname.h>
00031
00032 #ifdef __cplusplus
00033 extern "C"
00034 {
00035 #endif
00036
00037 #define AXIS2_PHASE_BOTH_BEFORE_AFTER 0
00038
00039 #define AXIS2_PHASE_BEFORE 1
00040
00041 #define AXIS2_PHASE_AFTER 2
00042
00043 #define AXIS2_PHASE_ANYWHERE 3
00044
00045 struct axis2_phase_ops;
00046 struct axis2_phase;
00047 struct axis2_msg_ctx;
00048
00058 AXIS2_DECLARE_DATA typedef struct axis2_phase_ops
00059 {
00066 axis2_status_t (AXIS2_CALL *
00067 add_handler_at)(struct axis2_phase *phase,
00068 const axis2_env_t *env,
00069 int index,
00070 axis2_handler_t *hander);
00076 axis2_status_t (AXIS2_CALL *
00077 add_handler)(struct axis2_phase *phase,
00078 const axis2_env_t *env,
00079 axis2_handler_t *handler);
00085 axis2_status_t (AXIS2_CALL *
00086 invoke)(struct axis2_phase *phase,
00087 const axis2_env_t *env,
00088 struct axis2_msg_ctx *msg_ctx);
00093 axis2_char_t* (AXIS2_CALL *
00094 get_name)(struct axis2_phase *phase,
00095 const axis2_env_t *env);
00096
00097 int (AXIS2_CALL *
00098 get_handler_count)(struct axis2_phase *phase,
00099 const axis2_env_t *env);
00100
00106 axis2_status_t (AXIS2_CALL *
00107 set_first_handler)(struct axis2_phase *phase,
00108 const axis2_env_t *env,
00109 axis2_handler_t * handler);
00115 axis2_status_t (AXIS2_CALL *
00116 set_last_handler)(struct axis2_phase *phase,
00117 const axis2_env_t *env,
00118 axis2_handler_t * handler);
00124 axis2_status_t (AXIS2_CALL *
00125 add_handler_desc)(struct axis2_phase *phase,
00126 const axis2_env_t *env,
00127 axis2_handler_desc_t * handler_desc);
00133 axis2_status_t (AXIS2_CALL *
00134 insert_before)(struct axis2_phase *phase,
00135 const axis2_env_t *env,
00136 axis2_handler_t * handler);
00137
00143 axis2_status_t (AXIS2_CALL *
00144 insert_after)(struct axis2_phase *phase,
00145 const axis2_env_t *env,
00146 axis2_handler_t * handler);
00147
00154 axis2_status_t (AXIS2_CALL *
00155 insert_before_and_after)(struct axis2_phase *phase,
00156 const axis2_env_t *env,
00157 axis2_handler_t * handler);
00158
00159 axis2_status_t (AXIS2_CALL *
00160 insert_handler_desc)(struct axis2_phase *phase,
00161 const axis2_env_t *env,
00162 axis2_handler_desc_t * handler_desc);
00163
00169 axis2_array_list_t* (AXIS2_CALL *
00170 get_handlers)(struct axis2_phase *phase,
00171 const axis2_env_t *env);
00172
00173 axis2_status_t (AXIS2_CALL *
00174 invoke_start_from_handler)(struct axis2_phase *phase,
00175 const axis2_env_t *env,
00176 axis2_qname_t *qname,
00177 struct axis2_msg_ctx *msg_ctx);
00178
00179
00180 axis2_status_t (AXIS2_CALL *
00181 free)(struct axis2_phase *phase,
00182 const axis2_env_t *env);
00183
00184 } axis2_phase_ops_t;
00185
00189 typedef struct axis2_phase
00190 {
00192 axis2_phase_ops_t *ops;
00193 } axis2_phase_t;
00194
00195
00199 AXIS2_EXTERN axis2_phase_t* AXIS2_CALL
00200 axis2_phase_create(const axis2_env_t *env,
00201 const axis2_char_t *phase_name);
00202
00203 #define AXIS2_PHASE_ADD_HANDLER_AT(phase, env, index, handler) \
00204 ((phase)->ops->add_handler_at(phase, env, index, handler))
00205
00206 #define AXIS2_PHASE_ADD_HANDLER(phase, env, handler) \
00207 ((phase)->ops->add_handler(phase, env, handler))
00208
00209 #define AXIS2_PHASE_ADD_HANDLER_DESC(phase, env, handler_desc) \
00210 ((phase)->ops->add_handler_desc(phase, env, handler_desc))
00211
00212 #define AXIS2_PHASE_INVOKE(phase, env, msg_ctx) \
00213 ((phase)->ops->invoke(phase, env, msg_ctx))
00214
00215 #define AXIS2_PHASE_GET_NAME(phase, env) \
00216 ((phase)->ops->get_name(phase, env))
00217
00218 #define AXIS2_PHASE_GET_HANDLER_COUNT(phase, env) \
00219 ((phase)->ops->get_handler_count(phase, env))
00220
00221 #define AXIS2_PHASE_SET_FIRST_HANDLER(phase, env, handler) \
00222 ((phase)->ops->set_first_handler(phase, env, handler))
00223
00224 #define AXIS2_PHASE_SET_LAST_HANDLER(phase, env, handler) \
00225 ((phase)->ops->set_last_handler(phase, env, handler))
00226
00227 #define AXIS2_PHASE_INSERT_BEFORE(phase, env, handler) \
00228 ((phase)->ops->insert_before(phase, env, handler))
00229
00230 #define AXIS2_PHASE_INSERT_AFTER(phase, env, handler) \
00231 ((phase)->ops->insert_after(phase, env, handler))
00232
00233 #define AXIS2_PHASE_INSERT_BEFORE_AND_AFTER(phase, env, handler) \
00234 ((phase)->ops->insert_before_and_after(phase, env, handler))
00235
00236 #define AXIS2_PHASE_INSERT_HANDLER_DESC(phase, env, handler_desc) \
00237 ((phase)->ops->insert_handler_desc(phase, env, handler_desc))
00238
00239 #define AXIS2_PHASE_GET_HANDLERS(phase, env) \
00240 ((phase)->ops->get_handlers(phase, env))
00241
00242 #define AXIS2_PHASE_INVOKE_START_FROM_HANDLER(phase, env, qname, msg_ctx) \
00243 ((phase)->ops->invoke_start_from_handler(phase, env, qname, msg_ctx))
00244
00245 #define AXIS2_PHASE_FREE(phase, env) \
00246 ((phase)->ops->free(phase, env))
00247
00250 #ifdef __cplusplus
00251 }
00252 #endif
00253
00254 #endif