# service group context
[Context Hierarchy]

## Files
file | axis2_svc_grp_ctx.h
## Typedefs
typedef struct axis2_svc_grp_ctx | axis2_svc_grp_ctx_t
## Functions
AXIS2_EXTERN axis2_svc_grp_ctx_t * | axis2_svc_grp_ctx_create (const axutil_env_t *env, struct axis2_svc_grp *svc_grp, struct axis2_conf_ctx *conf_ctx)
AXIS2_EXTERN axis2_ctx_t * | axis2_svc_grp_ctx_get_base (const axis2_svc_grp_ctx_t *svc_grp_ctx, const axutil_env_t *env)
AXIS2_EXTERN struct axis2_conf_ctx * | axis2_svc_grp_ctx_get_parent (const axis2_svc_grp_ctx_t *svc_grp_ctx, const axutil_env_t *env)
AXIS2_EXTERN void | axis2_svc_grp_ctx_free (struct axis2_svc_grp_ctx *svc_grp_ctx, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_ctx_init (struct axis2_svc_grp_ctx *svc_grp_ctx, const axutil_env_t *env, struct axis2_conf *conf)
AXIS2_EXTERN const axis2_char_t * | axis2_svc_grp_ctx_get_id (const axis2_svc_grp_ctx_t *svc_grp_ctx, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_ctx_set_id (struct axis2_svc_grp_ctx *svc_grp_ctx, const axutil_env_t *env, const axis2_char_t *id)
AXIS2_EXTERN struct axis2_svc_ctx * | axis2_svc_grp_ctx_get_svc_ctx (const axis2_svc_grp_ctx_t *svc_grp_ctx, const axutil_env_t *env, const axis2_char_t *svc_name)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_ctx_fill_svc_ctx_map (struct axis2_svc_grp_ctx *svc_grp_ctx, const axutil_env_t *env)
AXIS2_EXTERN struct axis2_svc_grp * | axis2_svc_grp_ctx_get_svc_grp (const axis2_svc_grp_ctx_t *svc_grp_ctx, const axutil_env_t *env)
AXIS2_EXTERN axutil_hash_t * | axis2_svc_grp_ctx_get_svc_ctx_map (const axis2_svc_grp_ctx_t *svc_grp_ctx, const axutil_env_t *env)

## Detailed Description

service group context represents a running "instance" of a service group. service group context allows instance of services belonging to a service group to be grouped.

## Typedef Documentation

typedef struct axis2_svc_grp_ctx axis2_svc_grp_ctx_t

Type name for struct svc_grp_ctx

## Function Documentation

AXIS2_EXTERN axis2_svc_grp_ctx_t* axis2_svc_grp_ctx_create | ( | const axutil_env_t * | env,
|  | struct axis2_svc_grp * | svc_grp,
|  | struct axis2_conf_ctx * | conf_ctx |
| ) |  |  |

Creates a service group context struct.

Parameters:

  | env | pointer to environment struct
  | svc_grp | pointer to service group that this service context represents, service group context does not assume the ownership of the struct
  | conf_ctx | pointer to configuration context, the parent context of the newly created service group context, service group context does not assume the ownership of the struct

Returns:
  pointer to newly created service group context

AXIS2_EXTERN axis2_status_t axis2_svc_grp_ctx_fill_svc_ctx_map | ( | struct axis2_svc_grp_ctx * | svc_grp_ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Fills service context map. This will create one service context per each service in the service group related to this service context.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN void axis2_svc_grp_ctx_free | ( | struct axis2_svc_grp_ctx * | svc_grp_ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Frees service group context.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct

Returns:
  void

AXIS2_EXTERN axis2_ctx_t* axis2_svc_grp_ctx_get_base | ( | const axis2_svc_grp_ctx_t * | svc_grp_ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets base which is of type context.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment

Returns:
  pointer to base context struct, returns a reference not a cloned copy

AXIS2_EXTERN const axis2_char_t* axis2_svc_grp_ctx_get_id | ( | const axis2_svc_grp_ctx_t * | svc_grp_ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets service group context ID.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct

Returns:
  service group context ID string

AXIS2_EXTERN struct axis2_conf_ctx* axis2_svc_grp_ctx_get_parent | ( | const axis2_svc_grp_ctx_t * | svc_grp_ctx,
|  | const axutil_env_t * | env |
| ) |  |  | `[read]`

Gets parent. configuration context is the parent of any service group context instance.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct

Returns:
  pointer to configuration context, parent of service group

AXIS2_EXTERN struct axis2_svc_ctx* axis2_svc_grp_ctx_get_svc_ctx | ( | const axis2_svc_grp_ctx_t * | svc_grp_ctx,
|  | const axutil_env_t * | env,
|  | const axis2_char_t * | svc_name |
| ) |  |  | `[read]`

Gets named service context.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct
  | svc_name | name of service context to be retrieved

Returns:
  pointer to named service context

AXIS2_EXTERN axutil_hash_t* axis2_svc_grp_ctx_get_svc_ctx_map | ( | const axis2_svc_grp_ctx_t * | svc_grp_ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets service context map containing all service contexts.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct

Returns:
  pointer to hash table containing the service context map

AXIS2_EXTERN struct axis2_svc_grp* axis2_svc_grp_ctx_get_svc_grp | ( | const axis2_svc_grp_ctx_t * | svc_grp_ctx,
|  | const axutil_env_t * | env |
| ) |  |  | `[read]`

Gets service group related to this service context.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct

Returns:
  pointer to service group that this service group context represents

AXIS2_EXTERN axis2_status_t axis2_svc_grp_ctx_init | ( | struct axis2_svc_grp_ctx * | svc_grp_ctx,
|  | const axutil_env_t * | env,
|  | struct axis2_conf * | conf |
| ) |  |  |

Initializes service group context. In this method, it pics the related service group from configuration and keeps a reference for future use.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct
  | conf | pointer to configuration

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t axis2_svc_grp_ctx_set_id | ( | struct axis2_svc_grp_ctx * | svc_grp_ctx,
|  | const axutil_env_t * | env,
|  | const axis2_char_t * | id |
| ) |  |  |

Sets service group context ID.

Parameters:

  | svc_grp_ctx | pointer to service group context
  | env | pointer to environment struct
  | id | service group context ID

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE