org.apache.ignite.internal.managers.deployment

## Class GridDeployment

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter
  - - org.apache.ignite.internal.managers.deployment.GridDeployment

All Implemented Interfaces:
  GridDeploymentInfo

    public class GridDeployment
    extends GridMetadataAwareAdapter
    implements GridDeploymentInfo

Represents single class deployment.

### Method Summary

Methods
`boolean` `acquire()` Increments usage count for deployment.
`boolean` `addDeployedClass(Class<?> cls, String... aliases)` Adds deployed class together with aliases.
`Object` `annotatedValue(Object target, Class<? extends Annotation> annCls)` Gets value of annotated field or method.
`<T extends Annotation> T` `annotation(Class<?> cls, Class<T> annCls)`
`ClassLoader` `classLoader()`
`IgniteUuid` `classLoaderId()` Gets property clsLdrId.
`Class<?>` `deployedClass(String clsName, String... alias)` Gets class for a name.
`Collection<Class<?>>` `deployedClasses()`
`Map<String,Class<?>>` `deployedClassMap()`
`DeploymentMode` `deployMode()` Gets property depMode.
`Class<?>` `existingDeployedClass(String clsName)`
`boolean` `hasName(String name)`
`boolean` `internalTask(ComputeTask task, Class<?> taskCls)` Checks whether task class is annotated with `GridInternal`.
`boolean` `local()` Gets property local.
`boolean` `localDeploymentOwner()`
`<T> T` `newInstance(Class<T> cls)`
`boolean` `obsolete()` Checks if deployment is obsolete, i.e. is not used and has been undeployed.
`void` `onDeployed(Class<?> cls)` Deployment callback.
`void` `onUndeployScheduled()` Invoked whenever this deployment is scheduled to be undeployed.
`Map<UUID,IgniteUuid>` `participants()`
`boolean` `pendingUndeploy()` Gets property pendingUndeploy.
`void` `release()` Decrements usage count.
`String` `sampleClassName()`
`long` `sequenceNumber()`
`long` `timestamp()` Gets timestamp.
`String` `toString()`
`void` `undeploy()` Sets property undeployed.
`boolean` `undeployed()` Gets property undeployed.
`String` `userVersion()` Gets property userVer.

### Methods inherited from class org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter

`addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, readExternalMeta, removeMeta, removeMeta, replaceMeta, writeExternalMeta`

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

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

### Method Detail

#### timestamp

    public long timestamp()

Gets timestamp.

Returns:
  Timestamp.

#### sampleClassName

    public String sampleClassName()

Returns:
  Sample class name.

#### deployMode

    public DeploymentMode deployMode()

Gets property depMode.

Specified by:
  `deployMode` in interface `GridDeploymentInfo`
Returns:
  Property depMode.

#### localDeploymentOwner

    public boolean localDeploymentOwner()

Specified by:
  `localDeploymentOwner` in interface `GridDeploymentInfo`
Returns:
  Local deployment ownership flag.

#### sequenceNumber

    public long sequenceNumber()

Specified by:
  `sequenceNumber` in interface `GridDeploymentInfo`
Returns:
  Sequence number.

#### classLoader

    public ClassLoader classLoader()

Returns:
  Class loader.

#### classLoaderId

    public IgniteUuid classLoaderId()

Gets property clsLdrId.

Specified by:
  `classLoaderId` in interface `GridDeploymentInfo`
Returns:
  Property clsLdrId.

#### userVersion

    public String userVersion()

Gets property userVer.

Specified by:
  `userVersion` in interface `GridDeploymentInfo`
Returns:
  Property userVer.

#### hasName

    public boolean hasName(String name)

Parameters:
  `name` - Either class name or alias.
Returns:
  `True` if name is equal to either class name or alias.

#### local

    public boolean local()

Gets property local.

Returns:
  Property local.

#### undeployed

    public boolean undeployed()

Gets property undeployed.

Returns:
  Property undeployed.

#### undeploy

    public void undeploy()

Sets property undeployed.

#### pendingUndeploy

    public boolean pendingUndeploy()

Gets property pendingUndeploy.

Returns:
  Property pendingUndeploy.

#### onUndeployScheduled

    public void onUndeployScheduled()

Invoked whenever this deployment is scheduled to be undeployed. Used for handling obsolete or phantom requests.

#### acquire

    public boolean acquire()

Increments usage count for deployment. If deployment is undeployed, then usage count is not incremented.

Returns:
  `True` if deployment is still active.

#### release

    public void release()

Decrements usage count.

#### obsolete

    public boolean obsolete()

Checks if deployment is obsolete, i.e. is not used and has been undeployed.

Returns:
  `True` if deployment is obsolete.

#### participants

    @Nullable
    public Map<UUID,IgniteUuid> participants()

Specified by:
  `participants` in interface `GridDeploymentInfo`
Returns:
  Node participant map.

#### onDeployed

    public void onDeployed(Class<?> cls)

Deployment callback.

Parameters:
  `cls` - Deployed class.

#### annotation

    public <T extends Annotation> T annotation(Class<?> cls,
                                      Class<T> annCls)

Type Parameters:
  `T` - Annotation class.
Parameters:
  `cls` - Class to get annotation for.
  `annCls` - Annotation class.
Returns:
  Annotation value.

#### internalTask

    public boolean internalTask(@Nullable
                       ComputeTask task,
                       Class<?> taskCls)

Checks whether task class is annotated with `GridInternal`.

Parameters:
  `task` - Task.
  `taskCls` - Task class.
Returns:
  `True` if task is internal.

#### newInstance

    @Nullable
    public <T> T newInstance(Class<T> cls)
                  throws IgniteCheckedException

Parameters:
  `cls` - Class to create new instance of (using default constructor).
Returns:
  New instance.
Throws:
  `IgniteCheckedException` - If failed.

#### existingDeployedClass

    public Class<?> existingDeployedClass(String clsName)

Parameters:
  `clsName` - Class name to check.
Returns:
  Class for given name if it was previously deployed.

#### deployedClass

    @Nullable
    public Class<?> deployedClass(String clsName,
                                  String... alias)

Gets class for a name.

Parameters:
  `clsName` - Class name.
  `alias` - Optional array of aliases.
Returns:
  Class for given name.

#### addDeployedClass

    public boolean addDeployedClass(Class<?> cls,
                           String... aliases)

Adds deployed class together with aliases.

Parameters:
  `cls` - Deployed class.
  `aliases` - Class aliases.
Returns:
  `True` if class was added.

#### deployedClasses

    public Collection<Class<?>> deployedClasses()

Returns:
  Deployed classes.

#### deployedClassMap

    public Map<String,Class<?>> deployedClassMap()

Returns:
  Deployed class map, keyed by class name or alias.

#### annotatedValue

    @Nullable
    public Object annotatedValue(Object target,
                                 Class<? extends Annotation> annCls)
                          throws IgniteCheckedException

Gets value of annotated field or method.

Parameters:
  `target` - Object to find a value in.
  `annCls` - Annotation class.
Returns:
  Value of annotated field or method.
Throws:
  `IgniteCheckedException` - If failed to find.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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