Class AggregatedAppEventHandler

  • All Implemented Interfaces:
    WebEventHandler, WebEventTags, java.lang.Cloneable

    @Deprecated
    public abstract class AggregatedAppEventHandler
    extends AggregatedEventHandler
    Deprecated.
    Extend the AggregatedEventHandler class instead. Because we no longer differentiate between metadata and application event handlers, we will support only a single aggregated event handler superclass.

    This class is used to customize event-handlers.

    When a user wants to extend the functionality of an existing event-handler, s/he needs to extends this class. By doing this, all requests to process an event except the ones that this new handler is interested in, would be delegated to the super class.

    For example, the following code segment represents a custom handler that can be associated with a PageBy bean:
     public class CustomPageByHandler extends AggregatedAppEventHandler {
    
       public CustomPageByHandler(){
         super(EnumSysBeanTypes.AppBeanPageBy);
       }
    
       public boolean processRequest(RequestKeys keys) throws WebException {
         //------------------------//
         // process the event here //
         //------------------------//
    
         //or delegate it to the super class
         return handleDefaultRequest(keys);
       }
     }
     
    The custom handler that is created needs to be associated with the appropriated bean in order for the processRequest on this handler to get invoked. This association is done in the pageConfig.xml.
    Typically, the line in the pageConfig.xml which instantiates WebBean looks like
       <web-bean name="pbb" persist-mode="2" sys-bean="PageByBean"/>
     
    If we need to associate this web bean with a new event handler, the syntax for that would be
       <web-bean name="pbb" persist-mode="2" sys-bean="PageByBean" event-handler="com.xyz.CustomPageByHandler"/>
     

    Where com.xyz.CustomPageByHandler is the fully qualified class name of the new event handler class.

    Note that this should be done for every page, in the file, where the bean is going to be instantiated.
    Since:
    MicroStrategy Web 8.0.0
    • Constructor Detail

      • AggregatedAppEventHandler

        protected AggregatedAppEventHandler​(int type)
        Deprecated.
        Constructs an AggregatedAppEventHandler with the specified event handler type (EnumEventHandlerTypes). A default event handler with the specified event handler is created if possible.
        Parameters:
        type - the event handler type.
    • Method Detail

      • setHandlerType

        protected void setHandlerType​(int type)
        Deprecated.
        Description copied from class: AggregatedEventHandler
        Sets the event handler type. This implementation creates a new instance of the event handler with the specified type and sets it to be the default handler. Can be overridden in subclasses to change the way default handlers are created.

        NOTE: This implementation is provided for backward compatibility only. New code should set the default handler using setDefaultHandler.

        Overrides:
        setHandlerType in class AggregatedEventHandler
        Parameters:
        type - the event handler type.