net.craftforge.essential.controller.managers
Class ResourceManager

java.lang.Object
  extended by net.craftforge.essential.controller.managers.ResourceManager

public class ResourceManager
extends Object

Manages the matching of resource URLs against resource classes and methods.

Since:
02.02.2011
Author:
Christian Bick

Method Summary
static ResourceManager getInstance(String packagePath)
          Controls instantiation process to ensure that only one instance per package path is used.
 Map<String,String[]> getPathParameters(String requestPath)
          Gets the request path parameter map corresponding to the request path.
 Class<?> getResourceClass(String path)
          Gets the resource class corresponding to the request path.
 Method getResourceMethod(String httpMethod, String path, Class<?> resourceClass)
          Gets the resource method corresponding to the HTTP method and request path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ResourceManager getInstance(String packagePath)
Controls instantiation process to ensure that only one instance per package path is used.

Parameters:
packagePath - The package path
Returns:
The resource manager responsible for the given package path

getPathParameters

public Map<String,String[]> getPathParameters(String requestPath)
Gets the request path parameter map corresponding to the request path.

Parameters:
requestPath - The request requestPath
Returns:
The request requestPath parameter map

getResourceClass

public Class<?> getResourceClass(String path)
Gets the resource class corresponding to the request path.

Parameters:
path - The request path
Returns:
The resource class

getResourceMethod

public Method getResourceMethod(String httpMethod,
                                String path,
                                Class<?> resourceClass)
Gets the resource method corresponding to the HTTP method and request path.

Parameters:
httpMethod - The HTTP method
path - The request path
resourceClass - The resource class for this method
Returns:
The resource method


Copyright © 2011. All Rights Reserved.