org.apache.ignite.internal.processors.cache

## Class GridCacheDeploymentManager<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter<K,V>
  - - org.apache.ignite.internal.processors.cache.GridCacheDeploymentManager<K,V>

All Implemented Interfaces:
  GridCacheSharedManager<K,V>

    public class GridCacheDeploymentManager<K,V>
    extends GridCacheSharedManagerAdapter<K,V>

Deployment manager for cache.

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`cctx, diagnosticLog, log`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheDeploymentManager()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addDeploymentContext(GridDeploymentInfo info)` Adds deployment info to deployment contexts queue.
`ClassLoader` `getClassLoader(IgniteUuid ldrId)`
`IgniteUuid` `getClassLoaderId(ClassLoader ldr)`
`GridDeploymentInfoBean` `globalDeploymentInfo()`
`ClassLoader` `globalLoader()` Gets distributed class loader.
`boolean` `ignoreOwnership(boolean ignore)`
`boolean` `isGlobalLoader()`
`ClassLoader` `localLoader()`
`void` `onEnter()` Callback on method enter.
`void` `onUndeploy(ClassLoader ldr, GridCacheContext<K,V> ctx)` Undeploys given class loader.
`void` `p2pContext(UUID sndId, IgniteUuid ldrId, String userVer, DeploymentMode mode, Map<UUID,IgniteUuid> participants)`
`void` `prepare(GridCacheDeployable deployable)` Prepares deployable object.
`void` `printMemoryStats()` Prints memory statistics (sizes of internal data structures, etc.).
`void` `registerClass(Class<?> cls)`
`void` `registerClass(Class<?> cls, ClassLoader ldr)`
`void` `registerClass(Object obj)`
`void` `registerClasses(Iterable<?> objs)` Register local classes.
`void` `registerClasses(Object... objs)` Register local classes.
`void` `start0()`
`protected void` `stop0(boolean cancel)`
`void` `unwind(GridCacheContext ctx)` Undeploy all queued up closures.

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`context, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStop, onKernalStop0, onReconnected, start, startInfo, stop, stopInfo, toString`

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

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

### Constructor Detail

#### GridCacheDeploymentManager

    public GridCacheDeploymentManager()

### Method Detail

#### start0

    public void start0()
                throws IgniteCheckedException

Overrides:
  `start0` in class `GridCacheSharedManagerAdapter<K,V>`
Throws:
  `IgniteCheckedException` - If failed.

#### stop0

    protected void stop0(boolean cancel)

Overrides:
  `stop0` in class `GridCacheSharedManagerAdapter<K,V>`
Parameters:
  `cancel` - Cancel flag.

#### localLoader

    public ClassLoader localLoader()

Returns:
  Local-only class loader.

#### globalLoader

    public ClassLoader globalLoader()

Gets distributed class loader. Note that `p2pContext(UUID, IgniteUuid, String, DeploymentMode, Map)` must be called from the same thread prior to using this class loader, or the loading may happen for the wrong node or context.

Returns:
  Cache class loader.

#### onEnter

    public void onEnter()

Callback on method enter.

#### ignoreOwnership

    public boolean ignoreOwnership(boolean ignore)

Parameters:
  `ignore` - `True` to ignore.

#### unwind

    public void unwind(GridCacheContext ctx)

Undeploy all queued up closures.

Parameters:
  `ctx` - Cache context.

#### onUndeploy

    public void onUndeploy(ClassLoader ldr,
                           GridCacheContext<K,V> ctx)

Undeploys given class loader.

Parameters:
  `ldr` - Class loader to undeploy.
  `ctx` - Grid cache context.

#### p2pContext

    public void p2pContext(UUID sndId,
                           IgniteUuid ldrId,
                           String userVer,
                           DeploymentMode mode,
                           Map<UUID,IgniteUuid> participants)

Parameters:
  `sndId` - Sender node ID.
  `ldrId` - Loader ID.
  `userVer` - User version.
  `mode` - Deployment mode.
  `participants` - Node participants.

#### addDeploymentContext

    public void addDeploymentContext(GridDeploymentInfo info)

Adds deployment info to deployment contexts queue.

Parameters:
  `info` - Info to add.

#### registerClasses

    public void registerClasses(Object... objs)
                         throws IgniteCheckedException

Register local classes.

Parameters:
  `objs` - Objects to register.
Throws:
  `IgniteCheckedException` - If registration failed.

#### registerClasses

    public void registerClasses(Iterable<?> objs)
                         throws IgniteCheckedException

Register local classes.

Parameters:
  `objs` - Objects to register.
Throws:
  `IgniteCheckedException` - If registration failed.

#### registerClass

    public void registerClass(Object obj)
                       throws IgniteCheckedException

Parameters:
  `obj` - Object whose class to register.
Throws:
  `IgniteCheckedException` - If failed.

#### registerClass

    public void registerClass(Class<?> cls)
                       throws IgniteCheckedException

Parameters:
  `cls` - Class to register.
Throws:
  `IgniteCheckedException` - If failed.

#### registerClass

    public void registerClass(Class<?> cls,
                              ClassLoader ldr)
                       throws IgniteCheckedException

Parameters:
  `cls` - Class to register.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If registration failed.

#### prepare

    public void prepare(GridCacheDeployable deployable)

Prepares deployable object.

Parameters:
  `deployable` - Deployable object.

#### globalDeploymentInfo

    @Nullable
    public GridDeploymentInfoBean globalDeploymentInfo()

Returns:
  First global deployment.

#### printMemoryStats

    public void printMemoryStats()

Prints memory statistics (sizes of internal data structures, etc.). NOTE: this method is for testing and profiling purposes only.

Specified by:
  `printMemoryStats` in interface `GridCacheSharedManager<K,V>`
Overrides:
  `printMemoryStats` in class `GridCacheSharedManagerAdapter<K,V>`

#### getClassLoaderId

    @Nullable
    public IgniteUuid getClassLoaderId(@Nullable
                                                 ClassLoader ldr)

Parameters:
  `ldr` - Class loader to get ID for.
Returns:
  ID for given class loader or `null` if given loader is not grid deployment class loader.

#### getClassLoader

    @Nullable
    public ClassLoader getClassLoader(IgniteUuid ldrId)

Parameters:
  `ldrId` - Class loader ID.
Returns:
  Class loader ID or `null` if loader not found.

#### isGlobalLoader

    public boolean isGlobalLoader()

Returns:
  `True` if context class loader is global.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.0
Release Date | : November 30 2018