org.apache.log4j.component.plugins

## Class MockReceiver

- java.lang.Object
- - org.apache.log4j.component.spi.ComponentBase
  - - org.apache.log4j.component.plugins.PluginSkeleton
    - - org.apache.log4j.component.plugins.MockReceiver

- All Implemented Interfaces:
    Plugin, Component, OptionHandler

      public final class MockReceiver
      extends PluginSkeleton

  Mock receiver used by PluginConfiguratorTest.

- - ### Field Summary

    - ### Fields inherited from class org.apache.log4j.component.plugins.PluginSkeleton

      `name`

    - ### Fields inherited from class org.apache.log4j.component.spi.ComponentBase

      `repository`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockReceiver()` Create new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activateOptions()` Activate options.
    `String` | `getHost()` Get the remote host to connect to for logging events.
    `int` | `getPort()` Get the remote port to connect to for logging events.
    `boolean` | `isActive()` Is plugin active.
    `void` | `setHost(String remoteHost)` Configures the Host property, this will require activateOptions to be called for this to take effect.
    `void` | `setPort(int p)` Set the remote port to connect to for logging events.
    `void` | `setPort(String remoteHost)` Set the remote host to connect to for logging events.
    `void` | `shutdown()` Shutdown.

    - ### Methods inherited from class org.apache.log4j.component.plugins.PluginSkeleton

      `addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, isEquivalent, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setName`

    - ### Methods inherited from class org.apache.log4j.component.spi.ComponentBase

      `getLogger, getNonFloodingLogger, resetErrorCount`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MockReceiver

          public MockReceiver()

      Create new instance.

  - ### Method Detail

    - #### shutdown

          public void shutdown()

      Shutdown.

    - #### isActive

          public boolean isActive()

      Is plugin active.
      Specified by:
        `isActive` in interface `Plugin`
      Overrides:
        `isActive` in class `PluginSkeleton`
      Returns:
        true if active.

    - #### activateOptions

          public void activateOptions()

      Activate options.

    - #### getHost

          public String getHost()

      Get the remote host to connect to for logging events.
      Returns:
        host

    - #### setHost

          public void setHost(String remoteHost)

      Configures the Host property, this will require activateOptions to be called for this to take effect.
      Parameters:
        `remoteHost` - address of remote host.

    - #### setPort

          public void setPort(String remoteHost)

      Set the remote host to connect to for logging events. Equivalent to setHost.
      Parameters:
        `remoteHost` - address of remote host.

    - #### getPort

          public int getPort()

      Get the remote port to connect to for logging events.
      Returns:
        port

    - #### setPort

          public void setPort(int p)

      Set the remote port to connect to for logging events.
      Parameters:
        `p` - port

Copyright © 2013 The Apache Software Foundation. Licensed under the Apache License, Version 2.0

Apache Extras for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.