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, ApplicationContextAware
Direct Known Subclasses:
SpringMVCServiceContext

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

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

Field Summary
protected  ApplicationContext springContext
           
 
Fields inherited from class org.granite.tide.TideServiceContext
COMPONENT_ATTR, COMPONENT_CLASS_ATTR, EMPTY_ARGS
 
Constructor Summary
SpringServiceContext()
           
SpringServiceContext(ApplicationContext springContext)
           
 
Method Summary
protected  Set<Class<?>> buildComponentClasses(Object bean)
           
 Object findComponent(String componentName, Class<?> componentClass)
           
 Set<Class<?>> findComponentClasses(String componentName, Class<?> componentClass)
           
protected  org.granite.tide.async.AsyncPublisher getAsyncPublisher()
           
protected  ApplicationContext getSpringContext()
           
protected  org.granite.tide.TidePersistenceManager getTidePersistenceManager(boolean create)
          Create a TidePersistenceManager
protected  boolean isBeanAnnotationPresent(Object bean, Class<? extends Annotation> annotationClass)
           
protected  boolean isBeanMethodAnnotationPresent(Object bean, String methodName, Class<?>[] methodArgTypes, Class<? extends Annotation> annotationClass)
           
 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(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 ApplicationContext springContext
Constructor Detail

SpringServiceContext

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

SpringServiceContext

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

setApplicationContext

public void setApplicationContext(ApplicationContext springContext)
Specified by:
setApplicationContext in interface ApplicationContextAware

getSpringContext

protected 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

buildComponentClasses

protected Set<Class<?>> buildComponentClasses(Object bean)

isBeanAnnotationPresent

protected boolean isBeanAnnotationPresent(Object bean,
                                          Class<? extends Annotation> annotationClass)

isBeanMethodAnnotationPresent

protected boolean isBeanMethodAnnotationPresent(Object bean,
                                                String methodName,
                                                Class<?>[] methodArgTypes,
                                                Class<? extends Annotation> annotationClass)

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