Package org.apache.activemq.artemis.api.core.jgroups

## Class JChannelWrapper

- java.lang.Object
- - org.apache.activemq.artemis.api.core.jgroups.JChannelWrapper

-     public class JChannelWrapper
      extends java.lang.Object

  This class wraps a JChannel with a reference counter. The reference counter controls the life of the JChannel. When reference count is zero, the channel will be disconnected.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `JChannelWrapper​(JChannelManager manager, java.lang.String channelName, org.jgroups.JChannel channel)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addReceiver​(JGroupsReceiver jGroupsReceiver)` |
    `JChannelWrapper` | `addRef()` |
    `void` | `close​(boolean closeWrappedChannel)` |
    `void` | `closeChannel()` |
    `void` | `connect()` |
    `org.jgroups.JChannel` | `getChannel()` |
    `java.lang.String` | `getChannelName()` |
    `void` | `removeReceiver​(JGroupsReceiver receiver)` |
    `void` | `send​(org.jgroups.Message msg)` |
    `java.lang.String` | `toString()` |

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

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

- - ### Constructor Detail

    - #### JChannelWrapper

          public JChannelWrapper​(JChannelManager manager,
                                 java.lang.String channelName,
                                 org.jgroups.JChannel channel)
                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### getChannel

          public org.jgroups.JChannel getChannel()

    - #### getChannelName

          public java.lang.String getChannelName()

    - #### close

          public void close​(boolean closeWrappedChannel)

    - #### closeChannel

          public void closeChannel()

    - #### removeReceiver

          public void removeReceiver​(JGroupsReceiver receiver)

    - #### connect

          public void connect()
                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### addReceiver

          public void addReceiver​(JGroupsReceiver jGroupsReceiver)

    - #### send

          public void send​(org.jgroups.Message msg)
                    throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### addRef

          public JChannelWrapper addRef()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`