The WSO2 Governance Registry can be extended in several ways. Handlers are pluggable components, that contain custom processing logic for handling resources. All handlers extend an abstract class named Handler
, which provides default implementations for resource handling methods as well as a few utilities useful for concrete handler implementations. Each handler is associated with a filter. Filters provide criteria for engaging handlers. Registry always evaluates the associated filter before invoking a handler. If the filter evaluates to true, it will invoke its associated handler.
Handlers can be engaged to the WSO2 Governance Registry either programmatically, or by defining them in the registry.xml
. Most built-in handlers are engaged by default, whereas optional and user-defined handlers should be configured by defining them in the registry.xml
file. The registry.xml
file includes several optional handlers that can be enabled or disabled according to your requirement.
Service Metadata Handlers
The WSO2 Governance Registry is optimized to support Design-time and Run-time governance for Web Services. There exists handlers that can process WSDL files, schemas and policies. These handlers are even capable of managing related resources such as imported WSDLs and schemas. The service metadata handlers accept several configuration options which allows you to define the associated media type and storage location. For an instance given below is the configuration for WSDLMediaTypeHandler
.
<handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler"> <property name="disableSymlinkCreation">true</property> <property name="schemaLocationConfiguration" type="xml"> <location>/trunk/schemas/</location> </property> <property name="wsdlLocationConfiguration" type="xml"> <location>/trunk/wsdls/</location> </property> <property name="policyLocationConfiguration" type="xml"> <location>/trunk/policies/</location> </property> <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher"> <property name="mediaType">application/wsdl+xml</property> </filter> </handler>
Apart from the WSDLMediaTypeHandler
which processes uploaded WSDLs, there are other handlers as well which are configured in the registry.xml
to support governance of web services. Given below are the other handlers.
ZipWSDLMediaTypeHandler
- WSDLs and associated schemas can also be uploaded as .zip files or as .gar files. This handler is used to process such WSDL s and schemas.ServiceMediaTypeHandler
- This handler processes the services being added to the registry.DeleteServiceHandler
- This handler provides the ability to remove the entire heirarchy for a given service while deleting the service.PolicyMediaTypeHandler
- This handler processes the policy files being added to the registry.XSDMediaTypeHandler
- This handler processes the schema types being added to the registry.EndpointMediaTypeHandler
- This handler processes service end-points defined in the WSDL files being uploaded to the registry.
External Link Handler
The WSO2 Governance Registry allows you to store external links as a part of the repository tree structure. Clicking on such a resource would take you to the external link. This makes it easy for an organization to manage physically separated resources as a part of a single hierarchical tree structure. Given below is the configuration for ExternalLinkHandler
.
<handler class="org.wso2.carbon.registry.extensions.handlers.ExternalLinkHandler"> <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher"> <property name="mediaType">application/vnd.wso2-hyperlink</property> </filter> </handler>
You can similarly include your own handlers on the registry.xml
. The handler sample included with the WSO2 Governance Registry distribution explains to how you could create your own handler and include it in the registry.xml
file.
URI Media Type Handler
The WSO2 Governance Registry allows you to add resources to the registry as URL references. In such case the resource would exist on a different file system and the registry would only hold a URL reference to that resource. To process and find dependencies like Services, WSDLs, Endpoints, Schemas and Policy files of URL referenced resources we use the UriMediaTypeHandler.
Given below is the configuration for UriMediaTypeHandler
.
<handler class="org.wso2.carbon.governance.registry.extensions.handlers.UriMediaTypeHandler"> <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher"> <property name="mediaType">application/vnd.wso2-uri+xml</property> </filter> </handler>
See also Handlers.