Class CCEventMulticaster

java.lang.Object
com.portal.app.cc.event.CCEventMulticaster
All Implemented Interfaces:
BalanceImpactListener, BillInfoChangeListener, ContactChangeListener, CreditLimitListener, DeferralChangeListener, HierarchyChangeListener, HoldingsChangeListener, PaymentChangeListener, ServiceChangeListener, StatusChangeListener, EventListener

A class which implements efficient and thread-safe multi-cast event dispatching for the customer care events defined in the com.portal.app.cc.event package. This class will manage an immutable structure consisting of a chain of event listeners and will dispatch events to those listeners. Because the structure is immutable, it is safe to use this API to add/remove listeners during the process of an event dispatch operation.
Version:
%version: 9 % %date_modified: Thu Jun 07 17:32:00 2001 %
Author:
kapono
  • Field Details

  • Constructor Details

    • CCEventMulticaster

      public CCEventMulticaster()
      Creates an event multicaster instance which chains listener-a with listener-b. Input parameters a and b should not be null, though implementations may vary in choosing whether or not to throw NullPointerException in that case.
    • CCEventMulticaster

      public CCEventMulticaster(EventListener a, EventListener b)
      Creates an event multicaster instance which chains listener-a with listener-b. Input parameters a and b should not be null, though implementations may vary in choosing whether or not to throw NullPointerException in that case.
      Parameters:
      a - listener-a
      b - listener-b
  • Method Details

    • hierarchyChange

      public void hierarchyChange(HierarchyChangeEvent e)
      Handles the HierarchyChange event by invoking the hierarchyChange methods on listener-a and listener-b
      Specified by:
      hierarchyChange in interface HierarchyChangeListener
      Parameters:
      e - a HierarchyChangeEvent encapsulating the event information
      The - hierarchy change event
    • add

      Adds hierarchy change-listener-a with hierarchy change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - hierarchy change-listener-a
      b - hierarchy change-listener-b
    • remove

      Removes the old hierarchy change-listener from hierarchy change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - hierarchy change-listener-l
      oldl - the hierarchy change-listener being removed
    • holdingsChange

      public void holdingsChange(HoldingsChangeEvent e)
      Handles the HoldingsChangeEvent by invoking the holdingsChange methods on listener-a and listener-b
      Specified by:
      holdingsChange in interface HoldingsChangeListener
      Parameters:
      e - a HoldingsChangeEvent encapsulating the event information
      The - holdings change event
    • add

      Adds holdings change-listener-a with holdings change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - holdings change-listener-a
      b - holdings change-listener-b
    • remove

      Removes the old holdings change-listener from holdings change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - holdings change-listener-l
      oldl - the holdings change-listener being removed
    • deferralChange

      public void deferralChange(DeferralChangeEvent e)
      Handles the DeferralChange event by invoking the deferralChange methods on listener-a and listener-b
      Specified by:
      deferralChange in interface DeferralChangeListener
      Parameters:
      e - a DeferralChangeEvent encapsulating the event information
      The - deferral change event
    • add

      Adds deferral change-listener-a with deferral change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - deferral change-listener-a
      b - deferral change-listener-b
    • remove

      Removes the old deferral change-listener from deferral change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - deferral change-listener-l
      oldl - the deferral change-listener being removed
    • statusChange

      public void statusChange(StatusChangeEvent e)
      Handles the StatusChange event by invoking the statusChange methods on listener-a and listener-b
      Specified by:
      statusChange in interface StatusChangeListener
      Parameters:
      e - a StatusChangeEvent encapsulating the event information
      The - status change event
    • add

      Adds status change-listener-a with status change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - status change-listener-a
      b - status change-listener-b
    • remove

      Removes the old status change-listener from status change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - deferral change-listener-l
      oldl - the status change-listener being removed
    • balanceImpact

      public void balanceImpact(BalanceImpactEvent e)
      Handles the BalanceImpact event by invoking the balanceImpact methods on listener-a and listener-b
      Specified by:
      balanceImpact in interface BalanceImpactListener
      Parameters:
      e - a BalanceImpactEvent encapsulating the event information
      The - balance impact event
    • add

      Adds balance impact-listener-a with balance impact-listener-b and returns the resulting multicast listener.
      Parameters:
      a - balance impact-listener-a
      b - balance impact-listener-b
    • remove

      Removes the old balance impact-listener from balance impact-listener-l and returns the resulting multicast listener.
      Parameters:
      l - balance impact-listener-l
      oldl - the balance impact-listener being removed
    • contactChange

      public void contactChange(ContactChangeEvent e)
      Handles the ContactChange event by invoking the contactChange methods on listener-a and listener-b
      Specified by:
      contactChange in interface ContactChangeListener
      Parameters:
      e - a ContactChangeEvent encapsulating the event information
      The - contact change event
    • add

      Adds contact change-listener-a with contact change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - contact change-listener-a
      b - contact change-listener-b
    • remove

      Removes the old contact change-listener from contact change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - contact change-listener-l
      oldl - the contact change-listener being removed
    • serviceChange

      public void serviceChange(ServiceChangeEvent e)
      Handles the ServiceChangeEvent by invoking the serviceChange methods on listener-a and listener-b
      Specified by:
      serviceChange in interface ServiceChangeListener
      Parameters:
      e - a ServiceChangeEvent encapsulating the event information
      The - event encapsulating the service change
    • add

      Adds service change-listener-a with service change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - service change-listener-a
      b - service change-listener-b
    • remove

      Removes the old service change-listener from service change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - service change-listener-l
      oldl - the service change-listener being removed
    • paymentChange

      public void paymentChange(PaymentChangeEvent e)
      Handles the PaymentChangeEvent by invoking the paymentChange methods on listener-a and listener-b
      Specified by:
      paymentChange in interface PaymentChangeListener
      Parameters:
      e - a PaymentChangeEvent encapsulating the event information
      The - contact change event
    • add

      Adds payment change-listener-a with payment change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - payment change-listener-a
      b - payment change-listener-b
    • remove

      Removes the old payment change-listener from payment change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - payment change-listener-l
      oldl - the payment change-listener being removed
    • creditLimitChange

      public void creditLimitChange(CreditLimitEvent e)
      Handles the CreditLimitEvent by invoking the creditLimitChange methods on listener-a and listener-b
      Specified by:
      creditLimitChange in interface CreditLimitListener
      Parameters:
      e - a CreditLimitEvent encapsulating the event information
      The - contact change event
    • add

      Adds credit limit change-listener-a with credit limit change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - credit limit change-listener-a
      b - credit limit change-listener-b
    • remove

      Removes the old credit limit change-listener from credit limit change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - credit limit change-listener-l
      oldl - the credit limit change-listener being removed
    • billInfoChange

      public void billInfoChange(BillInfoChangeEvent e)
      Description copied from interface: BillInfoChangeListener
      Called when an event is sent out that impacts a service
      Specified by:
      billInfoChange in interface BillInfoChangeListener
      Parameters:
      e - a ServiceChangeEvent encapsulating the event information
    • add

      Adds credit limit change-listener-a with credit limit change-listener-b and returns the resulting multicast listener.
      Parameters:
      a - credit limit change-listener-a
      b - credit limit change-listener-b
    • remove

      Removes the old credit limit change-listener from credit limit change-listener-l and returns the resulting multicast listener.
      Parameters:
      l - credit limit change-listener-l
      oldl - the credit limit change-listener being removed
    • remove

      protected EventListener remove(EventListener oldl)
      Removes a listener from this multicaster and returns the resulting multicast listener.
      Parameters:
      oldl - the listener to be removed
    • addInternal

      protected EventListener addInternal(EventListener a, EventListener b)
      Returns the resulting multicast listener from adding listener-a and listener-b together. If listener-a is null, it returns listener-b; If listener-b is null, it returns listener-a If neither are null, then it creates and returns a new CCEventMulticaster instance which chains a with b.
      Parameters:
      a - event listener-a
      b - event listener-b
    • removeInternal

      protected EventListener removeInternal(EventListener l, EventListener oldl)
      Returns the resulting multicast listener after removing the old listener from listener-l. If listener-l equals the old listener OR listener-l is null, returns null. Else if listener-l is an instance of CCEventMulticaster, then it removes the old listener from it. Else, returns listener l.
      Parameters:
      l - the listener being removed from
      oldl - the listener being removed
    • saveInternal

      protected void saveInternal(ObjectOutputStream s, String k) throws IOException
      Throws:
      IOException
    • save

      protected void save(ObjectOutputStream s, String k, EventListener l) throws IOException
      Throws:
      IOException