org.granite.client.tide.server
Class TrackingContext
java.lang.Object
org.granite.client.tide.server.TrackingContext
public class TrackingContext
- extends Object
- Author:
- William DRAI
|
Method Summary |
void |
addLastResult(String res)
|
boolean |
addResult(String componentName,
String componentClassName,
String expr,
Object instance)
|
void |
addUpdate(String componentName,
String componentClassName,
String expr,
Object value)
|
void |
clear()
|
void |
clearPendingUpdates()
Resets the current pending updates |
void |
clearUpdates(boolean savePending)
Resets the current updates and optionally saves them as pending |
void |
filterUpdates(TrackingContext.UpdateFilter filter)
Filter the current updates with a function |
List<org.granite.tide.invocation.ContextResult> |
getResults()
|
List<org.granite.tide.invocation.ContextUpdate> |
getUpdates()
|
protected boolean |
internalAddResult(String componentName,
String componentClassName,
String expr,
Object instance,
ScopeType scope,
SyncMode sync)
|
protected void |
internalAddUpdate(String componentName,
String componentClassName,
String expr,
Object value,
ScopeType scope,
SyncMode sync,
boolean typed)
|
boolean |
isEnabled()
|
void |
removeResults(List<org.granite.tide.invocation.ContextUpdate> rmap)
|
void |
restoreContext(Map<String,Object> trackingContext)
|
Map<String,Object> |
saveAndResetContext()
|
void |
setEnabled(boolean enabled)
|
void |
traceContext()
Trace the current tracking context |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TrackingContext
public TrackingContext()
setEnabled
public void setEnabled(boolean enabled)
- Parameters:
enabled - enable or disable tracking on the current context
isEnabled
public boolean isEnabled()
- Returns:
- true if tracking enabled
getUpdates
public List<org.granite.tide.invocation.ContextUpdate> getUpdates()
- Returns:
- current list of updates that will be sent to the server
getResults
public List<org.granite.tide.invocation.ContextResult> getResults()
- Returns:
- current list of results that will be requested from the server
clear
public void clear()
clearUpdates
public void clearUpdates(boolean savePending)
- Resets the current updates and optionally saves them as pending
- Parameters:
savePending - moves existing updates to pending before clearing
clearPendingUpdates
public void clearPendingUpdates()
- Resets the current pending updates
filterUpdates
public void filterUpdates(TrackingContext.UpdateFilter filter)
- Filter the current updates with a function
addUpdate
public void addUpdate(String componentName,
String componentClassName,
String expr,
Object value)
- Parameters:
componentName - name of the component/context variable or null if typed component referencecomponentClassName - class name of the component/context variable or null if untyped component nameexpr - EL expression to evaluatevalue - value to send to servertyped - component name represents a typed component instance
internalAddUpdate
protected void internalAddUpdate(String componentName,
String componentClassName,
String expr,
Object value,
ScopeType scope,
SyncMode sync,
boolean typed)
- Parameters:
componentName - name of the component/context variable or null if typed component referencecomponentClassName - class name of the component/context variable or null if untyped component nameexpr - EL expression to evaluatevalue - value to send to serverscope - scope of the resultsync - remote sync mode of the resulttyped - component name represents a typed component instance
addResult
public boolean addResult(String componentName,
String componentClassName,
String expr,
Object instance)
- Parameters:
componentName - name of the component/context variablecomponentClassName - class name of the component/context variableexpr - EL expression to evaluateinstance - current instance of the component
- Returns:
- true if the result was not already present in the current context
internalAddResult
protected boolean internalAddResult(String componentName,
String componentClassName,
String expr,
Object instance,
ScopeType scope,
SyncMode sync)
- Parameters:
componentName - name of the component/context variablecomponentClassName - class name of the component/context variableexpr - EL expression to evaluateinstance - current instance of the componentscope - scope of the updatesync - remote sync mode of the update
- Returns:
- true if the result was not already present in the current context
addLastResult
public void addLastResult(String res)
removeResults
public void removeResults(List<org.granite.tide.invocation.ContextUpdate> rmap)
traceContext
public void traceContext()
- Trace the current tracking context
saveAndResetContext
public Map<String,Object> saveAndResetContext()
- Returns:
- saved tracking context
restoreContext
public void restoreContext(Map<String,Object> trackingContext)
- Parameters:
trackingContext - object containing the current call context