Package org.eclipse.spi.net4j

## Class Protocol<INFRA_STRUCTURE>

- java.lang.Object
- - org.eclipse.net4j.util.event.Notifier
  - - org.eclipse.net4j.util.lifecycle.Lifecycle
    - - org.eclipse.spi.net4j.Protocol<INFRA_STRUCTURE>

- All Implemented Interfaces:
    `IBufferHandler`, `ILocationAware`, `IProtocol<INFRA_STRUCTURE>`, `IProtocol2<INFRA_STRUCTURE>`, `org.eclipse.net4j.util.concurrent.IExecutorServiceProvider`, `org.eclipse.net4j.util.event.INotifier`, `org.eclipse.net4j.util.event.INotifier.INotifier2`, `org.eclipse.net4j.util.lifecycle.IDeactivateable`, `org.eclipse.net4j.util.lifecycle.ILifecycle`, `org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation`, `org.eclipse.net4j.util.security.IUserAware`
  Direct Known Subclasses:
    `SignalProtocol`

      public abstract class Protocol<INFRA_STRUCTURE>
      extends org.eclipse.net4j.util.lifecycle.Lifecycle
      implements IProtocol2<INFRA_STRUCTURE>, org.eclipse.net4j.util.concurrent.IExecutorServiceProvider

  If the meaning of this type isn't clear, there really should be more of a description here...
  Since:
    2.0
  Author:
    Eike Stepper

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

      `org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.ILocationAware

      `ILocationAware.Location`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

      `org.eclipse.net4j.util.event.INotifier.INotifier2`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `USE_LABEL`

    - ### Fields inherited from interface org.eclipse.net4j.protocol.IProtocol2

      `UNSPECIFIED_VERSION`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Protocol​(java.lang.String type)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `doBeforeActivate()` |
    `protected void` | `doDeactivate()` |
    `IBufferProvider` | `getBufferProvider()` |
    `IChannel` | `getChannel()` |
    `java.util.concurrent.ExecutorService` | `getExecutorService()` |
    `INFRA_STRUCTURE` | `getInfraStructure()` |
    `ILocationAware.Location` | `getLocation()` | Returns the location of this object in a `client`/`server` scenario.
    `java.lang.String` | `getType()` |
    `java.lang.String` | `getUserID()` |
    `int` | `getVersion()` |
    `protected void` | `handleChannelDeactivation()` |
    `boolean` | `isClient()` | Same as ``ILocationAware.getLocation()` == `ILocationAware.Location.CLIENT``.
    `boolean` | `isServer()` | Same as ``ILocationAware.getLocation()` == `ILocationAware.Location.SERVER``.
    `void` | `setChannel​(IChannel newChannel)` |
    `void` | `setExecutorService​(java.util.concurrent.ExecutorService executorService)` |
    `void` | `setInfraStructure​(INFRA_STRUCTURE infraStructure)` |
    `protected void` | `setUserID​(java.lang.String userID)` |

    - ### Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString`

    - ### Methods inherited from class org.eclipse.net4j.util.event.Notifier

      `addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener`

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

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

    - ### Methods inherited from interface org.eclipse.net4j.buffer.IBufferHandler

      `handleBuffer`

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

- - ### Constructor Detail

    - #### Protocol

          public Protocol​(java.lang.String type)

  - ### Method Detail

    - #### getType

          public final java.lang.String getType()

      Specified by:
        `getType` in interface `IProtocol<INFRA_STRUCTURE>`

    - #### getVersion

          public int getVersion()

      Specified by:
        `getVersion` in interface `IProtocol2<INFRA_STRUCTURE>`
      Since:
        4.2

    - #### getExecutorService

          public java.util.concurrent.ExecutorService getExecutorService()

      Specified by:
        `getExecutorService` in interface `org.eclipse.net4j.util.concurrent.IExecutorServiceProvider`
      Specified by:
        `getExecutorService` in interface `IProtocol<INFRA_STRUCTURE>`

    - #### setExecutorService

          public void setExecutorService​(java.util.concurrent.ExecutorService executorService)

      Specified by:
        `setExecutorService` in interface `IProtocol<INFRA_STRUCTURE>`

    - #### getBufferProvider

          public IBufferProvider getBufferProvider()

      Specified by:
        `getBufferProvider` in interface `IProtocol<INFRA_STRUCTURE>`

    - #### getInfraStructure

          public INFRA_STRUCTURE getInfraStructure()

      Specified by:
        `getInfraStructure` in interface `IProtocol<INFRA_STRUCTURE>`

    - #### setInfraStructure

          public void setInfraStructure​(INFRA_STRUCTURE infraStructure)

      Specified by:
        `setInfraStructure` in interface `IProtocol<INFRA_STRUCTURE>`

    - #### getLocation

          public ILocationAware.Location getLocation()

      Description copied from interface: `ILocationAware`
      Returns the location of this object in a `client`/`server` scenario.
      Specified by:
        `getLocation` in interface `ILocationAware`
      Since:
        2.0

    - #### isClient

          public boolean isClient()

      Description copied from interface: `ILocationAware`
      Same as ``ILocationAware.getLocation()` == `ILocationAware.Location.CLIENT``.
      Specified by:
        `isClient` in interface `ILocationAware`
      Since:
        2.0

    - #### isServer

          public boolean isServer()

      Description copied from interface: `ILocationAware`
      Same as ``ILocationAware.getLocation()` == `ILocationAware.Location.SERVER``.
      Specified by:
        `isServer` in interface `ILocationAware`
      Since:
        2.0

    - #### getChannel

          public IChannel getChannel()

      Specified by:
        `getChannel` in interface `IProtocol<INFRA_STRUCTURE>`

    - #### setChannel

          public void setChannel​(IChannel newChannel)

      Specified by:
        `setChannel` in interface `IProtocol<INFRA_STRUCTURE>`

    - #### getUserID

          public java.lang.String getUserID()

      Specified by:
        `getUserID` in interface `org.eclipse.net4j.util.security.IUserAware`

    - #### setUserID

          protected void setUserID​(java.lang.String userID)

    - #### handleChannelDeactivation

          protected void handleChannelDeactivation()

      Since:
        2.0

    - #### doBeforeActivate

          protected void doBeforeActivate()
                                   throws java.lang.Exception

      Overrides:
        `doBeforeActivate` in class `org.eclipse.net4j.util.lifecycle.Lifecycle`
      Throws:
        `java.lang.Exception`

    - #### doDeactivate

          protected void doDeactivate()
                               throws java.lang.Exception

      Overrides:
        `doDeactivate` in class `org.eclipse.net4j.util.lifecycle.Lifecycle`
      Throws:
        `java.lang.Exception`