public class MockExecutionContext extends Object implements ExecutionContext
Modifier and Type | Field and Description |
---|---|
MockApplicationContext |
context |
ContentDeliveryConfig |
deliveryConfig |
LinkedHashMap |
parameters |
ProfileSet |
profileSet |
DOCUMENT_URI
Constructor and Description |
---|
MockExecutionContext() |
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(Object key)
Returns the object bound with the specified name in this
BoundAttributeStore
implementation, or null if no object is bound under the name. |
Map |
getAttributes()
Returns the Map of attributes bound in this
BoundAttributeStore |
BeanContext |
getBeanContext()
Get the BeanContext in use on this context instance.
|
String |
getConfigParameter(String name)
Get a global configuration parameter associated with this execution context.
|
String |
getConfigParameter(String name,
String defaultVal)
Get a global configuration parameter associated with this execution context.
|
String |
getContentEncoding()
Get the content encoding to be used when parsing content on this context.
|
ApplicationContext |
getContext()
Get the application context within which this execution context "lives".
|
ContentDeliveryConfig |
getDeliveryConfig()
Get the content delivery configuration for the profile set at which this
context is targeted.
|
URI |
getDocumentSource()
Get the document source URI.
|
ExecutionEventListener |
getEventListener()
Get the ExecutionEventListener for the
ExecutionContext . |
MockContentDeliveryConfig |
getMockDeliveryConfig() |
Enumeration |
getParameterNames() |
String[] |
getParameterValues(String name) |
ProfileSet |
getTargetProfiles()
Get the set of profiles at which this execution context is targeted.
|
Throwable |
getTerminationError()
Set the error/exception that caused the filter operation associated with
this ExecutionContext to terminate.
|
boolean |
isDefaultSerializationOn()
Is default serialization on for this execution context.
|
void |
removeAttribute(Object key)
Removes the object bound with the specified name from this
BoundAttributeStore
implementation. |
void |
setAttribute(Object key,
Object value)
Binds an object to this
BoundAttributeStore implementation, using the name
specified. |
void |
setBeanContext(BeanContext beanContext)
Set the BeanContext to be use on this context instance.
|
void |
setContentEncoding(String contentEncoding)
Set the content encoding to be used when parsing content on this context.
|
void |
setDocumentSource(URI docSource)
Set the document source URI.
|
void |
setEventListener(ExecutionEventListener listener)
Set the ExecutionEventListener for the
ExecutionContext . |
void |
setTerminationError(Throwable terminationError)
Set the error/exception that caused the filter operation associated with
this ExecutionContext to terminate.
|
public ProfileSet profileSet
public ContentDeliveryConfig deliveryConfig
public MockApplicationContext context
public LinkedHashMap parameters
public void setDocumentSource(URI docSource)
ExecutionContext
setDocumentSource
in interface ExecutionContext
docSource
- The document URI.public URI getDocumentSource()
ExecutionContext
ExecutionContext.DOCUMENT_URI
constant.getDocumentSource
in interface ExecutionContext
public Enumeration getParameterNames()
public ApplicationContext getContext()
ExecutionContext
getContext
in interface ExecutionContext
public ProfileSet getTargetProfiles()
ExecutionContext
getTargetProfiles
in interface ExecutionContext
ProfileSet
.public ContentDeliveryConfig getDeliveryConfig()
ExecutionContext
getDeliveryConfig
in interface ExecutionContext
public void setContentEncoding(String contentEncoding) throws IllegalArgumentException
ExecutionContext
setContentEncoding
in interface ExecutionContext
contentEncoding
- Character encoding to be used when parsing content. Null
defaults to "UTF-8".IllegalArgumentException
- Invalid encoding.public String getContentEncoding()
ExecutionContext
getContentEncoding
in interface ExecutionContext
public void setEventListener(ExecutionEventListener listener)
ExecutionContext
ExecutionContext
.
Allows calling code to listen to (and capture data on) specific
context execution events e.g. the targeting of resources.
Note, this is not a logging facility and should be used with care.
It's overuse should be avoided as it can have a serious negative effect
on performance. By default, no listenrs are applied and so no overhead
is incured.setEventListener
in interface ExecutionContext
listener
- The listener instance.BasicExecutionEventListener
public ExecutionEventListener getEventListener()
ExecutionContext
ExecutionContext
.getEventListener
in interface ExecutionContext
ExecutionContext.setEventListener(ExecutionEventListener)
public void setTerminationError(Throwable terminationError)
ExecutionContext
setTerminationError
in interface ExecutionContext
terminationError
- The termination Error/Exception.public Throwable getTerminationError()
ExecutionContext
getTerminationError
in interface ExecutionContext
public String getConfigParameter(String name)
ExecutionContext
ParameterAccessor
class.getConfigParameter
in interface ExecutionContext
name
- The name of the parameter.public String getConfigParameter(String name, String defaultVal)
ExecutionContext
ParameterAccessor
class.getConfigParameter
in interface ExecutionContext
name
- The name of the parameter.defaultVal
- The default value to be returned if the configuration parameter is not set.public boolean isDefaultSerializationOn()
ExecutionContext
Filter.DEFAULT_SERIALIZATION_ON
global param. Default Serialization is on by default.
Example Configuration:
<params> <param name="default.serialization.on">false</param> </params>
isDefaultSerializationOn
in interface ExecutionContext
public void setAttribute(Object key, Object value)
BoundAttributeStore
BoundAttributeStore
implementation, using the name
specified. If an object of the same name is already bound, the object
is replaced.
setAttribute
in interface BoundAttributeStore
key
- The key against which the object is bound; cannot be null.value
- The object to be bound; cannot be null.public Object getAttribute(Object key)
BoundAttributeStore
BoundAttributeStore
implementation, or null if no object is bound under the name.getAttribute
in interface BoundAttributeStore
key
- The key against which the object is bound; cannot be null.BoundAttributeStore
implementation, or null if no object is bound under the name.public void removeAttribute(Object key)
BoundAttributeStore
BoundAttributeStore
implementation. If the BoundAttributeStore
implementation does
not have an object bound with the specified name, this method does nothing.removeAttribute
in interface BoundAttributeStore
key
- The key against which the object is bound; cannot be null.public MockContentDeliveryConfig getMockDeliveryConfig()
public Map getAttributes()
BoundAttributeStore
BoundAttributeStore
getAttributes
in interface BoundAttributeStore
BoundAttributeStore
public BeanContext getBeanContext()
ExecutionContext
getBeanContext
in interface ExecutionContext
public void setBeanContext(BeanContext beanContext)
ExecutionContext
setBeanContext
in interface ExecutionContext
beanContext
- The BeanContext.Copyright © 2020. All rights reserved.