Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.qos
Class ScalingPolicyHandler

    java.lang.Object
      org.jini.rio.qos.SLAPolicyHandler
          org.jini.rio.qos.ScalingPolicyHandler

All Implemented Interfaces:
  Remote, ServerProxyTrust, ServiceProvisionListener, ThresholdListener

    public class ScalingPolicyHandler

extends SLAPolicyHandler
implements ServiceProvisionListener, ServerProxyTrust

The ScalingPolicyHandler will increment and optionally decrement instances of the ServiceBean it is associated to based on limits set for the SLA. The ScalingPolicyHandler will look for attributes set that can control it's operational behavior,.

The ScalingPolicyHandler supports the following configuration entries; where each configuration entry name is associated with the component name `org.jini.rio.qos.ScalingPolicyHandler`

- MaxServices

  Type: | int
  Default: | -1 ``
  Description: | The maximum amount of services to scale up to. The default value of -1 signifies that there is no upper limit.

- MinServices

  Type: | int
  Default: | 1 ``
  Description: | The minimum amount of services to scale down to. The default value of 1 signifies that thereshould always be 1 service available

- DestroyOnDecrement

  Type: | boolean
  Default: | true ``
  Description: | If the ScalablePolicyHandler determines that it will decrement (scale back) the number of instance(s) the ProvisionMonitor should maintain, it will also inform the service to destroy itself upon decrmenting

- SendRemoteNotification

  Type: | boolean
  Default: | true ``
  Description: | The ScalablePolicyHandler will only send an SLAThresholdEvent if this value is true. An SLAThresholdEvent is sent when defined thresholds have been breached or cleared

- UpperThresholdDampeningFactor

  Type: | long
  Default: | 0 ``
  Description: | The UpperThresholdDampeningFactor is a value in milliseconds that is used to provides a mechanism to avoid thrashing around oscillations when dealing with upper thresholds being crossed.

- LowerThresholdDampeningFactor

  Type: | long
  Default: | 0 ``
  Description: | The LowerThresholdDampeningFactor is a value in milliseconds that is used to provides a mechanism to avoid thrashing around oscillations when dealing with lower thresholds being crossed.

- provisionListenerExporter

  Type: | Exporter
  Default: | A new `BasicJeriExporter` with a `TcpServerEndpoint` created on a random port, a `BasicILFactory`, distributed garbage collection turned off, keep alive on. ``
  Description: | The Exporter used to export the ProvisionListener server. A new exporter is obtained every time a ScalablePolicyHandler needs to export itself.

Field Summary
`static String` | `DECREMENT_DESTROY_SENT` Action that indicates that a decrement command with destroy set to true has been sent
`static String` | `DECREMENT_FAILED` Action that indicates that a decrement command failed to be sent
`static String` | `DECREMENT_SENT` Action that indicates that a decrement command has been sent
`static String` | `DESTROY_DECREMENT` Destroy the service when decrementing
`static String` | `INCREMENT_FAILURE` Action that indicates an increment request has failed
`static String` | `INCREMENT_PENDING` Action that indicates an increment request is pending
`static String` | `INCREMENT_SUCCEEDED` Action that indicates an increment request has succeeded.
`static String` | `LOWER_DAMPER` Time to act on lower threshold breaches
`static String` | `MAX_SERVICES` Maximum Services to scale up to
`static String` | `MIN_SERVICES` Minimum Services to scale down to
`static String` | `SEND_NOTIFICATION` Send remote notification as SLAThresholdEvent
`static int` | `UNDEFINED` Undefined maximum number of services to increment to
`static String` | `UPPER_DAMPER` Time to act on upper threshold breaches

Fields inherited from class org.jini.rio.qos.SLAPolicyHandler
`context, eventSource, initialized, thresholdManager`

Constructor Summary
`ScalingPolicyHandler(SLA sla)` Construct a ScalingPolicyHandler

Method Summary
`void` | `disconnect()` Disconnect from the ThresholdManager
`protected void` | `doDecrement()` Do the decrement
`protected void` | `doIncrement()` Do the increment
`void` | `failed(ServiceElement sElem, boolean resubmitted)` Notify listener that the Service described by the ServiceElement has not been provision succesfully
`String` | `getDescription()` Get the description
`boolean` | `getDestroyOnDecrement()` Get the destroyOnDecrement property
`protected String` | `getName()`
`TrustVerifier` | `getProxyVerifier()` Returns a `TrustVerifier` which can be used to verify that a given proxy to this policy handler can be trusted
`protected int` | `getTotalKnownServices()`
`void` | `initialize(Object eventSource, EventHandler eventHandler, ServiceBeanContext context)` Prepare the SLAPolicyHandler for processing.
`void` | `notify(Calculable calculable, ThresholdValues thresholdValues, int type)` Notify for a threshold event
`void` | `setDestroyOnDecrement(boolean destroyOnDecrement)` Set the destroyOnDecrement property
`void` | `setThresholdManager(ThresholdManager thresholdManager)` Set the ThresholdManager and connect to the ThresholdManager
`void` | `succeeded(ServiceBeanInstance jsbInstance)` Notify listener that the Service described by the ServiceBeanInstance has been provisioned succesfully
`void` | `updateSLA(SLA sla)` Update the SLA

Methods inherited from class org.jini.rio.qos.SLAPolicyHandler
`getConfiguration, getEventSource, getID, getSLA, getThresholdManager, notifyListeners, registerListener, sendSLAThresholdEvent, setSendRemoteNotification, unregisterListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MAX_SERVICES

    public static final String MAX_SERVICES

  Maximum Services to scale up to

  See Also:
    Constant Field Values

### MIN_SERVICES

    public static final String MIN_SERVICES

  Minimum Services to scale down to

  See Also:
    Constant Field Values

### DESTROY_DECREMENT

    public static final String DESTROY_DECREMENT

  Destroy the service when decrementing

  See Also:
    Constant Field Values

### SEND_NOTIFICATION

    public static final String SEND_NOTIFICATION

  Send remote notification as SLAThresholdEvent

  See Also:
    Constant Field Values

### UPPER_DAMPER

    public static final String UPPER_DAMPER

  Time to act on upper threshold breaches

  See Also:
    Constant Field Values

### LOWER_DAMPER

    public static final String LOWER_DAMPER

  Time to act on lower threshold breaches

  See Also:
    Constant Field Values

### INCREMENT_PENDING

    public static final String INCREMENT_PENDING

  Action that indicates an increment request is pending

  See Also:
    Constant Field Values

### INCREMENT_FAILURE

    public static final String INCREMENT_FAILURE

  Action that indicates an increment request has failed

  See Also:
    Constant Field Values

### INCREMENT_SUCCEEDED

    public static final String INCREMENT_SUCCEEDED

  Action that indicates an increment request has succeeded. The resultant Object in the SLAPolicyEvent will be the proxy of the new service

  See Also:
    Constant Field Values

### DECREMENT_SENT

    public static final String DECREMENT_SENT

  Action that indicates that a decrement command has been sent

  See Also:
    Constant Field Values

### DECREMENT_DESTROY_SENT

    public static final String DECREMENT_DESTROY_SENT

  Action that indicates that a decrement command with destroy set to true has been sent

  See Also:
    Constant Field Values

### DECREMENT_FAILED

    public static final String DECREMENT_FAILED

  Action that indicates that a decrement command failed to be sent

  See Also:
    Constant Field Values

### UNDEFINED

    public static final int UNDEFINED

  Undefined maximum number of services to increment to

  See Also:
    Constant Field Values

Constructor Detail

### ScalingPolicyHandler

    public ScalingPolicyHandler(SLA sla)

  Construct a ScalingPolicyHandler

  Parameters:
    `sla` - The SLA for the ScalingPolicyHandler

Method Detail

### getDescription

    public String getDescription()

  Description copied from class: `SLAPolicyHandler`
  Get the description

  Overrides:
    `getDescription` in class `SLAPolicyHandler`
  Returns:
    String The descriptive attribute for this SLA Handler

### setThresholdManager

    public void setThresholdManager(ThresholdManager thresholdManager)

  Description copied from interface: `ThresholdListener`
  Set the ThresholdManager and connect to the ThresholdManager

  Specified by:
    `setThresholdManager` in interface `ThresholdListener`
  Overrides:
    `setThresholdManager` in class `SLAPolicyHandler`
  Parameters:
    `thresholdManager` - The ThresholdManager to connect to
  See Also:
    `ThresholdListener.setThresholdManager(org.jini.rio.watch.ThresholdManager)`

### disconnect

    public void disconnect()

  Description copied from class: `SLAPolicyHandler`
  Disconnect from the ThresholdManager

  Overrides:
    `disconnect` in class `SLAPolicyHandler`

### updateSLA

    public void updateSLA(SLA sla)

  Description copied from class: `SLAPolicyHandler`
  Update the SLA

  Overrides:
    `updateSLA` in class `SLAPolicyHandler`
  Parameters:
    `sla` - The SLA

### initialize

    public void initialize(Object eventSource,
                           EventHandler eventHandler,
                           ServiceBeanContext context)

  Description copied from class: `SLAPolicyHandler`
  Prepare the SLAPolicyHandler for processing. The method will only set these values if the SLAPolicyHandler has not been initialized before

  Overrides:
    `initialize` in class `SLAPolicyHandler`
  Parameters:
    `eventSource` - The object to be used as the remote event source
    `eventHandler` - Handler which sends events
    `context` - The ServiceBeanContext

### setDestroyOnDecrement

    public void setDestroyOnDecrement(boolean destroyOnDecrement)

  Set the destroyOnDecrement property

  Parameters:
    `destroyOnDecrement` - The destroyOnDecrement property is used to determine if the ScalingPolicyHandler will automatically decrement the amount of services to maintain in the OperationalString and destroy the ServiceBean that the ScalingPolicyHandler is associated to

### getDestroyOnDecrement

    public boolean getDestroyOnDecrement()

  Get the destroyOnDecrement property

  Returns:
    The destroyOnDecrement property is used to determine if the ScalingPolicyHandler will automatically decrement the amount of services to maintain in the OperationalString and destroy the ServiceBean that the ScalingPolicyHandler is associated to

### notify

    public void notify(Calculable calculable,
                       ThresholdValues thresholdValues,
                       int type)

  Description copied from interface: `ThresholdListener`
  Notify for a threshold event

  Specified by:
    `notify` in interface `ThresholdListener`
  Overrides:
    `notify` in class `SLAPolicyHandler`
  Parameters:
    `calculable` - The current metric
    `thresholdValues` - The current thresholds
    `type` - The type of threshold event, breached or cleared
  See Also:
    `ThresholdListener.notify(org.jini.rio.watch.Calculable, org.jini.rio.core.ThresholdValues, int)`

### succeeded

    public void succeeded(ServiceBeanInstance jsbInstance)
                   throws RemoteException

  Description copied from interface: `ServiceProvisionListener`
  Notify listener that the Service described by the ServiceBeanInstance has been provisioned succesfully

  Specified by:
    `succeeded` in interface `ServiceProvisionListener`
  Parameters:
    `jsbInstance` - The ServiceBeanInstance
  Throws:
    `RemoteException` - If communication errors occur
  See Also:
    `ServiceProvisionListener.succeeded(org.jini.rio.core.ServiceBeanInstance)`

### failed

    public void failed(ServiceElement sElem,
                       boolean resubmitted)
                throws RemoteException

  Description copied from interface: `ServiceProvisionListener`
  Notify listener that the Service described by the ServiceElement has not been provision succesfully

  Specified by:
    `failed` in interface `ServiceProvisionListener`
  Parameters:
    `sElem` - The ServiceElement
    `resubmitted` - Whether the Service described by the ServiceElement has been resubmitted for provisioning
  Throws:
    `RemoteException` - If communication errors occur
  See Also:
    `ServiceProvisionListener.failed(org.jini.rio.core.ServiceElement, boolean)`

### getProxyVerifier

    public TrustVerifier getProxyVerifier()

  Returns a `TrustVerifier` which can be used to verify that a given proxy to this policy handler can be trusted

  Specified by:
    `getProxyVerifier` in interface `ServerProxyTrust`

### getName

    protected String getName()

### getTotalKnownServices

    protected int getTotalKnownServices()
                                 throws Exception

  Throws:
    `Exception`

### doIncrement

    protected void doIncrement()

  Do the increment

### doDecrement

    protected void doDecrement()

  Do the decrement

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.