org.jboss.jca.core.workmanager.transport.remote

## Class AbstractRemoteTransport<T>

- java.lang.Object
- - org.jboss.jca.core.workmanager.transport.remote.AbstractRemoteTransport<T>

- Type Parameters:
    `T` - the type
  All Implemented Interfaces:
    org.jboss.jca.core.spi.workmanager.transport.Transport
  Direct Known Subclasses:
    JGroupsTransport, SocketTransport

      public abstract class AbstractRemoteTransport<T>
      extends java.lang.Object
      implements org.jboss.jca.core.spi.workmanager.transport.Transport

  An abstract transport for remote communication
  Author:
    Stefano Maestri, Jesper Pedersen

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.concurrent.ExecutorService` | `executorService` The kernel executorService
    `protected java.util.Map<org.jboss.jca.core.spi.workmanager.Address,T>` | `nodes` The nodes

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractRemoteTransport()` Constructor

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearDistributedStatistics(org.jboss.jca.core.spi.workmanager.Address address)` Clear distributed statistics
    `void` | `deltaDoWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)` Delta doWork accepted
    `void` | `deltaDoWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)` Delta doWork rejected
    `void` | `deltaScheduleWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)` Delta scheduleWork accepted
    `void` | `deltaScheduleWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)` Delta scheduleWork rejected
    `void` | `deltaStartWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)` Delta startWork accepted
    `void` | `deltaStartWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)` Delta startWork rejected
    `void` | `deltaWorkFailed(org.jboss.jca.core.spi.workmanager.Address address)` Delta work failed
    `void` | `deltaWorkSuccessful(org.jboss.jca.core.spi.workmanager.Address address)` Delta work successful
    `void` | `doWork(org.jboss.jca.core.spi.workmanager.Address address, javax.resource.spi.work.DistributableWork work)` doWork
    `java.util.Set<org.jboss.jca.core.spi.workmanager.Address>` | `getAddresses(T physicalAddress)` Get the addresses
    `org.jboss.jca.core.api.workmanager.DistributedWorkManagerStatisticsValues` | `getDistributedStatistics(org.jboss.jca.core.spi.workmanager.Address address)` Get the distributed statistics
    `java.util.concurrent.ExecutorService` | `getExecutorService()` Get the executorService.
    `java.lang.String` | `getId()` Get the identifier of the transport
    `long` | `getLongRunningFree(org.jboss.jca.core.spi.workmanager.Address address)` Get The number of free thread in long running pool from a distributed work manager
    `protected abstract T` | `getOwnAddress()` Get the own address
    `long` | `getShortRunningFree(org.jboss.jca.core.spi.workmanager.Address address)` Get The number of free thread in short running pool from a distributed work manager
    `void` | `join(org.jboss.jca.core.spi.workmanager.Address logicalAddress, T physicalAddress)` join
    `void` | `leave(T physicalAddress)` leave
    `void` | `localClearDistributedStatistics(org.jboss.jca.core.spi.workmanager.Address logicalAddress)` localClearDistributedStatistics
    `void` | `localDeltaDoWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)` Local delta doWork accepted
    `void` | `localDeltaDoWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)` Local delta doWork rejected
    `void` | `localDeltaScheduleWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)` Local delta scheduleWork accepted
    `void` | `localDeltaScheduleWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)` Local delta scheduleWork rejected
    `void` | `localDeltaStartWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)` Local delta startWork accepted
    `void` | `localDeltaStartWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)` Local delta startWork rejected
    `void` | `localDeltaWorkFailed(org.jboss.jca.core.spi.workmanager.Address address)` Local delta work failed
    `void` | `localDeltaWorkSuccessful(org.jboss.jca.core.spi.workmanager.Address address)` Local delta work successful
    `void` | `localDoWork(org.jboss.jca.core.spi.workmanager.Address address, javax.resource.spi.work.DistributableWork work)` localDoWork
    `org.jboss.jca.core.api.workmanager.DistributedWorkManagerStatisticsValues` | `localGetDistributedStatistics(org.jboss.jca.core.spi.workmanager.Address address)` localGetDistributedStatistics
    `long` | `localGetLongRunningFree(org.jboss.jca.core.spi.workmanager.Address address)` localGetLongRunningFree
    `long` | `localGetShortRunningFree(org.jboss.jca.core.spi.workmanager.Address address)` localGetShortRunningFree
    `long` | `localPing()` localPing
    `void` | `localScheduleWork(org.jboss.jca.core.spi.workmanager.Address address, javax.resource.spi.work.DistributableWork work)` localScheduleWork
    `long` | `localStartWork(org.jboss.jca.core.spi.workmanager.Address address, javax.resource.spi.work.DistributableWork work)` localStartWork
    `void` | `localUpdateLongRunningFree(org.jboss.jca.core.spi.workmanager.Address logicalAddress, java.lang.Long freeCount)` localUpdateLongRunningFree
    `void` | `localUpdateShortRunningFree(org.jboss.jca.core.spi.workmanager.Address logicalAddress, java.lang.Long freeCount)` localUpdateShortRunningFree
    `void` | `localWorkManagerAdd(org.jboss.jca.core.spi.workmanager.Address address, T physicalAddress)` localWorkManagerAdd
    `void` | `localWorkManagerRemove(org.jboss.jca.core.spi.workmanager.Address address)` localWorkManagerRemove
    `long` | `ping(org.jboss.jca.core.spi.workmanager.Address address)` Ping time to a distributed work manager
    `void` | `register(org.jboss.jca.core.spi.workmanager.Address address)` Register
    `void` | `scheduleWork(org.jboss.jca.core.spi.workmanager.Address address, javax.resource.spi.work.DistributableWork work)` scheduleWork
    `protected abstract java.io.Serializable` | `sendMessage(T physicalAddress, ProtocolMessages.Request request, java.io.Serializable... parameters)` send a messagge using specific protocol.
    `void` | `setExecutorService(java.util.concurrent.ExecutorService executorService)` Set the executorService.
    `void` | `setId(java.lang.String id)` Set the identifier
    `long` | `startWork(org.jboss.jca.core.spi.workmanager.Address address, javax.resource.spi.work.DistributableWork work)` startWork
    `void` | `unregister(org.jboss.jca.core.spi.workmanager.Address address)` Unregister
    `void` | `updateLongRunningFree(org.jboss.jca.core.spi.workmanager.Address address, long freeCount)` Update The number of free thread in long running pool from a distributed work manager
    `void` | `updateShortRunningFree(org.jboss.jca.core.spi.workmanager.Address address, long freeCount)` Update The number of free thread in short running pool from a distributed work manager

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

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

    - ### Methods inherited from interface org.jboss.jca.core.spi.workmanager.transport.Transport

      `initialize, isInitialized, shutdown, startup`

- - ### Field Detail

    - #### executorService

          protected java.util.concurrent.ExecutorService executorService

      The kernel executorService

    - #### nodes

          protected java.util.Map<org.jboss.jca.core.spi.workmanager.Address,T> nodes

      The nodes

  - ### Constructor Detail

    - #### AbstractRemoteTransport

          public AbstractRemoteTransport()

      Constructor

  - ### Method Detail

    - #### getId

          public java.lang.String getId()

      Get the identifier of the transport
      Specified by:
        `getId` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Returns:
        The value

    - #### setId

          public void setId(java.lang.String id)

      Set the identifier
      Parameters:
        `id` - The value

    - #### ping

          public long ping(org.jboss.jca.core.spi.workmanager.Address address)

      Ping time to a distributed work manager
      Specified by:
        `ping` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
      Returns:
        The ping time in milliseconds

    - #### getShortRunningFree

          public long getShortRunningFree(org.jboss.jca.core.spi.workmanager.Address address)

      Description copied from interface: `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Get The number of free thread in short running pool from a distributed work manager
      Specified by:
        `getShortRunningFree` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
      Returns:
        The number of free thread in short running pool

    - #### getLongRunningFree

          public long getLongRunningFree(org.jboss.jca.core.spi.workmanager.Address address)

      Description copied from interface: `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Get The number of free thread in long running pool from a distributed work manager
      Specified by:
        `getLongRunningFree` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
      Returns:
        The number of free thread in long running pool

    - #### updateShortRunningFree

          public void updateShortRunningFree(org.jboss.jca.core.spi.workmanager.Address address,
                                             long freeCount)

      Description copied from interface: `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Update The number of free thread in short running pool from a distributed work manager
      Specified by:
        `updateShortRunningFree` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
        `freeCount` - the number of freeThread

    - #### updateLongRunningFree

          public void updateLongRunningFree(org.jboss.jca.core.spi.workmanager.Address address,
                                            long freeCount)

      Description copied from interface: `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Update The number of free thread in long running pool from a distributed work manager
      Specified by:
        `updateLongRunningFree` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
        `freeCount` - the number of freeThread

    - #### getDistributedStatistics

          public org.jboss.jca.core.api.workmanager.DistributedWorkManagerStatisticsValues getDistributedStatistics(org.jboss.jca.core.spi.workmanager.Address address)

      Get the distributed statistics
      Specified by:
        `getDistributedStatistics` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
      Returns:
        The value

    - #### clearDistributedStatistics

          public void clearDistributedStatistics(org.jboss.jca.core.spi.workmanager.Address address)

      Clear distributed statistics
      Specified by:
        `clearDistributedStatistics` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### deltaDoWorkAccepted

          public void deltaDoWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)

      Delta doWork accepted
      Specified by:
        `deltaDoWorkAccepted` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### deltaDoWorkRejected

          public void deltaDoWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)

      Delta doWork rejected
      Specified by:
        `deltaDoWorkRejected` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### deltaStartWorkAccepted

          public void deltaStartWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)

      Delta startWork accepted
      Specified by:
        `deltaStartWorkAccepted` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### deltaStartWorkRejected

          public void deltaStartWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)

      Delta startWork rejected
      Specified by:
        `deltaStartWorkRejected` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### deltaScheduleWorkAccepted

          public void deltaScheduleWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)

      Delta scheduleWork accepted
      Specified by:
        `deltaScheduleWorkAccepted` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### deltaScheduleWorkRejected

          public void deltaScheduleWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)

      Delta scheduleWork rejected
      Specified by:
        `deltaScheduleWorkRejected` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### deltaWorkSuccessful

          public void deltaWorkSuccessful(org.jboss.jca.core.spi.workmanager.Address address)

      Delta work successful
      Specified by:
        `deltaWorkSuccessful` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### deltaWorkFailed

          public void deltaWorkFailed(org.jboss.jca.core.spi.workmanager.Address address)

      Delta work failed
      Specified by:
        `deltaWorkFailed` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### doWork

          public void doWork(org.jboss.jca.core.spi.workmanager.Address address,
                             javax.resource.spi.work.DistributableWork work)
                      throws javax.resource.spi.work.WorkException

      doWork
      Specified by:
        `doWork` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
        `work` - The work
      Throws:
        `javax.resource.spi.work.WorkException` - Thrown if an error occurs

    - #### scheduleWork

          public void scheduleWork(org.jboss.jca.core.spi.workmanager.Address address,
                                   javax.resource.spi.work.DistributableWork work)
                            throws javax.resource.spi.work.WorkException

      scheduleWork
      Specified by:
        `scheduleWork` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
        `work` - The work
      Throws:
        `javax.resource.spi.work.WorkException` - Thrown if an error occurs

    - #### startWork

          public long startWork(org.jboss.jca.core.spi.workmanager.Address address,
                                javax.resource.spi.work.DistributableWork work)
                         throws javax.resource.spi.work.WorkException

      startWork
      Specified by:
        `startWork` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address
        `work` - The work
      Returns:
        The delay
      Throws:
        `javax.resource.spi.work.WorkException` - Thrown if an error occurs

    - #### getExecutorService

          public java.util.concurrent.ExecutorService getExecutorService()

      Get the executorService.
      Returns:
        the executorService.

    - #### setExecutorService

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

      Set the executorService.
      Parameters:
        `executorService` - The executorService to set.

    - #### register

          public void register(org.jboss.jca.core.spi.workmanager.Address address)

      Register
      Specified by:
        `register` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### unregister

          public void unregister(org.jboss.jca.core.spi.workmanager.Address address)

      Unregister
      Specified by:
        `unregister` in interface `org.jboss.jca.core.spi.workmanager.transport.Transport`
      Parameters:
        `address` - The address

    - #### getAddresses

          public java.util.Set<org.jboss.jca.core.spi.workmanager.Address> getAddresses(T physicalAddress)

      Get the addresses
      Parameters:
        `physicalAddress` - the physical address
      Returns:
        The logical addresses associated

    - #### join

          public void join(org.jboss.jca.core.spi.workmanager.Address logicalAddress,
                           T physicalAddress)

      join
      Parameters:
        `logicalAddress` - the logical address
        `physicalAddress` - the physical address

    - #### leave

          public void leave(T physicalAddress)

      leave
      Parameters:
        `physicalAddress` - the physical address

    - #### localPing

          public long localPing()

      localPing
      Returns:
        the ping value

    - #### localWorkManagerAdd

          public void localWorkManagerAdd(org.jboss.jca.core.spi.workmanager.Address address,
                                          T physicalAddress)

      localWorkManagerAdd
      Parameters:
        `address` - the logical address
        `physicalAddress` - the physical address

    - #### localWorkManagerRemove

          public void localWorkManagerRemove(org.jboss.jca.core.spi.workmanager.Address address)

      localWorkManagerRemove
      Parameters:
        `address` - the logical address

    - #### localDoWork

          public void localDoWork(org.jboss.jca.core.spi.workmanager.Address address,
                                  javax.resource.spi.work.DistributableWork work)
                           throws javax.resource.spi.work.WorkException

      localDoWork
      Parameters:
        `address` - the logical address
        `work` - the work
      Throws:
        `javax.resource.spi.work.WorkException` - in case of error

    - #### localStartWork

          public long localStartWork(org.jboss.jca.core.spi.workmanager.Address address,
                                     javax.resource.spi.work.DistributableWork work)
                              throws javax.resource.spi.work.WorkException

      localStartWork
      Parameters:
        `address` - the logical address
        `work` - the work
      Returns:
        the start value
      Throws:
        `javax.resource.spi.work.WorkException` - in case of error

    - #### localScheduleWork

          public void localScheduleWork(org.jboss.jca.core.spi.workmanager.Address address,
                                        javax.resource.spi.work.DistributableWork work)
                                 throws javax.resource.spi.work.WorkException

      localScheduleWork
      Parameters:
        `address` - the logical address
        `work` - the work
      Throws:
        `javax.resource.spi.work.WorkException` - in case of error

    - #### localGetShortRunningFree

          public long localGetShortRunningFree(org.jboss.jca.core.spi.workmanager.Address address)

      localGetShortRunningFree
      Parameters:
        `address` - the logical address
      Returns:
        the free count

    - #### localGetLongRunningFree

          public long localGetLongRunningFree(org.jboss.jca.core.spi.workmanager.Address address)

      localGetLongRunningFree
      Parameters:
        `address` - the logical address
      Returns:
        the free count

    - #### localUpdateShortRunningFree

          public void localUpdateShortRunningFree(org.jboss.jca.core.spi.workmanager.Address logicalAddress,
                                                  java.lang.Long freeCount)

      localUpdateShortRunningFree
      Parameters:
        `logicalAddress` - the logical address
        `freeCount` - the free count

    - #### localUpdateLongRunningFree

          public void localUpdateLongRunningFree(org.jboss.jca.core.spi.workmanager.Address logicalAddress,
                                                 java.lang.Long freeCount)

      localUpdateLongRunningFree
      Parameters:
        `logicalAddress` - the logical address
        `freeCount` - the free count

    - #### localGetDistributedStatistics

          public org.jboss.jca.core.api.workmanager.DistributedWorkManagerStatisticsValues localGetDistributedStatistics(org.jboss.jca.core.spi.workmanager.Address address)

      localGetDistributedStatistics
      Parameters:
        `address` - the logical address
      Returns:
        The value

    - #### localClearDistributedStatistics

          public void localClearDistributedStatistics(org.jboss.jca.core.spi.workmanager.Address logicalAddress)

      localClearDistributedStatistics
      Parameters:
        `logicalAddress` - the logical address

    - #### localDeltaDoWorkAccepted

          public void localDeltaDoWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)

      Local delta doWork accepted
      Parameters:
        `address` - the logical address

    - #### localDeltaDoWorkRejected

          public void localDeltaDoWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)

      Local delta doWork rejected
      Parameters:
        `address` - the logical address

    - #### localDeltaStartWorkAccepted

          public void localDeltaStartWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)

      Local delta startWork accepted
      Parameters:
        `address` - the logical address

    - #### localDeltaStartWorkRejected

          public void localDeltaStartWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)

      Local delta startWork rejected
      Parameters:
        `address` - the logical address

    - #### localDeltaScheduleWorkAccepted

          public void localDeltaScheduleWorkAccepted(org.jboss.jca.core.spi.workmanager.Address address)

      Local delta scheduleWork accepted
      Parameters:
        `address` - the logical address

    - #### localDeltaScheduleWorkRejected

          public void localDeltaScheduleWorkRejected(org.jboss.jca.core.spi.workmanager.Address address)

      Local delta scheduleWork rejected
      Parameters:
        `address` - the logical address

    - #### localDeltaWorkSuccessful

          public void localDeltaWorkSuccessful(org.jboss.jca.core.spi.workmanager.Address address)

      Local delta work successful
      Parameters:
        `address` - the logical address

    - #### localDeltaWorkFailed

          public void localDeltaWorkFailed(org.jboss.jca.core.spi.workmanager.Address address)

      Local delta work failed
      Parameters:
        `address` - the logical address

    - #### getOwnAddress

          protected abstract T getOwnAddress()

      Get the own address
      Returns:
        The value

    - #### sendMessage

          protected abstract java.io.Serializable sendMessage(T physicalAddress,
                                                              ProtocolMessages.Request request,
                                                              java.io.Serializable... parameters)
                                                       throws javax.resource.spi.work.WorkException

      send a messagge using specific protocol. Method overridden in specific protocol implementation classes
      Parameters:
        `physicalAddress` - the physical address
        `request` - the request
        `parameters` - the parameters
      Returns:
        the returned value. Can be null if requested operation return a void
      Throws:
        `javax.resource.spi.work.WorkException` - in case of problem with the work

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)