apache > ws.apache

## Apache Muse - WS-ServiceGroup - ServiceGroup Capability

Spec name and port type: WS-ServiceGroup v1.2, ServiceGroup (WSDL)

Capability URI: http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroup

Description: This capability allows users to create service groups whose entries represent local or remote resources (that is, resources that are created in the same application space or in other applications). Each entry in the service group is represented as a WS-resource. The complete process for adding service groups to an application is described here.

Java interface: org.apache.muse.ws.resource.sg.ServiceGroup

> JAR file: muse-wsrf-api.jar

Default Java implementation: org.apache.muse.ws.resource.sg.impl.SimpleServiceGroup

> JAR file: muse-wsrf-impl.jar

Action on initialize(): The default implementation checks to make sure that a resource with the WSRF ServiceGroupEntry capability has been deployed in the same application so that it can create entry resources for each of its members. If no such resource type is deployed, initialization will fail.

The capability also registers itself as a listener on the ResourceManager so that it can create (and destroy) the appropriate entry resources each time other resource types are instantiated (or destroyed). This allows users to collect resource types in service groups without writing code to do so explicitly.

Action on initializeCompleted(): None.

Action on prepareShutdown(): None.

Action on shutdown(): All of the ServiceGroup's entry resources are shutdown.

Non-Core Dependencies:

- http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroupEntry

Behavior and Limitations: Muse's implementations of WSRF ServiceGroup are somewhat unique in that they do not use the static wsrf-sg:Content data provided during the creation of a service group entry resource in order to validate the addition of a new member. Instead, the implementation uses the EPR of the potential member service to create a client for the service and read the property values listed in the group's wsrf-sg:MembershipContentRule property. If the service's current properties document has the required properties, the service will become a member of the group; the wsrf-sg:Content element is ignored, since it may be inaccurate.

Each ServiceGroup implementation is a ResourceManagerListener. For every notification it receives of a newly-added resource that matches its membership criteria, a new entry resource is created to represent it. The only exceptions are for the service group resource itself and its entry resources (creating entries for entries would result in an infinite recursion). Similarly, resources are removed from the group when a notification is received that the ResourceManager has removed them.

Service groups with no membership content rules will allow any resource to become a member. You can provide content rules programmatically (before or after initialization) or by using the WSRMD document to set the initial values of the wsrf-sg:MembershipContentRule property.

While this capability allows internal (service-side) code to add entries to the service group manually, it does not expose the Add operation to remote clients. This is done by adding in the WSRF ServiceGroupRegistration capability.

Initialization parameters: None.