org.apache.shindig.protocol
Class DefaultHandlerRegistry

java.lang.Object
  extended by org.apache.shindig.protocol.DefaultHandlerRegistry
All Implemented Interfaces:
HandlerRegistry

public class DefaultHandlerRegistry
extends Object
implements HandlerRegistry

Default implementation of HandlerRegistry. Bind to appropriately annotated handlers.


Constructor Summary
DefaultHandlerRegistry(com.google.inject.Injector injector, BeanJsonConverter beanJsonConverter, HandlerExecutionListener executionListener)
          Creates a dispatcher with the specified handler classes
 
Method Summary
 void addHandlers(Set<Object> handlers)
          Add handlers to the registry
 RestHandler getRestHandler(String path, String method)
          Get a REST request handler
 RpcHandler getRpcHandler(org.json.JSONObject rpc)
          Get an RPC handler
 Set<String> getSupportedRestServices()
           
 Set<String> getSupportedRpcServices()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHandlerRegistry

@Inject
public DefaultHandlerRegistry(com.google.inject.Injector injector,
                                     BeanJsonConverter beanJsonConverter,
                                     HandlerExecutionListener executionListener)
Creates a dispatcher with the specified handler classes

Parameters:
injector - Used to create instance if handler is a Class
Method Detail

addHandlers

public void addHandlers(Set<Object> handlers)
Add handlers to the registry

Specified by:
addHandlers in interface HandlerRegistry
Parameters:
handlers -

getRpcHandler

public RpcHandler getRpcHandler(org.json.JSONObject rpc)
Get an RPC handler

Specified by:
getRpcHandler in interface HandlerRegistry
Parameters:
rpc - The rpc to dispatch
Returns:
the handler

getRestHandler

public RestHandler getRestHandler(String path,
                                  String method)
Get a REST request handler

Specified by:
getRestHandler in interface HandlerRegistry
Parameters:
path - Path of the service
method - The HTTP method
Returns:
the handler

getSupportedRestServices

public Set<String> getSupportedRestServices()
Specified by:
getSupportedRestServices in interface HandlerRegistry
Returns:
The list of available services

getSupportedRpcServices

public Set<String> getSupportedRpcServices()
Specified by:
getSupportedRpcServices in interface HandlerRegistry
Returns:
The list of available services


Copyright © 2007-2012. All Rights Reserved.