aerogear-controller 1.0.0.M1

org.jboss.aerogear.controller.router
Interface Responder

All Known Implementing Classes:
AbstractRestResponder, JsonResponder, MvcResponder

public interface Responder

A Responder is capable of responding to a specific MediaType.


Method Summary
 boolean accepts(String mediaType)
          Determines whether this responder can respond to the passed-in @{code mediaType}
 void respond(Object entity, RouteContext routeContext)
          Responds to the current request in a why appropriate to the type of Responder (forward, return).
 

Method Detail

accepts

boolean accepts(String mediaType)
Determines whether this responder can respond to the passed-in @{code mediaType}

Parameters:
mediaType - the mediaType that this responder supports.
Returns:
@{code true} if this responder can handle the media type passed in, false otherwise.

respond

void respond(Object entity,
             RouteContext routeContext)
             throws Exception
Responds to the current request in a why appropriate to the type of Responder (forward, return).

Parameters:
entity - the entity returned from a Route endpoint.
routeContext - the current RouteContext.
Throws:
Exception - if an error occurs while responding.

aerogear-controller 1.0.0.M1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.