本文整理了Java中org.milyn.container.ExecutionContext.getEventListener()
方法的一些代码示例,展示了ExecutionContext.getEventListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExecutionContext.getEventListener()
方法的具体详情如下:
包路径:org.milyn.container.ExecutionContext
类名称:ExecutionContext
方法名:getEventListener
[英]Get the ExecutionEventListener for the ExecutionContext.
[中]获取ExecutionContext的ExecutionEventListener。
代码示例来源:origin: smooks/smooks
/**
* Public constructor.
* <p/>
* Constructs a SmooksDOMFilter instance for delivering content for the supplied execution context.
*
* @param executionContext Execution context. This instance
* is bound to the current Thread of execution. See <a href="#threading">Threading Issues</a>.
*/
public SmooksDOMFilter(ExecutionContext executionContext) {
if (executionContext == null) {
throw new IllegalArgumentException("null 'executionContext' arg passed in constructor call.");
}
this.executionContext = executionContext;
deliveryConfig = (DOMContentDeliveryConfig) executionContext.getDeliveryConfig();
eventListener = executionContext.getEventListener();
closeSource = ParameterAccessor.getBoolParameter(Filter.CLOSE_SOURCE, true, executionContext.getDeliveryConfig());
closeResult = ParameterAccessor.getBoolParameter(Filter.CLOSE_RESULT, true, executionContext.getDeliveryConfig());
reverseVisitOrderOnVisitAfter = ParameterAccessor.getBoolParameter(Filter.REVERSE_VISIT_ORDER_ON_VISIT_AFTER, true, executionContext.getDeliveryConfig());
if(!(executionContext.getEventListener() instanceof AbstractReportGenerator)) {
terminateOnVisitorException = ParameterAccessor.getBoolParameter(Filter.TERMINATE_ON_VISITOR_EXCEPTION, true, executionContext.getDeliveryConfig());
} else {
terminateOnVisitorException = false;
}
}
代码示例来源:origin: org.milyn/milyn-smooks-core
/**
* Public constructor.
* <p/>
* Constructs a SmooksDOMFilter instance for delivering content for the supplied execution context.
*
* @param executionContext Execution context. This instance
* is bound to the current Thread of execution. See <a href="#threading">Threading Issues</a>.
*/
public SmooksDOMFilter(ExecutionContext executionContext) {
if (executionContext == null) {
throw new IllegalArgumentException("null 'executionContext' arg passed in constructor call.");
}
this.executionContext = executionContext;
deliveryConfig = (DOMContentDeliveryConfig) executionContext.getDeliveryConfig();
eventListener = executionContext.getEventListener();
closeSource = ParameterAccessor.getBoolParameter(Filter.CLOSE_SOURCE, true, executionContext.getDeliveryConfig());
closeResult = ParameterAccessor.getBoolParameter(Filter.CLOSE_RESULT, true, executionContext.getDeliveryConfig());
reverseVisitOrderOnVisitAfter = ParameterAccessor.getBoolParameter(Filter.REVERSE_VISIT_ORDER_ON_VISIT_AFTER, true, executionContext.getDeliveryConfig());
if(!(executionContext.getEventListener() instanceof AbstractReportGenerator)) {
terminateOnVisitorException = ParameterAccessor.getBoolParameter(Filter.TERMINATE_ON_VISITOR_EXCEPTION, true, executionContext.getDeliveryConfig());
} else {
terminateOnVisitorException = false;
}
}
代码示例来源:origin: org.milyn/milyn-smooks-all
/**
* Public constructor.
* <p/>
* Constructs a SmooksDOMFilter instance for delivering content for the supplied execution context.
*
* @param executionContext Execution context. This instance
* is bound to the current Thread of execution. See <a href="#threading">Threading Issues</a>.
*/
public SmooksDOMFilter(ExecutionContext executionContext) {
if (executionContext == null) {
throw new IllegalArgumentException("null 'executionContext' arg passed in constructor call.");
}
this.executionContext = executionContext;
deliveryConfig = (DOMContentDeliveryConfig) executionContext.getDeliveryConfig();
eventListener = executionContext.getEventListener();
closeSource = ParameterAccessor.getBoolParameter(Filter.CLOSE_SOURCE, true, executionContext.getDeliveryConfig());
closeResult = ParameterAccessor.getBoolParameter(Filter.CLOSE_RESULT, true, executionContext.getDeliveryConfig());
reverseVisitOrderOnVisitAfter = ParameterAccessor.getBoolParameter(Filter.REVERSE_VISIT_ORDER_ON_VISIT_AFTER, true, executionContext.getDeliveryConfig());
if(!(executionContext.getEventListener() instanceof AbstractReportGenerator)) {
terminateOnVisitorException = ParameterAccessor.getBoolParameter(Filter.TERMINATE_ON_VISITOR_EXCEPTION, true, executionContext.getDeliveryConfig());
} else {
terminateOnVisitorException = false;
}
}
代码示例来源:origin: org.virtuslab/milyn-smooks-core
/**
* Public constructor.
*
* Constructs a SmooksDOMFilter instance for delivering content for the supplied execution context.
*
* @param executionContext Execution context. This instance
* is bound to the current Thread of execution. See <a href="#threading">Threading Issues</a>.
*/
public SmooksDOMFilter(ExecutionContext executionContext) {
if (executionContext == null) {
throw new IllegalArgumentException("null 'executionContext' arg passed in constructor call.");
}
this.executionContext = executionContext;
deliveryConfig = (DOMContentDeliveryConfig) executionContext.getDeliveryConfig();
eventListener = executionContext.getEventListener();
closeSource = ParameterAccessor.getBoolParameter(Filter.CLOSE_SOURCE, true, executionContext.getDeliveryConfig());
closeResult = ParameterAccessor.getBoolParameter(Filter.CLOSE_RESULT, true, executionContext.getDeliveryConfig());
reverseVisitOrderOnVisitAfter = ParameterAccessor.getBoolParameter(Filter.REVERSE_VISIT_ORDER_ON_VISIT_AFTER, true, executionContext.getDeliveryConfig());
if(!(executionContext.getEventListener() instanceof AbstractReportGenerator)) {
terminateOnVisitorException = ParameterAccessor.getBoolParameter(Filter.TERMINATE_ON_VISITOR_EXCEPTION, true, executionContext.getDeliveryConfig());
} else {
terminateOnVisitorException = false;
}
}
代码示例来源:origin: smooks/smooks
eventListener = executionContext.getEventListener();
if(!(executionContext.getEventListener() instanceof AbstractReportGenerator)) {
terminateOnVisitorException = contentDeliveryConfig.isTerminateOnVisitorException();
} else {
代码示例来源:origin: org.milyn/milyn-smooks-core
eventListener = executionContext.getEventListener();
if(!(executionContext.getEventListener() instanceof AbstractReportGenerator)) {
terminateOnVisitorException = contentDeliveryConfig.isTerminateOnVisitorException();
} else {
代码示例来源:origin: org.milyn/milyn-smooks-all
eventListener = executionContext.getEventListener();
if(!(executionContext.getEventListener() instanceof AbstractReportGenerator)) {
terminateOnVisitorException = contentDeliveryConfig.isTerminateOnVisitorException();
} else {
代码示例来源:origin: org.virtuslab/milyn-smooks-core
eventListener = executionContext.getEventListener();
if(!(executionContext.getEventListener() instanceof AbstractReportGenerator)) {
terminateOnVisitorException = contentDeliveryConfig.isTerminateOnVisitorException();
} else {
代码示例来源:origin: org.virtuslab/milyn-smooks-core
/**
* Public constructor.
* @param node Node to be serialized.
* @param executionContext Target device context.
*/
public Serializer(Node node, ExecutionContext executionContext) {
if(node == null) {
throw new IllegalArgumentException("null 'node' arg passed in method call.");
} else if(executionContext == null) {
throw new IllegalArgumentException("null 'executionContext' arg passed in method call.");
}
this.node = node;
this.executionContext = executionContext;
eventListener = executionContext.getEventListener();
// Get the delivery context for the device.
deliveryConfig = (DOMContentDeliveryConfig) executionContext.getDeliveryConfig();
// Initialise the serializationUnits member
serializationUnits = deliveryConfig.getSerailizationVisitors();
globalSUs = serializationUnits.getMappings(new String[] {"*", "**"});
// Set the default SerializationUnit
defaultSerializationOn = ParameterAccessor.getBoolParameter(Filter.DEFAULT_SERIALIZATION_ON, true, executionContext.getDeliveryConfig());
if(defaultSerializationOn) {
defaultSerializationUnit = new DefaultSerializationUnit();
boolean rewriteEntities = ParameterAccessor.getBoolParameter(Filter.ENTITIES_REWRITE, true, executionContext.getDeliveryConfig());
defaultSerializationUnit.setRewriteEntities(rewriteEntities);
}
terminateOnVisitorException = ParameterAccessor.getBoolParameter(Filter.TERMINATE_ON_VISITOR_EXCEPTION, true, executionContext.getDeliveryConfig());
}
代码示例来源:origin: org.milyn/milyn-smooks-all
eventListener = executionContext.getEventListener();
代码示例来源:origin: smooks/smooks
eventListener = executionContext.getEventListener();
代码示例来源:origin: org.milyn/milyn-smooks-core
eventListener = executionContext.getEventListener();
代码示例来源:origin: org.milyn/milyn-smooks-all
public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException {
Smooks smooks = getSmooksInstance();
ExecutionContext nestedExecutionContext = smooks.createExecutionContext();
// In case there's an attached event listener...
nestedExecutionContext.setEventListener(executionContext.getEventListener());
// Copy over the XMLReader stack...
AbstractParser.setReaders(AbstractParser.getReaders(executionContext), nestedExecutionContext);
// Attach the NamespaceDeclarationStack to the nested execution context...
NamespaceDeclarationStack nsStack = NamespaceMappings.getNamespaceDeclarationStack(executionContext);
NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext);
SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext);
if(parentContentHandler.getNestedContentHandler() != null) {
throw new SmooksException("Illegal use of more than one nested content handler fired on the same element.");
}
SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler);
DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext);
// Attach the XMLReader instance to the nested ExecutionContext and then swap the content handler on
// the XMLReader to be the nested handler created here. All events wll be forwarded to the ..
XMLReader xmlReader = AbstractParser.getXMLReader(executionContext);
AbstractParser.attachXMLReader(xmlReader, nestedExecutionContext);
xmlReader.setContentHandler(nestedContentHandler);
executionContext.setAttribute(NestedExecutionVisitor.class, nestedExecutionContext);
// Note we do not execute the Smooks filterSource methods for a nested instance... we just install
// the content handler and redirect the reader events to it...
}
代码示例来源:origin: org.milyn/milyn-smooks-core
public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException {
Smooks smooks = getSmooksInstance();
ExecutionContext nestedExecutionContext = smooks.createExecutionContext();
// In case there's an attached event listener...
nestedExecutionContext.setEventListener(executionContext.getEventListener());
// Copy over the XMLReader stack...
AbstractParser.setReaders(AbstractParser.getReaders(executionContext), nestedExecutionContext);
// Attach the NamespaceDeclarationStack to the nested execution context...
NamespaceDeclarationStack nsStack = NamespaceMappings.getNamespaceDeclarationStack(executionContext);
NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext);
SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext);
if(parentContentHandler.getNestedContentHandler() != null) {
throw new SmooksException("Illegal use of more than one nested content handler fired on the same element.");
}
SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler);
DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext);
// Attach the XMLReader instance to the nested ExecutionContext and then swap the content handler on
// the XMLReader to be the nested handler created here. All events wll be forwarded to the ..
XMLReader xmlReader = AbstractParser.getXMLReader(executionContext);
AbstractParser.attachXMLReader(xmlReader, nestedExecutionContext);
xmlReader.setContentHandler(nestedContentHandler);
executionContext.setAttribute(NestedExecutionVisitor.class, nestedExecutionContext);
// Note we do not execute the Smooks filterSource methods for a nested instance... we just install
// the content handler and redirect the reader events to it...
}
代码示例来源:origin: smooks/smooks
public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException {
Smooks smooks = getSmooksInstance();
ExecutionContext nestedExecutionContext = smooks.createExecutionContext();
// In case there's an attached event listener...
nestedExecutionContext.setEventListener(executionContext.getEventListener());
// Copy over the XMLReader stack...
AbstractParser.setReaders(AbstractParser.getReaders(executionContext), nestedExecutionContext);
// Attach the NamespaceDeclarationStack to the nested execution context...
NamespaceDeclarationStack nsStack = NamespaceMappings.getNamespaceDeclarationStack(executionContext);
NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext);
SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext);
if(parentContentHandler.getNestedContentHandler() != null) {
throw new SmooksException("Illegal use of more than one nested content handler fired on the same element.");
}
SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler);
DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext);
// Attach the XMLReader instance to the nested ExecutionContext and then swap the content handler on
// the XMLReader to be the nested handler created here. All events wll be forwarded to the ..
XMLReader xmlReader = AbstractParser.getXMLReader(executionContext);
AbstractParser.attachXMLReader(xmlReader, nestedExecutionContext);
xmlReader.setContentHandler(nestedContentHandler);
executionContext.setAttribute(NestedExecutionVisitor.class, nestedExecutionContext);
// Note we do not execute the Smooks filterSource methods for a nested instance... we just install
// the content handler and redirect the reader events to it...
}
代码示例来源:origin: org.virtuslab/milyn-smooks-core
public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException {
Smooks smooks = getSmooksInstance();
ExecutionContext nestedExecutionContext = smooks.createExecutionContext();
// In case there's an attached event listener...
nestedExecutionContext.setEventListener(executionContext.getEventListener());
// Copy over the XMLReader stack...
AbstractParser.setReaders(AbstractParser.getReaders(executionContext), nestedExecutionContext);
// Attach the NamespaceDeclarationStack to the nested execution context...
NamespaceDeclarationStack nsStack = NamespaceMappings.getNamespaceDeclarationStack(executionContext);
NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext);
SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext);
if(parentContentHandler.getNestedContentHandler() != null) {
throw new SmooksException("Illegal use of more than one nested content handler fired on the same element.");
}
SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler);
DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext);
// Attach the XMLReader instance to the nested ExecutionContext and then swap the content handler on
// the XMLReader to be the nested handler created here. All events wll be forwarded to the ..
XMLReader xmlReader = AbstractParser.getXMLReader(executionContext);
AbstractParser.attachXMLReader(xmlReader, nestedExecutionContext);
xmlReader.setContentHandler(nestedContentHandler);
executionContext.setAttribute(NestedExecutionVisitor.class, nestedExecutionContext);
// Note we do not execute the Smooks filterSource methods for a nested instance... we just install
// the content handler and redirect the reader events to it...
}
代码示例来源:origin: org.milyn/milyn-smooks-all
private void _filter(ExecutionContext executionContext, Source source, Result... results) {
ExecutionEventListener eventListener = executionContext.getEventListener();
代码示例来源:origin: smooks/smooks
private void _filter(ExecutionContext executionContext, Source source, Result... results) {
ExecutionEventListener eventListener = executionContext.getEventListener();
代码示例来源:origin: org.milyn/milyn-smooks-core
private void _filter(ExecutionContext executionContext, Source source, Result... results) {
ExecutionEventListener eventListener = executionContext.getEventListener();
代码示例来源:origin: org.virtuslab/milyn-smooks-core
private void _filter(ExecutionContext executionContext, Source source, Result... results) {
ExecutionEventListener eventListener = executionContext.getEventListener();
内容来源于网络,如有侵权,请联系作者删除!