org.apache.ignite.internal.processors.continuous

## Class GridContinuousProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.continuous.GridContinuousProcessor

All Implemented Interfaces:
  GridComponent, GridProcessor

    public class GridContinuousProcessor
    extends GridProcessorAdapter

Processor for continuous routines.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`ctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridContinuousProcessor(GridKernalContext ctx)`

### Method Summary

Methods
`void` `addNotification(UUID nodeId, UUID routineId, Object obj, Object orderedTopic, boolean sync)`
`Object` `collectDiscoveryData(UUID nodeId)` Gets discovery data object that will be sent to new node during discovery process.
`GridComponent.DiscoveryDataExchangeType` `discoveryDataType()` Gets unique component type to distinguish components providing discovery data.
`void` `onDiscoveryDataReceived(Object obj)` Receives discovery data object from remote nodes (called on new node during discovery process).
`void` `start()` Starts grid component.
`IgniteInternalFuture<UUID>` `startRoutine(GridContinuousHandler hnd, int bufSize, long interval, boolean autoUnsubscribe, IgnitePredicate<ClusterNode> prjPred)`
`void` `stop(boolean cancel)` Stops grid component.
`IgniteInternalFuture<?>` `stopRoutine(UUID routineId)`

### Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`addAttributes, assertParameter, onKernalStart, onKernalStop, printMemoryStats, toString, validateNode`

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

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

### Constructor Detail

#### GridContinuousProcessor

    public GridContinuousProcessor(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

Specified by:
  `start` in interface `GridComponent`
Overrides:
  `start` in class `GridProcessorAdapter`
Throws:
  `IgniteCheckedException` - Throws in case of any errors.

#### stop

    public void stop(boolean cancel)
              throws IgniteCheckedException

Stops grid component.

Specified by:
  `stop` in interface `GridComponent`
Overrides:
  `stop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - If `true`, then all ongoing tasks or jobs for relevant components need to be cancelled.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### discoveryDataType

    @Nullable
    public GridComponent.DiscoveryDataExchangeType discoveryDataType()

Gets unique component type to distinguish components providing discovery data. Must return non-null value if component implements method `GridComponent.collectDiscoveryData(UUID)`.

Specified by:
  `discoveryDataType` in interface `GridComponent`
Overrides:
  `discoveryDataType` in class `GridProcessorAdapter`
Returns:
  Unique component type for discovery data exchange.

#### collectDiscoveryData

    @Nullable
    public Object collectDiscoveryData(UUID nodeId)

Gets discovery data object that will be sent to new node during discovery process.

Specified by:
  `collectDiscoveryData` in interface `GridComponent`
Overrides:
  `collectDiscoveryData` in class `GridProcessorAdapter`
Parameters:
  `nodeId` - ID of new node that joins topology.
Returns:
  Discovery data object or `null` if there is nothing to send for this component.

#### onDiscoveryDataReceived

    public void onDiscoveryDataReceived(Object obj)

Receives discovery data object from remote nodes (called on new node during discovery process).

Specified by:
  `onDiscoveryDataReceived` in interface `GridComponent`
Overrides:
  `onDiscoveryDataReceived` in class `GridProcessorAdapter`
Parameters:
  `obj` - Discovery data object or `null` if nothing was sent for this component.

#### startRoutine

    public IgniteInternalFuture<UUID> startRoutine(GridContinuousHandler hnd,
                                          int bufSize,
                                          long interval,
                                          boolean autoUnsubscribe,
                                          @Nullable
                                          IgnitePredicate<ClusterNode> prjPred)

Parameters:
  `hnd` - Handler.
  `bufSize` - Buffer size.
  `interval` - Time interval.
  `autoUnsubscribe` - Automatic unsubscribe flag.
  `prjPred` - Projection predicate.
Returns:
  Future.

#### stopRoutine

    public IgniteInternalFuture<?> stopRoutine(UUID routineId)

Parameters:
  `routineId` - Consume ID.
Returns:
  Future.

#### addNotification

    public void addNotification(UUID nodeId,
                       UUID routineId,
                       @Nullable
                       Object obj,
                       @Nullable
                       Object orderedTopic,
                       boolean sync)
                         throws IgniteCheckedException

Parameters:
  `nodeId` - ID of the node that started routine.
  `routineId` - Routine ID.
  `obj` - Notification object.
  `orderedTopic` - Topic for ordered notifications. If `null`, non-ordered message will be sent.
  `sync` - If `true` then waits for event acknowledgment.
Throws:
  `IgniteCheckedException` - In case of error.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015