public class StandaloneExecutionContext extends Object implements ExecutionContext
DOCUMENT_URI
Constructor and Description |
---|
StandaloneExecutionContext(String targetProfile,
ApplicationContext context,
String contentEncoding,
VisitorConfigMap extendedVisitorConfigMap)
Public Constructor.
|
StandaloneExecutionContext(String targetProfile,
ApplicationContext context,
VisitorConfigMap extendedVisitorConfigMap)
Public Constructor.
|
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. |
Hashtable<Object,Object> |
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 standalone request instance.
|
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 . |
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 standalone request instance.
|
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.
|
String |
toString() |
public StandaloneExecutionContext(String targetProfile, ApplicationContext context, VisitorConfigMap extendedVisitorConfigMap) throws UnknownProfileMemberException
targetProfile
- The target base profile for the execution context.
These parameters are not appended to the supplied requestURI. This arg must be supplied, even if it's empty.context
- The application context.extendedVisitorConfigMap
- Preconfigured/extended Visitor Configuration Map.UnknownProfileMemberException
- Unknown target profile.public StandaloneExecutionContext(String targetProfile, ApplicationContext context, String contentEncoding, VisitorConfigMap extendedVisitorConfigMap) throws UnknownProfileMemberException
targetProfile
- The target profile (base profile) for this context.
These parameters are not appended to the supplied requestURI. This arg must be supplied, even if it's empty.context
- The application context.contentEncoding
- Character encoding to be used when parsing content. Null
defaults to "UTF-8".extendedVisitorConfigMap
- Preconfigured/extended Visitor Configuration Map.UnknownProfileMemberException
- Unknown target profile.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 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
setContentEncoding
in interface ExecutionContext
contentEncoding
- Character encoding to be used when parsing content. Null
defaults to "UTF-8".IllegalArgumentException
- Invalid encoding.public String getContentEncoding()
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 Hashtable<Object,Object> 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.