Class AbstractEventHandlerFactory

  • All Implemented Interfaces:
    WebEventTags
    Direct Known Subclasses:
    AppEventHandlerFactory, WebEventHandlerFactory

    public abstract class AbstractEventHandlerFactory
    extends java.lang.Object
    implements WebEventTags
    Deprecated.
    Event-handlers factories are not used. The bean itself now is responsible to define and create instances of its default event-handler.
    This abstract class provides common functionalities for the WebEventHandlerFactory interface.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    See Also:
    WebEventHandlerFactory
    • Constructor Detail

      • AbstractEventHandlerFactory

        protected AbstractEventHandlerFactory()
        Deprecated.
        Default constructor
    • Method Detail

      • initEventHandlers

        protected void initEventHandlers​(org.w3c.dom.Document handlerDoc)
        Deprecated.
        Initializes the event handler factory from the specified org.w3c.dom.Document object. All event handlers defined in the Document object are cached in the factory.

        Any existing event handler with the same type is replaced by the newly added event handler.

        Parameters:
        handlerDoc - a org.w3c.dom.Document object containing all the event handlers supported by your application. The root node of Document object should be WebEventTags.TAG_EVENT_HANDLERS.
      • initEventHandler

        protected abstract WebEventHandler initEventHandler​(int handlerType,
                                                            org.w3c.dom.Element eventsNode)
        Deprecated.
        Instantiates and returns a WebEventHandler object based on the specified type and org.w3c.dom.Element object.
        Parameters:
        handlerType - the event handler type
        eventsNode - a org.w3c.dom.Element object containing the definition of the event handler of the specified type.
        Returns:
        an instance of WebEventHandler of the specified type.
      • getEventHandler

        protected WebEventHandler getEventHandler​(int handlerType)
        Deprecated.
        Returns a WebEventHandler instance of the specified type from the factory.
        Parameters:
        handlerType - the event handler type.
        Returns:
        a WebEventHandler instance of the specified type
      • setEventHandler

        protected void setEventHandler​(int handlerType,
                                       WebEventHandler weh)
        Deprecated.
        adds or replaces an instance of WebEventHandler into the factory.
        Parameters:
        handlerType - the type of the event handler to add
        weh - an instance of WebEventHandler.
      • addEventsToHandlers

        public void addEventsToHandlers​(java.io.File file)
                                 throws WebBeanException
        Deprecated.
        The parsing logic in this abstract factory would be as follows: It gets a reference to the specific handler that is referred to in the definition. If there is no pre-defined handler of that type, ignore that type Otherwise call addEvents(Element) on the handler. The handler now needs to check if this an event that is already defined. If so, get a reference to that event. If not, just add it. It has to check if any of the arguments are already defined. If they are, get reference to the existing argument and overwrite values. If not, add the new argument and set values.
        Parameters:
        file - a file reference to the definition of the events
        Throws:
        WebBeanException - thrown if there is any error
      • addEventsToHandlers

        public void addEventsToHandlers​(org.w3c.dom.Document handlerDoc)
        Deprecated.
        The parsing logic in this abstract factory would be as follows: It gets a reference to the specific handler that is referred to in the definition. If there is no pre-defined handler of that type, ignore that type Otherwise call addEvents(Element) on the handler The handler now needs to check if this an event that is already defined. If so, get a reference to that event. If not, just add it. It has to check if any of the arguments are already defined. If they are, get reference to the existing argument and overwrite values. If not, add the new argument and set values.
        Parameters:
        handlerDoc - a DOM Document object of the event definitions
      • destroy

        public void destroy()
        Deprecated.
        Destroy the HashSet and other caches, will be called when destroying the sevlet