@SessionScoped public class CDIServiceContext extends org.granite.tide.TideServiceContext
| Constructor and Description |
|---|
CDIServiceContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResultEval(org.granite.tide.invocation.ContextResult result) |
void |
endSession()
Clear current session from user events registry
|
protected boolean |
equals(Object obj1,
Object obj2) |
List<org.granite.tide.invocation.ContextUpdate> |
evaluateResults(Object target,
boolean nothing)
Evaluate results from context
|
Object |
findComponent(String componentName,
Class<?> componentClass)
Implementation of component lookup for CDI service
|
Set<Class<?>> |
findComponentClasses(String componentName,
Class<?> componentClass)
Implementation of component lookup for CDI service
|
protected org.granite.tide.async.AsyncPublisher |
getAsyncPublisher()
Factory for Seam async publisher
|
Map<org.granite.tide.invocation.ContextResult,Boolean> |
getResultsEval() |
protected org.granite.tide.TidePersistenceManager |
getTidePersistenceManager(boolean create) |
void |
initCall()
Determines the current sessionId for web invocations
|
static boolean |
isImmutable(Object o) |
org.granite.tide.IInvocationResult |
postCall(org.granite.messaging.service.ServiceInvocationContext context,
Object result,
String componentName,
Class<?> componentClass)
Builds the result object for the invocation
|
void |
postCallFault(org.granite.messaging.service.ServiceInvocationContext context,
Throwable t,
String componentName,
Class<?> componentClass)
Intercepts a fault on the invocation
|
void |
prepareCall(org.granite.messaging.service.ServiceInvocationContext context,
org.granite.tide.IInvocationCall c,
String componentName,
Class<?> componentClass)
Synchronizes server context with data provided by the client
|
void |
processEvent(Object event)
Add an event in the current context
|
void |
restoreContext(List<org.granite.tide.invocation.ContextUpdate> updates,
Object target)
Evaluate updates in current server context
|
void |
setLogin(boolean isLogin) |
void |
setSessionId(String sessionId)
Initialize current sessionId and event listeners for this context
|
public CDIServiceContext()
public void initCall()
initCall in class org.granite.tide.TideServiceContextpublic void setSessionId(String sessionId)
setSessionId in class org.granite.tide.TideServiceContextsessionId - current sessionId@PreDestroy public void endSession()
public void setLogin(boolean isLogin)
public Map<org.granite.tide.invocation.ContextResult,Boolean> getResultsEval()
public Object findComponent(String componentName, Class<?> componentClass)
findComponent in class org.granite.tide.TideServiceContextcomponentName - component namepublic Set<Class<?>> findComponentClasses(String componentName, Class<?> componentClass)
findComponentClasses in class org.granite.tide.TideServiceContextcomponentName - component namepublic void processEvent(Object event)
event - the eventprotected org.granite.tide.async.AsyncPublisher getAsyncPublisher()
getAsyncPublisher in class org.granite.tide.TideServiceContextpublic void prepareCall(org.granite.messaging.service.ServiceInvocationContext context, org.granite.tide.IInvocationCall c, String componentName, Class<?> componentClass)
prepareCall in class org.granite.tide.TideServiceContextcontext - invocation contextc - client callcomponentName - name of the component which will be invokedpublic org.granite.tide.IInvocationResult postCall(org.granite.messaging.service.ServiceInvocationContext context, Object result, String componentName, Class<?> componentClass)
postCall in class org.granite.tide.TideServiceContextcontext - invocation contextresult - result of the method invocationcomponentName - name of the invoked componentpublic void postCallFault(org.granite.messaging.service.ServiceInvocationContext context, Throwable t, String componentName, Class<?> componentClass)
postCallFault in class org.granite.tide.TideServiceContextcontext - invocation contextt - exception throwncomponentName - name of the invoked componentpublic void addResultEval(org.granite.tide.invocation.ContextResult result)
public void restoreContext(List<org.granite.tide.invocation.ContextUpdate> updates, Object target)
updates - list of updatestarget - the target instancepublic List<org.granite.tide.invocation.ContextUpdate> evaluateResults(Object target, boolean nothing)
target - the target instancenothing - used by initializer to avoid interactions with context syncprotected org.granite.tide.TidePersistenceManager getTidePersistenceManager(boolean create)
getTidePersistenceManager in class org.granite.tide.TideServiceContextprotected boolean equals(Object obj1, Object obj2)
equals in class org.granite.tide.TideServiceContextpublic static boolean isImmutable(Object o)