org.springframework.extensions.webscripts
Class DeclarativeRegistry

java.lang.Object
  extended by org.springframework.extensions.webscripts.DeclarativeRegistry
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, Registry

public class DeclarativeRegistry
extends Object
implements Registry, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean

Registry of declarative (scripted/template driven) Web Scripts

Author:
davidc

Constructor Summary
DeclarativeRegistry()
           
 
Method Summary
 void afterPropertiesSet()
           
 Match findWebScript(String method, String uri)
          Gets a Web Script given an HTTP Method and URI
protected  org.springframework.context.ApplicationContext getApplicationContext()
          Gets the Application Context
 Map<String,String> getFailures()
          Gets all Web Script definitions that failed to register
 Path getFamily(String scriptUri)
          Gets a Web Script Family NOTE: - To get all families, pass / - To get a specific family, pass /{familyName}
 Path getLifecycle(String lifecyclePath)
          Gets a Lifecycle Family, for example, all deprecated web scripts NOTE: - To get all lifecycles, pass / - To get a specific lifecycle, pass /{lifecycleName}
 Path getPackage(String scriptPackage)
          Gets a Web Script Package
 Path getUri(String scriptUri)
          Gets a Web Script URL
 WebScript getWebScript(String id)
          Gets a Web Script by Id
 Collection<WebScript> getWebScripts()
          Gets all Web Scripts
 void reset()
          Resets the Web Script Registry
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setContainer(Container container)
           
 void setDefaultWebScript(String defaultWebScript)
           
 void setSearchPath(SearchPath searchPath)
           
 void setUriIndex(UriIndex uriIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeclarativeRegistry

public DeclarativeRegistry()
Method Detail

setDefaultWebScript

public void setDefaultWebScript(String defaultWebScript)
Parameters:
defaultWebScript -

setUriIndex

public void setUriIndex(UriIndex uriIndex)
Parameters:
uriIndex -

setSearchPath

public void setSearchPath(SearchPath searchPath)
Parameters:
searchPath -

setContainer

public void setContainer(Container container)
Parameters:
container -

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getApplicationContext

protected org.springframework.context.ApplicationContext getApplicationContext()
Gets the Application Context

Returns:
application context

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

reset

public void reset()
Description copied from interface: Registry
Resets the Web Script Registry

Specified by:
reset in interface Registry

getPackage

public Path getPackage(String scriptPackage)
Description copied from interface: Registry
Gets a Web Script Package

Specified by:
getPackage in interface Registry
Returns:
web script path representing package

getUri

public Path getUri(String scriptUri)
Description copied from interface: Registry
Gets a Web Script URL

Specified by:
getUri in interface Registry
Returns:
web script path representing uri

getFamily

public Path getFamily(String scriptUri)
Description copied from interface: Registry
Gets a Web Script Family NOTE: - To get all families, pass / - To get a specific family, pass /{familyName}

Specified by:
getFamily in interface Registry
Returns:
web script path representing family

getWebScripts

public Collection<WebScript> getWebScripts()
Description copied from interface: Registry
Gets all Web Scripts

Specified by:
getWebScripts in interface Registry
Returns:
web scripts

getFailures

public Map<String,String> getFailures()
Description copied from interface: Registry
Gets all Web Script definitions that failed to register

Specified by:
getFailures in interface Registry
Returns:
map of error by web script definition file path

getWebScript

public WebScript getWebScript(String id)
Description copied from interface: Registry
Gets a Web Script by Id

Specified by:
getWebScript in interface Registry
Parameters:
id - web script id
Returns:
web script

findWebScript

public Match findWebScript(String method,
                           String uri)
Description copied from interface: Registry
Gets a Web Script given an HTTP Method and URI

Specified by:
findWebScript in interface Registry
Parameters:
method - http method
uri - uri
Returns:
script match (pair of script and uri that matched)

getLifecycle

public Path getLifecycle(String lifecyclePath)
Description copied from interface: Registry
Gets a Lifecycle Family, for example, all deprecated web scripts NOTE: - To get all lifecycles, pass / - To get a specific lifecycle, pass /{lifecycleName}

Specified by:
getLifecycle in interface Registry
Returns:
web script path representing family


Copyright © 2009 SpringSource, Inc. All Rights Reserved.