org.apache.ignite.internal.processors.service

## Class GridServiceProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.service.GridServiceProcessor

All Implemented Interfaces:
  GridComponent, GridProcessor

    public class GridServiceProcessor
    extends GridProcessorAdapter

Grid service processor.

### 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
`GridServiceProcessor(GridKernalContext ctx)`

### Method Summary

Methods
`IgniteInternalFuture<?>` `cancel(String name)`
`IgniteInternalFuture<?>` `cancelAll()`
`IgniteInternalFuture<?>` `deploy(ServiceConfiguration cfg)`
`IgniteInternalFuture<?>` `deployClusterSingleton(ClusterGroup prj, String name, Service svc)`
`IgniteInternalFuture<?>` `deployKeyAffinitySingleton(String name, Service svc, String cacheName, Object affKey)`
`IgniteInternalFuture<?>` `deployMultiple(ClusterGroup prj, String name, Service svc, int totalCnt, int maxPerNodeCnt)`
`IgniteInternalFuture<?>` `deployNodeSingleton(ClusterGroup prj, String name, Service svc)`
`void` `onDisconnected(IgniteFuture<?> reconnectFut)` Client disconnected callback.
`void` `onKernalStart()` Callback that notifies that kernal has successfully started, including all managers and processors.
`void` `onKernalStop(boolean cancel)` Callback to notify that kernal is about to stop.
`<T> T` `service(String name)`
`ServiceContextImpl` `serviceContext(String name)`
`Collection<ServiceDescriptor>` `serviceDescriptors()`
`<T> T` `serviceProxy(ClusterGroup prj, String name, Class<? super T> svcItf, boolean sticky)`
`<T> Collection<T>` `services(String name)`
`Map<UUID,Integer>` `serviceTopology(String name)`
`void` `start()` Starts grid component.

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

`assertParameter, collectDiscoveryData, discoveryDataType, onDiscoveryDataReceived, onReconnected, printMemoryStats, stop, toString, validateNode`

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

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

### Constructor Detail

#### GridServiceProcessor

    public GridServiceProcessor(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.

#### onKernalStart

    public void onKernalStart()
                       throws IgniteCheckedException

Callback that notifies that kernal has successfully started, including all managers and processors.

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

#### onKernalStop

    public void onKernalStop(boolean cancel)

Callback to notify that kernal is about to stop.

Specified by:
  `onKernalStop` in interface `GridComponent`
Overrides:
  `onKernalStop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - Flag indicating whether jobs should be canceled.

#### onDisconnected

    public void onDisconnected(IgniteFuture<?> reconnectFut)
                        throws IgniteCheckedException

Client disconnected callback.

Specified by:
  `onDisconnected` in interface `GridComponent`
Overrides:
  `onDisconnected` in class `GridProcessorAdapter`
Parameters:
  `reconnectFut` - Reconnect future.
Throws:
  `IgniteCheckedException` - If failed.

#### deployNodeSingleton

    public IgniteInternalFuture<?> deployNodeSingleton(ClusterGroup prj,
                                              String name,
                                              Service svc)

Parameters:
  `name` - Service name.
  `svc` - Service.
Returns:
  Future.

#### deployClusterSingleton

    public IgniteInternalFuture<?> deployClusterSingleton(ClusterGroup prj,
                                                 String name,
                                                 Service svc)

Parameters:
  `name` - Service name.
  `svc` - Service.
Returns:
  Future.

#### deployMultiple

    public IgniteInternalFuture<?> deployMultiple(ClusterGroup prj,
                                         String name,
                                         Service svc,
                                         int totalCnt,
                                         int maxPerNodeCnt)

Parameters:
  `name` - Service name.
  `svc` - Service.
  `totalCnt` - Total count.
  `maxPerNodeCnt` - Max per-node count.
Returns:
  Future.

#### deployKeyAffinitySingleton

    public IgniteInternalFuture<?> deployKeyAffinitySingleton(String name,
                                                     Service svc,
                                                     String cacheName,
                                                     Object affKey)

Parameters:
  `name` - Service name.
  `svc` - Service.
  `cacheName` - Cache name.
  `affKey` - Affinity key.
Returns:
  Future.

#### deploy

    public IgniteInternalFuture<?> deploy(ServiceConfiguration cfg)

Parameters:
  `cfg` - Service configuration.
Returns:
  Future for deployment.

#### cancel

    public IgniteInternalFuture<?> cancel(String name)

Parameters:
  `name` - Service name.
Returns:
  Future.

#### cancelAll

    public IgniteInternalFuture<?> cancelAll()

Returns:
  Future.

#### serviceTopology

    public Map<UUID,Integer> serviceTopology(String name)
                                      throws IgniteCheckedException

Parameters:
  `name` - Service name.
Returns:
  Service topology.
Throws:
  `IgniteCheckedException`

#### serviceDescriptors

    public Collection<ServiceDescriptor> serviceDescriptors()

Returns:
  Collection of service descriptors.

#### service

    public <T> T service(String name)

Type Parameters:
  `T` - Service type.
Parameters:
  `name` - Service name.
Returns:
  Service by specified service name.

#### serviceContext

    public ServiceContextImpl serviceContext(String name)

Parameters:
  `name` - Service name.
Returns:
  Service by specified service name.

#### serviceProxy

    public <T> T serviceProxy(ClusterGroup prj,
                     String name,
                     Class<? super T> svcItf,
                     boolean sticky)
                   throws IgniteException

Type Parameters:
  `T` - Service interface type.
Parameters:
  `prj` - Grid projection.
  `name` - Service name.
  `svcItf` - Service class.
  `sticky` - Whether multi-node request should be done.
Returns:
  The proxy of a service by its name and class.
Throws:
  `IgniteException` - If failed to create proxy.

#### services

    public <T> Collection<T> services(String name)

Type Parameters:
  `T` - Service type.
Parameters:
  `name` - Service name.
Returns:
  Services by specified service name.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016