Exemplo n.º 1
0
        /// <summary>
        ///     Ctor.
        /// </summary>
        /// <param name="configurationEventTypeXMLDOM">is the XML DOM configuration such as root element and schema names</param>
        /// <param name="metadata">event type metadata</param>
        /// <param name="eventBeanTypedEventFactory">for registration and lookup of types</param>
        /// <param name="xmlEventTypeFactory">xml type factory</param>
        /// <param name="eventTypeResolver">resolver</param>
        public BaseXMLEventType(
            EventTypeMetadata metadata,
            ConfigurationCommonEventTypeXMLDOM configurationEventTypeXMLDOM,
            EventBeanTypedEventFactory eventBeanTypedEventFactory,
            EventTypeNameResolver eventTypeResolver,
            XMLFragmentEventTypeFactory xmlEventTypeFactory)
            : base(eventBeanTypedEventFactory, metadata, typeof(XmlNode), eventTypeResolver, xmlEventTypeFactory)
        {
            RootElementName = configurationEventTypeXMLDOM.RootElementName;
            ConfigurationEventTypeXMLDOM = configurationEventTypeXMLDOM;

            if (configurationEventTypeXMLDOM.XPathFunctionResolver != null) {
                try {
                    _functionResolver = TypeHelper.Instantiate<IXPathFunctionResolver>(
                        configurationEventTypeXMLDOM.XPathFunctionResolver,
                        ClassForNameProviderDefault.INSTANCE);
                }
                catch (ClassInstantiationException ex) {
                    throw new ConfigurationException(
                        "Error configuring XPath function resolver for XML type '" +
                        configurationEventTypeXMLDOM.RootElementName +
                        "' : " +
                        ex.Message,
                        ex);
                }
            }

            if (configurationEventTypeXMLDOM.XPathVariableResolver != null) {
                try {
                    _variableResolver = TypeHelper.Instantiate<IXPathVariableResolver>(
                        configurationEventTypeXMLDOM.XPathVariableResolver,
                        ClassForNameProviderDefault.INSTANCE);
                }
                catch (ClassInstantiationException ex) {
                    throw new ConfigurationException(
                        "Error configuring XPath variable resolver for XML type '" +
                        configurationEventTypeXMLDOM.RootElementName +
                        "' : " +
                        ex.Message,
                        ex);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="metadata">event type metadata</param>
        /// <param name="eventTypeId">The event type id.</param>
        /// <param name="configurationEventTypeXMLDOM">is the XML DOM configuration such as root element and schema names</param>
        /// <param name="eventAdapterService">for registration and lookup of types</param>
        /// <param name="lockManager"></param>
        protected BaseXMLEventType(
            EventTypeMetadata metadata,
            int eventTypeId,
            ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM,
            EventAdapterService eventAdapterService,
            ILockManager lockManager)
            : base(lockManager, eventAdapterService, metadata, eventTypeId, typeof(XmlNode))
        {
            RootElementName = configurationEventTypeXMLDOM.RootElementName;
            ConfigurationEventTypeXMLDOM = configurationEventTypeXMLDOM;

            if (configurationEventTypeXMLDOM.XPathFunctionResolver != null)
            {
                try
                {
                    var fresolver = TypeHelper.Instantiate <IXPathFunctionResolver>(
                        configurationEventTypeXMLDOM.XPathFunctionResolver);
                    _functionResolver = fresolver;
                }
                catch (TypeInstantiationException ex)
                {
                    throw new ConfigurationException("Error configuring XPath function resolver for XML type '" + configurationEventTypeXMLDOM.RootElementName + "' : " + ex.Message, ex);
                }
            }

            if (configurationEventTypeXMLDOM.XPathVariableResolver != null)
            {
                try
                {
                    var vresolver = TypeHelper.Instantiate <IXPathVariableResolver>(
                        configurationEventTypeXMLDOM.XPathVariableResolver);
                    _variableResolver = vresolver;
                }
                catch (TypeInstantiationException ex)
                {
                    throw new ConfigurationException("Error configuring XPath variable resolver for XML type '" + configurationEventTypeXMLDOM.RootElementName + "' : " + ex.Message, ex);
                }
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtendedContext"/> class.
 /// </summary>
 /// <param name="baseContext">The base context.</param>
 /// <param name="functionResolver">The function resolver.</param>
 /// <param name="variableResolver">The variable resolver.</param>
 public ExtendedContext(XsltContext baseContext, IXPathFunctionResolver functionResolver, IXPathVariableResolver variableResolver)
 {
     _baseContext      = baseContext;
     _functionResolver = functionResolver;
     _variableResolver = variableResolver;
 }