Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following points describe the process of selecting the asset entity-consuming method to handle the request entity. This process occurs during the invocation of the AssetProvider#isReadable() method.

  1. Collect all the entity-consuming methods of the asset. These are the public methods annotated with @Consumes annotation.
  2. Sort the collected entity-consuming methods in descending order, where methods with more specific media types precede methods with less specific media types, following the rule n/m > n/* > /.
  3. Select the first method that supports the media type of the request entity body as provided to the AssetProvider#isReadable() method, and return true.
  4. If no entity-consuming method supports the media type of the request entity body, return false. The Apache Wink runtime continues searching for a different provider to handle the asset as a regular entity.

Response Entity Matching

The following points describe the process of selecting an entity-producing method to produce the actual response entity. The following process occurs during the invocation of the AssetProvider#isWriteable() method.

  1. Collect all the entity-producing methods of the asset. These are the public methods annotated with @Produces annotation.
  2. Sort the collected entity-producing methods in descending order, where methods with more specific media types precede methods with less specific media types, following the rule n/m > n/* > /.
  3. Select the first method that supports the media type of the response entity body as provided to the AssetProvider#isWriteable()method and return true.
  4.  If no entity-producing method supports the media type of the response entity body, return false. The Apache Wink runtime continues searching for a different provider to handle the asset as a regular entity.

Asset Example

The following example illustrates the use of an asset. The "Defect" bean is a JAXB annotated class.

...