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
00037 #include <axis2_defines.h>
00038 #include <axis2_env.h>
00039 #include <axis2_handler.h>
00040 #include <axis2_handler_desc.h>
00041 #include <axis2_array_list.h>
00042 #include <axis2_qname.h>
00043
00048 #define AXIS2_PHASE_BOTH_BEFORE_AFTER 0
00049
00054 #define AXIS2_PHASE_BEFORE 1
00055
00060 #define AXIS2_PHASE_AFTER 2
00061
00066 #define AXIS2_PHASE_ANYWHERE 3
00067
00068 #ifdef __cplusplus
00069 extern "C"
00070 {
00071 #endif
00072
00074 typedef struct axis2_phase_ops axis2_phase_ops_t;
00076 typedef struct axis2_phase axis2_phase_t;
00077
00078 struct axis2_msg_ctx;
00079
00084 struct axis2_phase_ops
00085 {
00095 axis2_status_t (AXIS2_CALL *
00096 add_handler_at)(
00097 axis2_phase_t *phase,
00098 const axis2_env_t *env,
00099 const int index,
00100 axis2_handler_t *handler);
00101
00110 axis2_status_t (AXIS2_CALL *
00111 add_handler)(
00112 axis2_phase_t *phase,
00113 const axis2_env_t *env,
00114 axis2_handler_t *handler);
00115
00125 axis2_status_t (AXIS2_CALL *
00126 invoke)(
00127 axis2_phase_t *phase,
00128 const axis2_env_t *env,
00129 struct axis2_msg_ctx *msg_ctx);
00136 const axis2_char_t *(AXIS2_CALL *
00137 get_name)(
00138 const axis2_phase_t *phase,
00139 const axis2_env_t *env);
00140
00147 int (AXIS2_CALL *
00148 get_handler_count)(
00149 const axis2_phase_t *phase,
00150 const axis2_env_t *env);
00151
00160 axis2_status_t (AXIS2_CALL *
00161 set_first_handler)(
00162 axis2_phase_t *phase,
00163 const axis2_env_t *env,
00164 axis2_handler_t *handler);
00165
00174 axis2_status_t (AXIS2_CALL *
00175 set_last_handler)(
00176 axis2_phase_t *phase,
00177 const axis2_env_t *env,
00178 axis2_handler_t *handler);
00179
00190 axis2_status_t (AXIS2_CALL *
00191 add_handler_desc)(
00192 axis2_phase_t *phase,
00193 const axis2_env_t *env,
00194 axis2_handler_desc_t *handler_desc);
00195
00208 axis2_status_t (AXIS2_CALL *
00209 insert_before)(
00210 axis2_phase_t *phase,
00211 const axis2_env_t *env,
00212 axis2_handler_t *handler);
00213
00226 axis2_status_t (AXIS2_CALL *
00227 insert_after)(
00228 axis2_phase_t *phase,
00229 const axis2_env_t *env,
00230 axis2_handler_t *handler);
00231
00244 axis2_status_t (AXIS2_CALL *
00245 insert_before_and_after)(
00246 axis2_phase_t *phase,
00247 const axis2_env_t *env,
00248 axis2_handler_t *handler);
00249
00260 axis2_status_t (AXIS2_CALL *
00261 insert_handler_desc)(
00262 axis2_phase_t *phase,
00263 const axis2_env_t *env,
00264 axis2_handler_desc_t *handler_desc);
00265
00272 axis2_array_list_t *(AXIS2_CALL *
00273 get_all_handlers)(
00274 const axis2_phase_t *phase,
00275 const axis2_env_t *env);
00276
00286 axis2_status_t (AXIS2_CALL *
00287 invoke_start_from_handler)(
00288 axis2_phase_t *phase,
00289 const axis2_env_t *env,
00290 const int paused_handler_index,
00291 struct axis2_msg_ctx *msg_ctx);
00292
00299 axis2_status_t (AXIS2_CALL *
00300 free)(
00301 axis2_phase_t *phase,
00302 const axis2_env_t *env);
00303
00304 };
00305
00309 struct axis2_phase
00310 {
00312 axis2_phase_ops_t *ops;
00313 };
00314
00315
00322 AXIS2_EXTERN axis2_phase_t *AXIS2_CALL
00323 axis2_phase_create(
00324 const axis2_env_t *env,
00325 const axis2_char_t *phase_name);
00326
00329 #define AXIS2_PHASE_ADD_HANDLER_AT(phase, env, index, handler) \
00330 ((phase)->ops->add_handler_at(phase, env, index, handler))
00331
00334 #define AXIS2_PHASE_ADD_HANDLER(phase, env, handler) \
00335 ((phase)->ops->add_handler(phase, env, handler))
00336
00339 #define AXIS2_PHASE_ADD_HANDLER_DESC(phase, env, handler_desc) \
00340 ((phase)->ops->add_handler_desc(phase, env, handler_desc))
00341
00346 #define AXIS2_PHASE_INVOKE(phase, env, msg_ctx) \
00347 ((phase)->ops->invoke(phase, env, msg_ctx))
00348
00351 #define AXIS2_PHASE_GET_NAME(phase, env) \
00352 ((phase)->ops->get_name(phase, env))
00353
00356 #define AXIS2_PHASE_GET_HANDLER_COUNT(phase, env) \
00357 ((phase)->ops->get_handler_count(phase, env))
00358
00361 #define AXIS2_PHASE_SET_FIRST_HANDLER(phase, env, handler) \
00362 ((phase)->ops->set_first_handler(phase, env, handler))
00363
00366 #define AXIS2_PHASE_SET_LAST_HANDLER(phase, env, handler) \
00367 ((phase)->ops->set_last_handler(phase, env, handler))
00368
00371 #define AXIS2_PHASE_INSERT_BEFORE(phase, env, handler) \
00372 ((phase)->ops->insert_before(phase, env, handler))
00373
00376 #define AXIS2_PHASE_INSERT_AFTER(phase, env, handler) \
00377 ((phase)->ops->insert_after(phase, env, handler))
00378
00382 #define AXIS2_PHASE_INSERT_BEFORE_AND_AFTER(phase, env, handler) \
00383 ((phase)->ops->insert_before_and_after(phase, env, handler))
00384
00387 #define AXIS2_PHASE_INSERT_HANDLER_DESC(phase, env, handler_desc) \
00388 ((phase)->ops->insert_handler_desc(phase, env, handler_desc))
00389
00392 #define AXIS2_PHASE_GET_ALL_HANDLERS(phase, env) \
00393 ((phase)->ops->get_all_handlers(phase, env))
00394
00397 #define AXIS2_PHASE_INVOKE_START_FROM_HANDLER(phase, env, paused_handler_index, \
00398 msg_ctx) \
00399 ((phase)->ops->invoke_start_from_handler(phase, env, paused_handler_index, \
00400 msg_ctx))
00401
00404 #define AXIS2_PHASE_FREE(phase, env) \
00405 ((phase)->ops->free(phase, env))
00406
00409 #ifdef __cplusplus
00410 }
00411 #endif
00412
00413 #endif