aerogear-controller 1.0.0.M1

org.jboss.aerogear.controller.router
Class MvcResponder

java.lang.Object
  extended by org.jboss.aerogear.controller.router.MvcResponder
All Implemented Interfaces:
Responder

public class MvcResponder
extends Object
implements Responder

A Responder that "responds" to request by forwarding them to a View.


Field Summary
private  ViewResolver viewResolver
           
 
Constructor Summary
MvcResponder(ViewResolver viewResolver)
           
 
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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewResolver

private ViewResolver viewResolver
Constructor Detail

MvcResponder

@Inject
public MvcResponder(ViewResolver viewResolver)
Method Detail

accepts

public boolean accepts(String mediaType)
Description copied from interface: Responder
Determines whether this responder can respond to the passed-in @{code mediaType}

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

respond

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

Specified by:
respond in interface Responder
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.