Class AmpComponent

All Implemented Interfaces:
ClusteredComponentIfc, Configurable, XMPPService, ConfigurationChangedAware, Initializable, RegistrarBean, ActionResultsHandlerIfc, MessageReceiver, PacketWriterWithTimeout, ServerComponent, StatisticsContainer, StatisticsContainerIfc, VHostListener
Direct Known Subclasses:
AmpComponentClustered

Created: Apr 26, 2010 3:22:06 PM
Author:
Artur Hefczyc
  • Field Details

  • Constructor Details

    • AmpComponent

      public AmpComponent()
  • Method Details

    • addOutPacket

      public boolean addOutPacket(Packet packet)
      Specified by:
      addOutPacket in interface ActionResultsHandlerIfc
      Overrides:
      addOutPacket in class AbstractMessageReceiver
    • addOutPackets

      public boolean addOutPackets(Queue<Packet> packets)
      Specified by:
      addOutPackets in interface ActionResultsHandlerIfc
      Overrides:
      addOutPackets in class AbstractMessageReceiver
    • getDiscoCategoryType

      public String getDiscoCategoryType()
      Description copied from class: BasicComponent
      Method returns component category type used for service discovery responses.
      Overrides:
      getDiscoCategoryType in class BasicComponent
      Returns:
      category type of a component
    • getDiscoDescription

      public String getDiscoDescription()
      Description copied from class: BasicComponent
      Method returns description used for service discovery responses.
      Overrides:
      getDiscoDescription in class BasicComponent
      Returns:
      description of a component
    • getDiscoInfo

      public Element getDiscoInfo(String node, JID jid, JID from)
      Description copied from interface: XMPPService
      Returns service discovery info for the component. If the jid is null then this is info for the top level request. SM may return disco info on the top level. Other components should not.
      Specified by:
      getDiscoInfo in interface XMPPService
      Overrides:
      getDiscoInfo in class BasicComponent
      Parameters:
      node - is service discovery node for which the request is made. Is normally null for the component top level request.
      jid - is the jid to which the request has been made.
      from - is the request sender address. Some service discovery information is only meant for administrators.
      Returns:
      returns an XML Element with service discovery data.
    • processingInThreads

      public int processingInThreads()
      Description copied from class: AbstractMessageReceiver
      Concurrency control method. Returns preferable number of threads set for this component.
      Overrides:
      processingInThreads in class AbstractMessageReceiver
      Returns:
      preferable number of threads set for this component.
    • processingOutThreads

      public int processingOutThreads()
      Description copied from class: AbstractMessageReceiver
      Concurrency control method. Returns preferable number of threads set for this component.
      Overrides:
      processingOutThreads in class AbstractMessageReceiver
      Returns:
      preferable number of threads set for this component.
    • processPacket

      public void processPacket(Packet packet)
      Description copied from class: AbstractMessageReceiver
      This is the main Packet processing method. It is called concurrently from many threads so implementing it in thread save manner is essential. The method is called for each packet addressed to the component.
      Please note, the Packet instance may be processed by different parts of the server, different components or plugins at the same time. Therefore this is very important to tread the Packet instance as unmodifiable object.
      Processing in this method is asynchronous, therefore there is no result value. If there are some 'result' packets generated during processing, they should be passed back using addOutPacket(Packet) method.
      Specified by:
      processPacket in class AbstractMessageReceiver
      Parameters:
      packet - is an instance of the Packet class passed for processing.
    • setAllActions

      public void setAllActions(List<ActionIfc> actions)
    • register

      public void register(Kernel kernel)
      Description copied from interface: RegistrarBean
      Method called when bean is being registered allowing developer to programatically register other beans.
      Specified by:
      register in interface RegistrarBean
      Parameters:
      kernel - - instance from local scope
    • unregister

      public void unregister(Kernel kernel)
      Description copied from interface: RegistrarBean
      Method called while bean is being unregistered.
      Specified by:
      unregister in interface RegistrarBean
      Parameters:
      kernel - - instance from local scope