org.granite.tide.spring
Class SpringServiceContext

java.lang.Object
  extended by org.granite.tide.TideServiceContext
      extended by org.granite.tide.spring.SpringServiceContext
All Implemented Interfaces:
Serializable, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
SpringMVCServiceContext

public class SpringServiceContext
extends org.granite.tide.TideServiceContext
implements org.springframework.context.ApplicationContextAware

Author:
Sebastien Deleuze, William DRAI
See Also:
Serialized Form

Field Summary
protected  org.springframework.context.ApplicationContext springContext
           
 
Fields inherited from class org.granite.tide.TideServiceContext
COMPONENT_ATTR, COMPONENT_CLASS_ATTR, EMPTY_ARGS
 
Constructor Summary
SpringServiceContext()
           
SpringServiceContext(org.springframework.context.ApplicationContext springContext)
           
 
Method Summary
 Object findComponent(String componentName, Class<?> componentClass)
           
 Set<Class<?>> findComponentClasses(String componentName, Class<?> componentClass)
           
protected  org.granite.tide.async.AsyncPublisher getAsyncPublisher()
           
protected  org.springframework.context.ApplicationContext getSpringContext()
           
protected  org.granite.tide.TidePersistenceManager getTidePersistenceManager(boolean create)
          Create a TidePersistenceManager
 org.granite.tide.IInvocationResult postCall(org.granite.messaging.service.ServiceInvocationContext context, Object result, String componentName, Class<?> componentClass)
           
 void postCallFault(org.granite.messaging.service.ServiceInvocationContext context, Throwable t, String componentName, Class<?> componentClass)
           
 void prepareCall(org.granite.messaging.service.ServiceInvocationContext context, org.granite.tide.IInvocationCall c, String componentName, Class<?> componentClass)
           
 void setApplicationContext(org.springframework.context.ApplicationContext springContext)
           
 void setEntityManagerFactoryBeanName(String beanName)
           
 void setPersistenceManagerBeanName(String beanName)
           
 
Methods inherited from class org.granite.tide.TideServiceContext
adjustInvokee, beforeMethodSearch, equals, getSessionId, initCall, lazyInitialize, mergeExternal, mergeExternal, sendEvent, setSessionId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

springContext

protected transient org.springframework.context.ApplicationContext springContext
Constructor Detail

SpringServiceContext

public SpringServiceContext()
                     throws org.granite.messaging.service.ServiceException
Throws:
org.granite.messaging.service.ServiceException

SpringServiceContext

public SpringServiceContext(org.springframework.context.ApplicationContext springContext)
                     throws org.granite.messaging.service.ServiceException
Throws:
org.granite.messaging.service.ServiceException
Method Detail

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext springContext)
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware

getSpringContext

protected org.springframework.context.ApplicationContext getSpringContext()

getAsyncPublisher

protected org.granite.tide.async.AsyncPublisher getAsyncPublisher()
Specified by:
getAsyncPublisher in class org.granite.tide.TideServiceContext

findComponent

public Object findComponent(String componentName,
                            Class<?> componentClass)
Specified by:
findComponent in class org.granite.tide.TideServiceContext

findComponentClasses

public Set<Class<?>> findComponentClasses(String componentName,
                                          Class<?> componentClass)
Specified by:
findComponentClasses in class org.granite.tide.TideServiceContext

prepareCall

public void prepareCall(org.granite.messaging.service.ServiceInvocationContext context,
                        org.granite.tide.IInvocationCall c,
                        String componentName,
                        Class<?> componentClass)
Specified by:
prepareCall in class org.granite.tide.TideServiceContext

postCall

public org.granite.tide.IInvocationResult postCall(org.granite.messaging.service.ServiceInvocationContext context,
                                                   Object result,
                                                   String componentName,
                                                   Class<?> componentClass)
Specified by:
postCall in class org.granite.tide.TideServiceContext

postCallFault

public void postCallFault(org.granite.messaging.service.ServiceInvocationContext context,
                          Throwable t,
                          String componentName,
                          Class<?> componentClass)
Overrides:
postCallFault in class org.granite.tide.TideServiceContext

setEntityManagerFactoryBeanName

public void setEntityManagerFactoryBeanName(String beanName)

setPersistenceManagerBeanName

public void setPersistenceManagerBeanName(String beanName)

getTidePersistenceManager

protected org.granite.tide.TidePersistenceManager getTidePersistenceManager(boolean create)
Create a TidePersistenceManager

Specified by:
getTidePersistenceManager in class org.granite.tide.TideServiceContext
Parameters:
create - create if not existent (can be false for use in entity merge)
Returns:
a PersistenceContextManager