org.springframework.extensions.surf
Class WebFrameworkManager

java.lang.Object
  extended by org.springframework.extensions.surf.WebFrameworkManager
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

public class WebFrameworkManager
extends Object
implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

WebFramework general manager. Responsible for loading of the beans to persist model objects in the system. Also deals with supplying persister objects for a given type. Initialised via the FrameworkHelper during main webframework initialisation.

Author:
muzquiano, kevinr

Constructor Summary
WebFrameworkManager()
           
 
Method Summary
 org.springframework.context.ApplicationContext getApplicationContext()
          Gets the application context.
 ModelObjectManager getObjectManager(ModelPersistenceContext context)
          Returns an object manager instance which has been bound to the provided persister context.
 ModelObjectManager getObjectManager(String userId, String repositoryStoreId)
          Returns an object service instance which will be bound to the provided user and repository store ids.
 Map<String,ModelObjectPersister> getObjectPersisters()
           
 ModelObjectPersister getPersister(String objectTypeId)
          Returns a persister for the given object type id.
 ModelObjectPersister getPersisterById(String persisterId)
          Returns a persister instance for a given persister id
 WebFrameworkServiceRegistry getServiceRegistry()
          Gets the service registry.
 WebFrameworkConfigElement getWebFrameworkConfig()
          Gets the web framework config.
 void initPersisters()
          Initializes the persisters.
 void onApplicationEvent(org.springframework.context.ApplicationEvent event)
           
protected  void onBootstrap()
          Initialization of the Web Framework Manager
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setServiceRegistry(WebFrameworkServiceRegistry serviceRegistry)
          Sets the service registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebFrameworkManager

public WebFrameworkManager()
Method Detail

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

public org.springframework.context.ApplicationContext getApplicationContext()
Gets the application context.

Returns:
the application context

setServiceRegistry

public void setServiceRegistry(WebFrameworkServiceRegistry serviceRegistry)
Sets the service registry.

Parameters:
serviceRegistry - the new service registry

getServiceRegistry

public WebFrameworkServiceRegistry getServiceRegistry()
Gets the service registry.

Returns:
the service registry

getWebFrameworkConfig

public WebFrameworkConfigElement getWebFrameworkConfig()
Gets the web framework config.

Returns:
the web framework config

onApplicationEvent

public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener

onBootstrap

protected void onBootstrap()
Initialization of the Web Framework Manager


getObjectManager

public ModelObjectManager getObjectManager(ModelPersistenceContext context)
                                    throws WebFrameworkServiceException
Returns an object manager instance which has been bound to the provided persister context.

Parameters:
context - the context
Returns:
object manager
Throws:
WebFrameworkServiceException

getObjectManager

public ModelObjectManager getObjectManager(String userId,
                                           String repositoryStoreId)
                                    throws WebFrameworkServiceException
Returns an object service instance which will be bound to the provided user and repository store ids.

Parameters:
userId - the user id
repositoryStoreId - the repository store id
Returns:
the object service
Throws:
WebFrameworkServiceException

getPersister

public ModelObjectPersister getPersister(String objectTypeId)
Returns a persister for the given object type id. At present, this returns the system-wide object persister for all object type ids.

Parameters:
objectTypeId -
Returns:
the persister

getPersisterById

public ModelObjectPersister getPersisterById(String persisterId)
Returns a persister instance for a given persister id

Parameters:
persisterId -
Returns:

getObjectPersisters

public Map<String,ModelObjectPersister> getObjectPersisters()

initPersisters

public void initPersisters()
Initializes the persisters. This calls the init methods on all of the configured top-level persisters.



Copyright © 2009 SpringSource, Inc. All Rights Reserved.