org.jboss.jca.core.workmanager.policy

## Class AbstractPolicy

- java.lang.Object
- - org.jboss.jca.core.workmanager.notification.AbstractNotificationListener
  - - org.jboss.jca.core.workmanager.policy.AbstractPolicy

- All Implemented Interfaces:
    org.jboss.jca.core.spi.workmanager.notification.NotificationListener, org.jboss.jca.core.spi.workmanager.policy.Policy
  Direct Known Subclasses:
    Always, Never, WaterMark

      public abstract class AbstractPolicy
      extends AbstractNotificationListener
      implements org.jboss.jca.core.spi.workmanager.policy.Policy

  An abstract policy
  Author:
    Jesper Pedersen

- - ### Field Summary

    - ### Fields inherited from class org.jboss.jca.core.workmanager.notification.AbstractNotificationListener

      `longRunning, shortRunning`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractPolicy()` Constructor

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.Boolean` | `getShouldDistribute(javax.resource.spi.work.DistributableWork work)` Get should distribute override
    `abstract boolean` | `shouldDistribute(org.jboss.jca.core.api.workmanager.DistributedWorkManager dwm, javax.resource.spi.work.DistributableWork work)` Should a distribution of the work happen

    - ### Methods inherited from class org.jboss.jca.core.workmanager.notification.AbstractNotificationListener

      `deltaDoWorkAccepted, deltaDoWorkRejected, deltaScheduleWorkAccepted, deltaScheduleWorkRejected, deltaStartWorkAccepted, deltaStartWorkRejected, deltaWorkFailed, deltaWorkSuccessful, join, leave, updateLongRunningFree, updateShortRunningFree`

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

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

- - ### Constructor Detail

    - #### AbstractPolicy

          public AbstractPolicy()

      Constructor

  - ### Method Detail

    - #### getShouldDistribute

          protected java.lang.Boolean getShouldDistribute(javax.resource.spi.work.DistributableWork work)

      Get should distribute override
      Parameters:
        `work` - The work instance
      Returns:
        The override, if none return null

    - #### shouldDistribute

          public abstract boolean shouldDistribute(org.jboss.jca.core.api.workmanager.DistributedWorkManager dwm,
                                                   javax.resource.spi.work.DistributableWork work)

      Should a distribution of the work happen
      Specified by:
        `shouldDistribute` in interface `org.jboss.jca.core.spi.workmanager.policy.Policy`
      Parameters:
        `dwm` - The invoking distributed work manager
        `work` - The work instance
      Returns:
        True, if the work should be distributed; otherwise false

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