public abstract class AbstractSeamServiceContext
extends org.granite.tide.TideServiceContext
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COMPONENT_NAME |
protected org.jboss.seam.log.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
|
java.util.List<org.granite.tide.invocation.ContextUpdate> |
evaluateResults(org.jboss.seam.Component component,
java.lang.Object target,
boolean nothing)
Evaluate results from context
|
java.lang.Object |
findComponent(java.lang.String componentName,
java.lang.Class<?> componentClass,
java.lang.String methodName)
Implementation of component lookup for Seam service
|
java.util.Set<java.lang.Class<?>> |
findComponentClasses(java.lang.String componentName,
java.lang.Class<?> componentClass,
java.lang.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() |
java.lang.Object |
invokeAsynchronous(AsyncContext asyncContext,
java.lang.String targetComponentName,
java.lang.Class<?> targetComponentClass,
java.lang.String methodName,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] params)
Implementations of intercepted asynchronous calls
Send asynchronous event to client
|
static java.lang.Object[] |
lookupInStatefulContexts(java.lang.String name,
org.jboss.seam.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,
java.lang.Object result,
java.lang.String componentName,
java.lang.Class<?> componentClass)
Builds the result object for the invocation
|
void |
postCallFault(org.granite.messaging.service.ServiceInvocationContext context,
java.lang.Throwable t,
java.lang.String componentName,
java.lang.Class<?> componentClass)
Intercepts a fault on the invocation
|
void |
prepareCall(org.granite.messaging.service.ServiceInvocationContext context,
org.granite.tide.IInvocationCall c,
java.lang.String componentName,
java.lang.Class<?> componentClass)
Synchronizes server context with data provided by the client
|
void |
raiseEvent(java.lang.String type,
java.lang.Object... params)
Add an event in the current context
|
void |
restoreContext(java.util.List<org.granite.tide.invocation.ContextUpdate> updates,
org.jboss.seam.Component component,
java.lang.Object target)
Evaluate updates in current server context
|
void |
setAsyncContext(AsyncContext asyncContext)
Restores an asynchronous context
|
void |
setSessionId(java.lang.String sessionId)
Initialize current sessionId and event listeners for this context
|
public static final java.lang.String COMPONENT_NAME
@Logger protected org.jboss.seam.log.Log log
public AbstractSeamServiceContext()
throws org.granite.messaging.service.ServiceException
org.granite.messaging.service.ServiceExceptionpublic void initCall()
initCall in class org.granite.tide.TideServiceContextpublic void setSessionId(java.lang.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 java.lang.Object findComponent(java.lang.String componentName,
java.lang.Class<?> componentClass,
java.lang.String methodName)
findComponent in class org.granite.tide.TideServiceContextcomponentName - component namepublic java.util.Set<java.lang.Class<?>> findComponentClasses(java.lang.String componentName,
java.lang.Class<?> componentClass,
java.lang.String methodName)
findComponentClasses in class org.granite.tide.TideServiceContextcomponentName - component name@Observer(value="org.jboss.seam.beginConversation") public void observeBeginConversation()
public void raiseEvent(java.lang.String type,
java.lang.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,
java.lang.String componentName,
java.lang.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,
java.lang.Object result,
java.lang.String componentName,
java.lang.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,
java.lang.Throwable t,
java.lang.String componentName,
java.lang.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(java.util.List<org.granite.tide.invocation.ContextUpdate> updates,
org.jboss.seam.Component component,
java.lang.Object target)
updates - list of updatescomponent - the target componenttarget - the target instancepublic java.util.List<org.granite.tide.invocation.ContextUpdate> evaluateResults(org.jboss.seam.Component component,
java.lang.Object target,
boolean nothing)
component - the target componenttarget - the target instancenothing - used by initializer to avoid interactions with context syncpublic java.lang.Object invokeAsynchronous(AsyncContext asyncContext, java.lang.String targetComponentName, java.lang.Class<?> targetComponentClass, java.lang.String methodName, java.lang.Class<?>[] paramTypes, java.lang.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 java.lang.Object[] lookupInStatefulContexts(java.lang.String name,
org.jboss.seam.ScopeType scope)