public abstract class AbstractSeamServiceContext extends org.granite.tide.TideServiceContext
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_NAME |
protected Log |
log |
| Constructor and Description |
|---|
AbstractSeamServiceContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResultEval(ScopedContextResult result) |
protected abstract void |
clearTideMessages() |
void |
endSession()
Clear current session from user events registry
|
List<org.granite.tide.invocation.ContextUpdate> |
evaluateResults(Component component,
Object target,
boolean nothing)
Evaluate results from context
|
Object |
findComponent(String componentName,
Class<?> componentClass,
String methodName)
Implementation of component lookup for Seam service
|
Set<Class<?>> |
findComponentClasses(String componentName,
Class<?> componentClass,
String methodName)
Implementation of component lookup for Seam service
|
AsyncContext |
getAsyncContext()
Constructs an asynchronous context object
|
protected org.granite.tide.async.AsyncPublisher |
getAsyncPublisher()
Factory for Seam async publisher
|
protected abstract org.granite.tide.TideStatusMessages |
getTideMessages()
Retrieve current messages
|
protected org.granite.tide.TidePersistenceManager |
getTidePersistenceManager(boolean create) |
void |
initCall()
Determines the current sessionId for web invocations
|
protected abstract void |
initTideMessages() |
Object |
invokeAsynchronous(AsyncContext asyncContext,
String targetComponentName,
Class<?> targetComponentClass,
String methodName,
Class<?>[] paramTypes,
Object[] params)
Implementations of intercepted asynchronous calls
Send asynchronous event to client
|
static Object[] |
lookupInStatefulContexts(String name,
ScopeType scope)
Search for a named attribute in all contexts, in the
following order: method, event, page, conversation,
session, business process, application.
|
void |
observeBeginConversation() |
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 |
raiseEvent(String type,
Object... params)
Add an event in the current context
|
void |
restoreContext(List<org.granite.tide.invocation.ContextUpdate> updates,
Component component,
Object target)
Evaluate updates in current server context
|
void |
setAsyncContext(AsyncContext asyncContext)
Restores an asynchronous context
|
void |
setSessionId(String sessionId)
Initialize current sessionId and event listeners for this context
|
public static final String COMPONENT_NAME
public AbstractSeamServiceContext() throws org.granite.messaging.service.ServiceException
org.granite.messaging.service.ServiceExceptionpublic void initCall()
initCall in class org.granite.tide.TideServiceContextpublic void setSessionId(String sessionId)
setSessionId in class org.granite.tide.TideServiceContextsessionId - current sessionId@Destroy public void endSession()
public AsyncContext getAsyncContext()
public void setAsyncContext(AsyncContext asyncContext)
asyncContext - saved contextprotected abstract org.granite.tide.TideStatusMessages getTideMessages()
protected abstract void initTideMessages()
protected abstract void clearTideMessages()
public Object findComponent(String componentName, Class<?> componentClass, String methodName)
findComponent in class org.granite.tide.TideServiceContextcomponentName - component namepublic Set<Class<?>> findComponentClasses(String componentName, Class<?> componentClass, String methodName)
findComponentClasses in class org.granite.tide.TideServiceContextcomponentName - component name@Observer(value="org.jboss.seam.beginConversation") public void observeBeginConversation()
public void raiseEvent(String type, Object... params)
type - event typeparams - event parametersprotected 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(ScopedContextResult result)
public void restoreContext(List<org.granite.tide.invocation.ContextUpdate> updates, Component component, Object target)
updates - list of updatescomponent - the target componenttarget - the target instancepublic List<org.granite.tide.invocation.ContextUpdate> evaluateResults(Component component, Object target, boolean nothing)
component - the target componenttarget - the target instancenothing - used by initializer to avoid interactions with context syncpublic Object invokeAsynchronous(AsyncContext asyncContext, String targetComponentName, Class<?> targetComponentClass, String methodName, Class<?>[] paramTypes, Object[] params)
asyncContext - current context (session id)targetComponentName - target component namemethodName - method nameparamTypes - method argument typesparams - argument valuesprotected org.granite.tide.TidePersistenceManager getTidePersistenceManager(boolean create)
getTidePersistenceManager in class org.granite.tide.TideServiceContextpublic static Object[] lookupInStatefulContexts(String name, ScopeType scope)