ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [06/44] incubator-ignite git commit: IGNITE-35 Removed IgniteUserResource, IgniteUserResourceOnDeployed, IgniteUserResourceOnUndeployed resources.
Date Fri, 23 Jan 2015 13:05:32 GMT
IGNITE-35 Removed IgniteUserResource, IgniteUserResourceOnDeployed, IgniteUserResourceOnUndeployed resources.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ad57f8ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ad57f8ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ad57f8ed

Branch: refs/heads/ignite-107
Commit: ad57f8edd79130dbbef56bcf70154ed67365e2c7
Parents: 55936e4
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Thu Dec 18 14:02:13 2014 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Fri Dec 19 16:29:12 2014 +0300

----------------------------------------------------------------------
 .../configuration/IgniteDeploymentMode.java     |  35 +-
 .../resources/IgniteInstanceResource.java       |   1 -
 .../ignite/resources/IgniteLoggerResource.java  |   1 -
 .../resources/IgniteMBeanServerResource.java    |   1 -
 .../IgniteSpringApplicationContextResource.java |   1 -
 .../ignite/resources/IgniteSpringResource.java  |   1 -
 .../ignite/resources/IgniteUserResource.java    | 118 ----
 .../resources/IgniteUserResourceOnDeployed.java |  46 --
 .../IgniteUserResourceOnUndeployed.java         |  45 --
 .../resource/GridResourceCustomInjector.java    | 536 -------------------
 .../resource/GridResourceProcessor.java         |  83 +--
 .../grid/p2p/GridP2PJobClassLoaderSelfTest.java |   4 -
 .../p2p/GridP2PLocalDeploymentSelfTest.java     |  28 -
 .../GridExternalCacheQueryReducerClosure.java   |   4 -
 .../tests/p2p/GridP2PAwareTestUserResource.java |  20 -
 .../p2p/GridP2PEventFilterExternalPath1.java    |   5 -
 .../p2p/GridP2PEventFilterExternalPath2.java    |   5 -
 .../tests/p2p/GridP2PTestTaskExternalPath1.java |   5 -
 .../tests/p2p/GridP2PTestTaskExternalPath2.java |   5 -
 .../GridAbstractUserExternalResource.java       | 117 ----
 .../resource/GridUserExternalResource1.java     |  17 -
 .../resource/GridUserExternalResource2.java     |  17 -
 .../resource/GridUserExternalResourceTask1.java | 149 ------
 .../resource/GridUserExternalResourceTask2.java | 156 ------
 .../grid/external/resource/package.html         |  15 -
 .../resource/GridAbstractUserResource.java      |  26 -
 .../GridResourceConcurrentUndeploySelfTest.java |  13 -
 .../GridResourceEventFilterSelfTest.java        |  10 -
 .../GridResourceFieldInjectionSelfTest.java     | 104 ----
 ...dResourceFieldOverrideInjectionSelfTest.java |  15 -
 .../resource/GridResourceIocSelfTest.java       |  84 ---
 ...GridResourceIsolatedClassLoaderSelfTest.java | 295 +---------
 .../GridResourceIsolatedTaskSelfTest.java       | 292 ----------
 .../GridResourceMethodInjectionSelfTest.java    | 111 ----
 ...ResourceMethodOverrideInjectionSelfTest.java |  96 ----
 .../GridResourceSharedUndeploySelfTest.java     | 146 -----
 .../resource/GridResourceUserExternalTest.java  |  86 ---
 .../grid/p2p/GridP2PAbstractUserResource.java   |  26 -
 .../GridP2PContinuousLocalDeploySelfTest.java   |  52 --
 .../testsuites/GridResourceSelfTestSuite.java   |   1 -
 40 files changed, 13 insertions(+), 2759 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/configuration/IgniteDeploymentMode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteDeploymentMode.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteDeploymentMode.java
index eb5c594..e8d9bf5 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteDeploymentMode.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteDeploymentMode.java
@@ -15,13 +15,7 @@ import org.jetbrains.annotations.*;
  * Grid deployment mode. Deployment mode is specified at grid startup via
  * {@link org.apache.ignite.configuration.IgniteConfiguration#getDeploymentMode()} configuration property
  * (it can also be specified in Spring XML configuration file). The main
- * difference between all deployment modes is how classes and user resources
- * are loaded on remote nodes via peer-class-loading mechanism. User resources
- * can be instances of caches, databased connections, or any other class
- * specified by user with {@link org.apache.ignite.resources.IgniteUserResource @GridUserResource} annotation.
- * <p>
- * Refer to {@link org.apache.ignite.resources.IgniteUserResource} documentation and examples for more
- * information on how user resources are created and injected.
+ * difference between all deployment modes is how classes are loaded on remote nodes via peer-class-loading mechanism.
  * <p>
  * The following deployment modes are supported:
  * <ul>
@@ -60,11 +54,6 @@ import org.jetbrains.annotations.*;
  *  <li>
  *      Simply startup stand-alone GridGain nodes by executing
  *      {@code GRIDGAIN_HOME/ggstart.{sh|bat}} scripts.
- *  <li>
- *      Inject your cache instance into your jobs via
- *      {@link org.apache.ignite.resources.IgniteUserResource @GridUserResource} annotation. The cache can be initialized
- *      and destroyed with {@link org.apache.ignite.resources.IgniteUserResourceOnDeployed @GridUserResourceOnDeployed} and
- *      {@link org.apache.ignite.resources.IgniteUserResourceOnUndeployed @GridUserResourceOnUndeployed} annotations.
  *  </li>
  *  <li>
  *      Now, all jobs executing locally or remotely can have a single instance of cache
@@ -75,8 +64,7 @@ import org.jetbrains.annotations.*;
  */
 public enum IgniteDeploymentMode {
     /**
-     * In this mode deployed classes do not share user resources
-     * (see {@link org.apache.ignite.resources.IgniteUserResource}). Basically, user resources are created
+     * In this mode deployed classes do not share resources. Basically, resources are created
      * once per deployed task class and then get reused for all executions.
      * <p>
      * Note that classes deployed within the same class loader on master
@@ -95,12 +83,12 @@ public enum IgniteDeploymentMode {
 
     /**
      * Unlike {@link #PRIVATE} mode, where different deployed tasks will
-     * never use the same instance of user resources, in {@code ISOLATED}
+     * never use the same instance of resources, in {@code ISOLATED}
      * mode, tasks or classes deployed within the same class loader
-     * will share the same instances of user resources (see {@link org.apache.ignite.resources.IgniteUserResource}).
+     * will share the same instances of resources.
      * This means that if multiple tasks classes are loaded by the same
      * class loader on master node, then they will share instances
-     * of user resources on worker nodes. In other words, user resources
+     * of resources on worker nodes. In other words, user resources
      * get initialized once per class loader and then get reused for all
      * consecutive executions.
      * <p>
@@ -121,11 +109,10 @@ public enum IgniteDeploymentMode {
      * nodes leave grid or user version changes.
      * <p>
      * The advantage of this approach is that it allows tasks coming from
-     * different master nodes share the same instances of user resources
-     * (see {@link org.apache.ignite.resources.IgniteUserResource}) on worker nodes. This allows for all
+     * different master nodes share the same instances of resources on worker nodes. This allows for all
      * tasks executing on remote nodes to reuse, for example, the same instances of
      * connection pools or caches. When using this mode, you can
-     * startup multiple stand-alone GridGain worker nodes, define user resources
+     * startup multiple stand-alone GridGain worker nodes, define resources
      * on master nodes and have them initialize once on worker nodes regardless
      * of which master node they came from.
      * <p>
@@ -145,18 +132,16 @@ public enum IgniteDeploymentMode {
     SHARED,
 
     /**
-     * Same as {@link #SHARED} deployment mode, but user resources
-     * (see {@link org.apache.ignite.resources.IgniteUserResource}) will not be undeployed even after all master
+     * Same as {@link #SHARED} deployment mode, but resources will not be undeployed even after all master
      * nodes left grid. Tasks from different master nodes with the same user
      * version and same class loader will share the same class loader on remote
      * worker nodes. Classes will be undeployed whenever user version changes.
      * <p>
      * The advantage of this approach is that it allows tasks coming from
-     * different master nodes share the same instances of user resources
-     * (see {@link org.apache.ignite.resources.IgniteUserResource}) on worker nodes. This allows for all
+     * different master nodes share the same instances of resources on worker nodes. This allows for all
      * tasks executing on remote nodes to reuse, for example, the same instances of
      * connection pools or caches. When using this mode, you can
-     * startup multiple stand-alone GridGain worker nodes, define user resources
+     * startup multiple stand-alone GridGain worker nodes, define resources
      * on master nodes and have them initialize once on worker nodes regardless
      * of which master node they came from.
      * <p>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/resources/IgniteInstanceResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/IgniteInstanceResource.java b/modules/core/src/main/java/org/apache/ignite/resources/IgniteInstanceResource.java
index ec10b36..e201bda 100644
--- a/modules/core/src/main/java/org/apache/ignite/resources/IgniteInstanceResource.java
+++ b/modules/core/src/main/java/org/apache/ignite/resources/IgniteInstanceResource.java
@@ -22,7 +22,6 @@ import java.lang.annotation.*;
  * <li>{@link org.apache.ignite.compute.ComputeJob}</li>
  * <li>{@link org.apache.ignite.lifecycle.LifecycleBean}</li>
  * <li>All closures and predicates that can run on grid.</li>
- * <li>{@link IgniteUserResource @IgniteUserResource}</li>
  * </ul>
  * <p>
  * Here is how injection would typically happen:

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/resources/IgniteLoggerResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/IgniteLoggerResource.java b/modules/core/src/main/java/org/apache/ignite/resources/IgniteLoggerResource.java
index 9695d16..78361a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/resources/IgniteLoggerResource.java
+++ b/modules/core/src/main/java/org/apache/ignite/resources/IgniteLoggerResource.java
@@ -21,7 +21,6 @@ import java.lang.annotation.*;
  * <li>{@link org.apache.ignite.compute.ComputeJob}</li>
  * <li>{@link org.apache.ignite.spi.IgniteSpi}</li>
  * <li>{@link org.apache.ignite.lifecycle.LifecycleBean}</li>
- * <li>{@link IgniteUserResource @GridUserResource}</li>
  * </ul>
  * <p>
  * Here is how injection would typically happen:

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/resources/IgniteMBeanServerResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/IgniteMBeanServerResource.java b/modules/core/src/main/java/org/apache/ignite/resources/IgniteMBeanServerResource.java
index 50c8153..6ac2b94 100644
--- a/modules/core/src/main/java/org/apache/ignite/resources/IgniteMBeanServerResource.java
+++ b/modules/core/src/main/java/org/apache/ignite/resources/IgniteMBeanServerResource.java
@@ -22,7 +22,6 @@ import java.lang.annotation.*;
  * <li>{@link org.apache.ignite.compute.ComputeJob}</li>
  * <li>{@link org.apache.ignite.spi.IgniteSpi}</li>
  * <li>{@link org.apache.ignite.lifecycle.LifecycleBean}</li>
- * <li>{@link IgniteUserResource @GridUserResource}</li>
  * </ul>
  * <p>
  * Here is how injection would typically happen:

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringApplicationContextResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringApplicationContextResource.java b/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringApplicationContextResource.java
index 895e37a..97d8ab7 100644
--- a/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringApplicationContextResource.java
+++ b/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringApplicationContextResource.java
@@ -23,7 +23,6 @@ import java.lang.annotation.*;
  * <li>{@link org.apache.ignite.compute.ComputeJob}</li>
  * <li>{@link org.apache.ignite.spi.IgniteSpi}</li>
  * <li>{@link org.apache.ignite.lifecycle.LifecycleBean}</li>
- * <li>{@link IgniteUserResource @GridUserResource}</li>
  * </ul>
  * <p>
  * Here is how injection would typically happen:

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringResource.java b/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringResource.java
index 4452731..1b39118 100644
--- a/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringResource.java
+++ b/modules/core/src/main/java/org/apache/ignite/resources/IgniteSpringResource.java
@@ -24,7 +24,6 @@ import java.lang.annotation.*;
  * <li>{@link org.apache.ignite.compute.ComputeJob}</li>
  * <li>{@link org.apache.ignite.spi.IgniteSpi}</li>
  * <li>{@link org.apache.ignite.lifecycle.LifecycleBean}</li>
- * <li>{@link IgniteUserResource @GridUserResource}</li>
  * </ul>
  * <p>
  * <h1 class="header">Resource Name</h1>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResource.java b/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResource.java
deleted file mode 100644
index 3b8eb16..0000000
--- a/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResource.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.apache.ignite.resources;
-
-import java.lang.annotation.*;
-
-/**
- * Annotates a field or a setter method for any custom resources injection.
- * It can be injected into grid tasks and grid jobs. Use it when you would
- * like, for example, to inject something like JDBC connection pool into tasks
- * or jobs - this way your connection pool will be instantiated only once
- * per task and reused for all executions of this task.
- * <p>
- * You can inject other resources into your user resource.
- * The following grid resources can be injected:
- * <ul>
- * <li>{@link IgniteLoggerResource}</li>
- * <li>{@link IgniteSpringApplicationContextResource}</li>
- * <li>{@link IgniteSpringResource}</li>
- * <li>{@link IgniteInstanceResource}</li>
- * </ul>
- * Refer to corresponding resource documentation for more information.
- * <p>
- * <h1 class="header">Resource Class</h1>
- * The resource will be created based on the {@link #resourceClass()} value. If
- * If {@code resourceClass} is not specified, then field type or setter parameter
- * type will be used to infer the class type of the resource. Set {@link #resourceClass()}
- * to a specific value if the class of resource cannot be inferred from field or setter
- * declaration (for example, if field is an interface).
- * <p>
- * <h1 class="header">Resource Life Cycle</h1>
- * User resource will be instantiated once on every node where task is deployed.
- * Basically there will always be only one instance of resource on any
- * grid node for any task class. Every node will instantiate
- * it's own copy of user resources used for every deployed task (see
- * {@link IgniteUserResourceOnDeployed} and {@link IgniteUserResourceOnUndeployed}
- * annotation for resource deployment and undeployment callbacks). For this
- * reason <b>resources should not be sent to remote nodes and should
- * always be declared as transient</b> just in case.
- * <p>
- * Note that an instance of user resource will be created for every deployed task.
- * In case if you need a singleton resource instances on grid nodes (not per-task),
- * you can use {@link IgniteSpringApplicationContextResource} for injecting per-VM
- * singleton resources configured in Spring.
- * <p>
- * <h1 class="header">Examples</h1>
- * Here is how injection would typically happen:
- * <pre name="code" class="java">
- * public class MyGridJob implements ComputeJob {
- *      ...
- *      &#64;GridUserResource
- *      private transient MyUserResource rsrc;
- *      ...
- *  }
- * </pre>
- * or
- * <pre name="code" class="java">
- * public class MyGridJob implements ComputeJob {
- *     ...
- *     private transient MyUserResource rsrc;
- *     ...
- *     &#64;GridUserResource
- *     public void setMyUserResource(MyUserResource rsrc) {
- *          this.rsrc = rsrc;
- *     }
- *     ...
- * }
- * </pre>
- * where resource class can look like this:
- * <pre name="code" class="java">
- * public class MyUserResource {
- *     ...
- *     // Inject logger (or any other resource).
- *     &#64;GridLoggerResource
- *     private GridLogger log;
- *
- *     // Inject grid instance (or any other resource).
- *     &#64;GridInstanceResource
- *     private Grid grid;
- *
- *     // Deployment callback.
- *     &#64;GridUserResourceOnDeployed
- *     public void deploy() {
- *        // Some initialization logic.
- *        ...
- *     }
- *
- *     // Undeployment callback.
- *     &#64;GridUserResourceOnUndeployed
- *     public void undeploy() {
- *        // Some clean up logic.
- *        ...
- *     }
- * }
- * </pre>
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.METHOD, ElementType.FIELD})
-public @interface IgniteUserResource {
-    /**
-     * Optional resource class. By default the type of the resource variable
-     * or setter parameter will be used.
-     */
-    @SuppressWarnings({"JavaDoc"}) Class<?> resourceClass() default Void.class;
-
-    /**
-     * Optional resource name. By default the {@code "dfltName"} values will be used.
-     */
-    @SuppressWarnings({"JavaDoc"}) String resourceName() default "dfltName";
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResourceOnDeployed.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResourceOnDeployed.java b/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResourceOnDeployed.java
deleted file mode 100644
index f9d2e78..0000000
--- a/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResourceOnDeployed.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.apache.ignite.resources;
-
-import java.lang.annotation.*;
-
-/**
- * Annotates a special methods inside injected user-defined resource {@link IgniteUserResource}.
- * It can be used in any injected resource for grid tasks and grid jobs. Typically the method with this
- * annotation will be used for initialization of the injectable resource such as opening database connection,
- * network connection or reading configuration settings. Note that this method is called after the resource
- * itself has been injected with all its resources, if any.
- * <p>
- * Here is how annotation would typically happen:
- * <pre name="code" class="java">
- * public class MyUserResource {
- *     ...
- *     &#64;GridLoggerResource
- *     private GridLogger log;
- *
- *     &#64;GridSpringApplicationContextResource
- *     private ApplicationContext springCtx;
- *     ...
- *     &#64;GridUserResourceOnDeployed
- *     private void deploy() {
- *         log.info("Deploying resource: " + this);
- *     }
- *     ...
- * }
- * </pre>
- * <p>
- * See also {@link IgniteUserResourceOnUndeployed} for undeployment callbacks.
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface IgniteUserResourceOnDeployed {
-    // No-op.
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResourceOnUndeployed.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResourceOnUndeployed.java b/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResourceOnUndeployed.java
deleted file mode 100644
index 34dda00..0000000
--- a/modules/core/src/main/java/org/apache/ignite/resources/IgniteUserResourceOnUndeployed.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.apache.ignite.resources;
-
-import java.lang.annotation.*;
-
-/**
- * Annotates a special method inside injected user-defined resources {@link IgniteUserResource}. This
- * annotation is typically used to de-initialize user-defined resource. For example, the method with
- * this annotation can close database connection, or perform certain cleanup. Note that this method
- * will be called before any injected resources on this user-defined resource are cleaned up.
- * <p>
- * Here is how annotation would typically happen:
- * <pre name="code" class="java">
- * public class MyUserResource {
- *     ...
- *     &#64;GridLoggerResource
- *     private GridLogger log;
- *
- *     &#64;GridSpringApplicationContextResource
- *     private ApplicationContext springCtx;
- *     ...
- *     &#64;GridUserResourceOnUndeployed
- *     private void deploy() {
- *         log.info("Deploying resource: " + this);
- *     }
- *     ...
- * }
- * </pre>
- * <p>
- * See also {@link IgniteUserResourceOnDeployed} for deployment callbacks.
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface IgniteUserResourceOnUndeployed {
-    // No-op.
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceCustomInjector.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceCustomInjector.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceCustomInjector.java
deleted file mode 100644
index 100eaa6..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceCustomInjector.java
+++ /dev/null
@@ -1,536 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.kernal.processors.resource;
-
-import org.apache.ignite.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.managed.*;
-import org.apache.ignite.marshaller.*;
-import org.apache.ignite.resources.*;
-import org.gridgain.grid.*;
-import org.gridgain.grid.kernal.*;
-import org.gridgain.grid.kernal.managers.deployment.*;
-import org.gridgain.grid.util.typedef.*;
-import org.gridgain.grid.util.typedef.internal.*;
-
-import javax.management.*;
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.locks.*;
-
-/**
- * Custom injector implementation works with user resources.
- * Injector creates and collects all created user resources.
- * All resources will be cleaned before task undeploy.
- * Task resources should be marked in task with {@link org.apache.ignite.resources.IgniteUserResource} annotation.
- */
-class GridResourceCustomInjector implements GridResourceInjector {
-    /** Class-based resource attachment. */
-    private static final String CLS_RSRC_CACHE = "CLASS_RESOURCE_CACHE";
-
-    /** Class-loader based resource attachment. */
-    private static final String CLS_LDR_RSRC_CACHE = "CLASS_LOADER_RESOURCE_CACHE";
-
-    /** Grid logger. */
-    private final IgniteLogger log;
-
-    /** Grid instance injector. */
-    private GridResourceBasicInjector<GridEx> gridInjector;
-
-    /** GridGain home folder injector. */
-    private GridResourceBasicInjector<String> ggHomeInjector;
-
-    /** Grid name injector. */
-    private GridResourceBasicInjector<String> ggNameInjector;
-
-    /** MBean server injector. */
-    private GridResourceBasicInjector<MBeanServer> mbeanServerInjector;
-
-    /** Grid thread executor injector. */
-    private GridResourceBasicInjector<Executor> execInjector;
-
-    /** Local node ID injector. */
-    private GridResourceBasicInjector<UUID> nodeIdInjector;
-
-    /** Marshaller injector. */
-    private GridResourceBasicInjector<IgniteMarshaller> marshallerInjector;
-
-    /** Spring application context injector. */
-    private GridResourceInjector springCtxInjector;
-
-    /** Logger injector. */
-    private GridResourceBasicInjector<IgniteLogger> logInjector;
-
-    /** Service injector. */
-    private GridResourceBasicInjector<Collection<ManagedService>> srvcInjector;
-
-    /** Spring bean resources injector. */
-    private GridResourceInjector springBeanInjector;
-
-    /** Null injector for cleaning resources. */
-    private final GridResourceInjector nullInjector = new GridResourceBasicInjector<>(null);
-
-    /** Resource container. */
-    private final GridResourceIoc ioc;
-
-    /** */
-    private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-
-    /**
-     * Creates injector object.
-     *
-     * @param log Grid logger.
-     * @param ioc Resource container for injections.
-     */
-    GridResourceCustomInjector(IgniteLogger log, GridResourceIoc ioc) {
-        assert log != null;
-        assert ioc != null;
-
-        this.log = log;
-        this.ioc = ioc;
-    }
-
-    /**
-     * Sets injector with Grid instance.
-     *
-     * @param gridInjector Grid instance.
-     */
-    public void setGridInjector(GridResourceBasicInjector<GridEx> gridInjector) {
-        this.gridInjector = gridInjector;
-    }
-
-    /**
-     * Sets injector with GridGain home folder.
-     *
-     * @param ggHomeInjector GridGain home folder.
-     */
-    public void setGridgainHomeInjector(GridResourceBasicInjector<String> ggHomeInjector) {
-        this.ggHomeInjector = ggHomeInjector;
-    }
-
-    /**
-     * Sets injector with GridGain home folder.
-     *
-     * @param ggNameInjector Grid name injector.
-     */
-    public void setGridNameInjector(GridResourceBasicInjector<String> ggNameInjector) {
-        this.ggNameInjector = ggNameInjector;
-    }
-
-    /**
-     * Sets injector with MBean server.
-     *
-     * @param mbeanServerInjector MBean server.
-     */
-    public void setMbeanServerInjector(GridResourceBasicInjector<MBeanServer> mbeanServerInjector) {
-        this.mbeanServerInjector = mbeanServerInjector;
-    }
-
-    /**
-     * Sets injector with Grid thread executor.
-     *
-     * @param execInjector Grid thread executor.
-     */
-    public void setExecutorInjector(GridResourceBasicInjector<Executor> execInjector) {
-        this.execInjector = execInjector;
-    }
-
-    /**
-     * Sets injector with local node ID.
-     *
-     * @param nodeIdInjector Local node ID.
-     */
-    void setNodeIdInjector(GridResourceBasicInjector<UUID> nodeIdInjector) {
-        this.nodeIdInjector = nodeIdInjector;
-    }
-
-    /**
-     * Sets injector with marshaller.
-     *
-     * @param marshallerInjector Grid marshaller.
-     */
-    public void setMarshallerInjector(GridResourceBasicInjector<IgniteMarshaller> marshallerInjector) {
-        this.marshallerInjector = marshallerInjector;
-    }
-
-    /**
-     * Sets injector with Spring application context.
-     *
-     * @param springCtxInjector Spring application context.
-     */
-    void setSpringContextInjector(GridResourceInjector springCtxInjector) {
-        this.springCtxInjector = springCtxInjector;
-    }
-
-    /**
-     * Sets injector for Spring beans.
-     *
-     * @param springBeanInjector Injector for Spring beans.
-     */
-    public void setSpringBeanInjector(GridResourceInjector springBeanInjector) {
-        this.springBeanInjector = springBeanInjector;
-    }
-
-    /**
-     * Sets injector with log.
-     *
-     * @param logInjector Log injector.
-     */
-    public void setLogInjector(GridResourceBasicInjector<IgniteLogger> logInjector) {
-        this.logInjector = logInjector;
-    }
-
-    /**
-     * Sets injector for grid services.
-     *
-     * @param srvcInjector Service injector.
-     */
-    public void setSrvcInjector(GridResourceBasicInjector<Collection<ManagedService>> srvcInjector) {
-        this.srvcInjector = srvcInjector;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void undeploy(GridDeployment dep) {
-        lock.writeLock().lock();
-
-        try {
-            IgniteInClosure<Map<Class<?>, Map<String, CachedResource>>> x = new CI1<Map<Class<?>, Map<String, CachedResource>>>() {
-                @Override public void apply(Map<Class<?>, Map<String, CachedResource>> map) {
-                    if (map != null) {
-                        for (Map<String, CachedResource> m : map.values()) {
-                            if (m != null)
-                                undeploy(m.values());
-                        }
-                    }
-                }
-            };
-
-            Map<Class<?>, Map<String, CachedResource>> map = dep.removeMeta(CLS_LDR_RSRC_CACHE);
-
-            x.apply(map);
-
-            Map<Class<?>, Map<Class<?>, Map<String, CachedResource>>> clsRsrcs = dep.removeMeta(CLS_RSRC_CACHE);
-
-            if (clsRsrcs != null)
-                F.forEach(clsRsrcs.values(), x);
-        }
-        finally {
-            lock.writeLock().unlock();
-        }
-    }
-
-    /**
-     * Undeploy collection of resources.
-     * Every resource method marked with {@link org.apache.ignite.resources.IgniteUserResourceOnUndeployed}
-     * annotation will be invoked before cleanup.
-     *
-     * @param rsrcs Resources to undeploy.
-     */
-    private void undeploy(Iterable<CachedResource> rsrcs) {
-        assert lock.isWriteLockedByCurrentThread();
-
-        for (CachedResource rsrc : rsrcs) {
-            try {
-                List<Method> finalizers = getMethodsWithAnnotation(rsrc.getResource().getClass(),
-                    IgniteUserResourceOnUndeployed.class);
-
-                for (Method mtd : finalizers) {
-                    try {
-                        mtd.setAccessible(true);
-
-                        mtd.invoke(rsrc.getResource());
-                    }
-                    catch (IllegalAccessException | InvocationTargetException e) {
-                        U.error(log, "Failed to finalize task shared resource [method=" + mtd + ", resource=" + rsrc +
-                            ']', e);
-                    }
-                }
-            }
-            catch (IgniteCheckedException e) {
-                U.error(log, "Failed to find finalizers for resource: " + rsrc, e);
-            }
-
-            // Clean up injected resources.
-            cleanup(rsrc, IgniteLoggerResource.class);
-            cleanup(rsrc, IgniteInstanceResource.class);
-            cleanup(rsrc, IgniteSpringApplicationContextResource.class);
-            cleanup(rsrc, IgniteSpringResource.class);
-        }
-    }
-
-    /**
-     * Cleanup object where resources was injected before.
-     *
-     * @param rsrc Object where resources should be cleaned.
-     * @param annCls Annotation.
-     */
-    private void cleanup(CachedResource rsrc, Class<? extends Annotation> annCls) {
-        try {
-            ioc.inject(rsrc.getResource(), annCls, nullInjector, null, null);
-        }
-        catch (IgniteCheckedException e) {
-            U.error(log, "Failed to clean up resource [ann=" + annCls + ", rsrc=" + rsrc + ']', e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void inject(GridResourceField field, Object target, Class<?> depCls,
-        GridDeployment dep) throws IgniteCheckedException {
-        assert dep != null;
-
-        IgniteUserResource ann = (IgniteUserResource)field.getAnnotation();
-
-        assert ann != null;
-
-        if (!Modifier.isTransient(field.getField().getModifiers())) {
-            throw new IgniteCheckedException("@GridUserResource must only be used with 'transient' fields: " +
-                field.getField());
-        }
-
-        Class<?> rsrcCls = !ann.resourceClass().equals(Void.class) ? ann.resourceClass() :
-            field.getField().getType();
-
-        String rsrcName = ann.resourceName();
-
-        GridResourceUtils.inject(field.getField(), target, getResource(dep, depCls, rsrcCls, rsrcName));
-    }
-
-    /** {@inheritDoc} */
-    @Override public void inject(GridResourceMethod mtd, Object target, Class<?> depCls, GridDeployment dep)
-        throws IgniteCheckedException {
-        assert dep != null;
-
-        IgniteUserResource ann = (IgniteUserResource)mtd.getAnnotation();
-
-        if (mtd.getMethod().getParameterTypes().length != 1)
-            throw new IgniteCheckedException("Method injection setter must have only one parameter: " + mtd.getMethod());
-
-        Class<?> rsrcCls = !ann.resourceClass().equals(Void.class) ? ann.resourceClass() :
-            mtd.getMethod().getParameterTypes()[0];
-
-        String rsrcName = ann.resourceName();
-
-        GridResourceUtils.inject(mtd.getMethod(), target, getResource(dep, depCls, rsrcCls, rsrcName));
-    }
-
-    /**
-     * Gets resource for defined task class.
-     * If task resource not found it will be created with all necessary grid
-     * injections.
-     *
-     * @param dep Deployment.
-     * @param depCls Deployed class.
-     * @param rsrcCls Resource class.
-     * @param rsrcName Resource name.
-     * @return Created resource.
-     * @throws IgniteCheckedException If resource creation failed.
-     */
-    private Object getResource(GridDeployment dep, Class<?> depCls, Class<?> rsrcCls, String rsrcName)
-        throws IgniteCheckedException {
-        assert dep != null;
-
-        // For performance reasons we first try to acquire read lock and
-        // return the cached resource.
-        lock.readLock().lock();
-
-        try {
-            Map<String, CachedResource> map = null;
-
-            if (dep.deployMode() == IgniteDeploymentMode.PRIVATE) {
-                Map<Class<?>, Map<Class<?>, Map<String, CachedResource>>> m = dep.meta(CLS_RSRC_CACHE);
-
-                if (m != null) {
-                    Map<Class<?>, Map<String, CachedResource>> m1 = m.get(depCls);
-
-                    if (m1 != null)
-                        map = m1.get(rsrcCls);
-                }
-            }
-            else {
-                Map<Class<?>, Map<String, CachedResource>> m = dep.meta(CLS_LDR_RSRC_CACHE);
-
-                if (m != null)
-                    map = m.get(rsrcCls);
-            }
-
-            if (map != null) {
-                CachedResource rsrc = map.get(rsrcName);
-
-                if (rsrc != null) {
-                    if (log.isDebugEnabled())
-                        log.debug("Read resource from cache: [rsrcCls=" + rsrcCls + ", rsrcName=" + rsrcName + ']');
-
-                    return rsrc.getResource();
-                }
-            }
-        }
-        finally {
-            lock.readLock().unlock();
-        }
-
-        // If resource was not cached, then
-        // we acquire write lock and cache it.
-        lock.writeLock().lock();
-
-        try {
-            Map<String, CachedResource> map;
-
-            if (dep.deployMode() == IgniteDeploymentMode.PRIVATE) {
-                Map<Class<?>, Map<Class<?>, Map<String, CachedResource>>> m = dep.addMetaIfAbsent(CLS_RSRC_CACHE,
-                    F.<Class<?>, Map<Class<?>, Map<String, CachedResource>>>newMap());
-
-                Map<Class<?>, Map<String, CachedResource>> m1 = F.addIfAbsent(m, depCls,
-                    F.<Class<?>, Map<String, CachedResource>>newMap());
-
-                map = F.addIfAbsent(m1, rsrcCls, F.<String, CachedResource>newMap());
-            }
-            else {
-                Map<Class<?>, Map<String, CachedResource>> m = dep.addMetaIfAbsent(CLS_LDR_RSRC_CACHE,
-                    F.<Class<?>, Map<String, CachedResource>>newMap());
-
-                map = F.addIfAbsent(m, rsrcCls, F.<String, CachedResource>newMap());
-            }
-
-            CachedResource rsrc = map.get(rsrcName);
-
-            if (rsrc == null) {
-                rsrc = createResource(rsrcCls, dep, depCls);
-
-                map.put(rsrcName, rsrc);
-
-                if (log.isDebugEnabled()) {
-                    log.debug("Created resource [rsrcCls=" + rsrcCls.getName() + ", rsrcName=" + rsrcName +
-                        ", rsrc=" + rsrc + ", depCls=" + depCls + ", dep=" + dep + ']');
-                }
-            }
-
-            return rsrc.getResource();
-        }
-        finally {
-            lock.writeLock().unlock();
-        }
-    }
-
-    /**
-     * Creates object from class {@code rsrcCls} and inject all
-     * necessary resources for it.
-     *
-     * @param rsrcCls Class in which resources should be injected.
-     * @param dep Deployment.
-     * @param depCls Deployed class.
-     * @return Created object with injected resources.
-     * @throws IgniteCheckedException Thrown in case of any errors during injection.
-     */
-    private CachedResource createResource(Class<?> rsrcCls, GridDeployment dep, Class<?> depCls) throws IgniteCheckedException {
-        assert dep != null;
-
-        try {
-            Object rsrc = rsrcCls.newInstance();
-
-            // Inject resources into shared resource.
-            ioc.inject(rsrc, IgniteLoggerResource.class, new GridResourceBasicInjector<>(
-                log.getLogger(rsrcCls)), dep, depCls);
-            ioc.inject(rsrc, IgniteInstanceResource.class, gridInjector, dep, depCls);
-            ioc.inject(rsrc, IgniteSpringApplicationContextResource.class, springCtxInjector, dep, depCls);
-            ioc.inject(rsrc, IgniteSpringResource.class, springBeanInjector, dep, depCls);
-            ioc.inject(rsrc, IgniteLoggerResource.class, logInjector, dep, depCls);
-            ioc.inject(rsrc, IgniteServiceResource.class, srvcInjector, dep, depCls);
-
-            for (Method mtd : getMethodsWithAnnotation(rsrcCls, IgniteUserResourceOnDeployed.class)) {
-                mtd.setAccessible(true);
-
-                mtd.invoke(rsrc);
-            }
-
-            return new CachedResource(rsrc, dep.classLoader());
-        }
-        catch (InstantiationException e) {
-            throw new IgniteCheckedException("Failed to instantiate task shared resource: " + rsrcCls, e);
-        }
-        catch (IllegalAccessException e) {
-            throw new IgniteCheckedException("Failed to access task shared resource (is class public?): " + rsrcCls, e);
-        }
-        catch (InvocationTargetException e) {
-            throw new IgniteCheckedException("Failed to initialize task shared resource: " + rsrcCls, e);
-        }
-    }
-
-    /**
-     * Gets set of methods with given annotation.
-     *
-     * @param cls Class in which search for methods.
-     * @param annCls Annotation.
-     * @return Set of methods with given annotations.
-     * @throws IgniteCheckedException Thrown in case when method contains parameters.
-     */
-    private List<Method> getMethodsWithAnnotation(Class<?> cls, Class<? extends Annotation> annCls)
-        throws IgniteCheckedException {
-        List<Method> mtds = new ArrayList<>();
-
-        for (Class<?> c = cls; !c.equals(Object.class); c = c.getSuperclass()) {
-            for (Method mtd : c.getDeclaredMethods()) {
-                if (mtd.getAnnotation(annCls) != null) {
-                    if (mtd.getParameterTypes().length > 0) {
-                        throw new IgniteCheckedException("Task shared resource initialization or finalization method should " +
-                            "not have parameters: " + mtd);
-                    }
-
-                    mtds.add(mtd);
-                }
-            }
-        }
-
-        return mtds;
-    }
-
-    /** */
-    private static class CachedResource {
-        /** */
-        private final Object rsrc;
-
-        /** */
-        private final ClassLoader ldr;
-
-        /**
-         * @param rsrc Resource.
-         * @param ldr Class loader.
-         */
-        CachedResource(Object rsrc, ClassLoader ldr) {
-            this.rsrc = rsrc;
-            this.ldr = ldr;
-        }
-
-        /**
-         * Gets property rsrc.
-         *
-         * @return Property rsrc.
-         */
-        public Object getResource() {
-            return rsrc;
-        }
-
-        /**
-         * Gets property ldr.
-         *
-         * @return Property ldr.
-         */
-        public ClassLoader getClassLoader() {
-            return ldr;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(CachedResource.class, this);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessor.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessor.java
index 856990e..f73a37f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessor.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessor.java
@@ -11,10 +11,8 @@ package org.gridgain.grid.kernal.processors.resource;
 
 import org.apache.ignite.*;
 import org.apache.ignite.compute.*;
-import org.apache.ignite.configuration.*;
 import org.apache.ignite.lifecycle.*;
 import org.apache.ignite.managed.*;
-import org.apache.ignite.marshaller.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.*;
 import org.gridgain.grid.kernal.*;
@@ -24,11 +22,9 @@ import org.gridgain.grid.util.lang.*;
 import org.gridgain.grid.util.typedef.*;
 import org.jetbrains.annotations.*;
 
-import javax.management.*;
 import java.lang.annotation.*;
 import java.lang.reflect.*;
 import java.util.*;
-import java.util.concurrent.*;
 
 /**
  * Processor for all Grid and task/job resources.
@@ -42,8 +38,7 @@ public class GridResourceProcessor extends GridProcessorAdapter {
         IgniteSpringApplicationContextResource.class,
         IgniteSpringResource.class,
         IgniteLoggerResource.class,
-        IgniteServiceResource.class,
-        IgniteUserResource.class);
+        IgniteServiceResource.class);
 
     /** */
     private static final Collection<Class<? extends Annotation>> TASK_INJECTIONS = Arrays.asList(
@@ -54,33 +49,11 @@ public class GridResourceProcessor extends GridProcessorAdapter {
         IgniteSpringApplicationContextResource.class,
         IgniteSpringResource.class,
         IgniteLoggerResource.class,
-        IgniteServiceResource.class,
-        IgniteUserResource.class);
+        IgniteServiceResource.class);
 
     /** Grid instance injector. */
     private GridResourceBasicInjector<GridEx> gridInjector;
 
-    /** GridGain home folder injector. */
-    private GridResourceBasicInjector<String> ggHomeInjector;
-
-    /** Grid name injector. */
-    private GridResourceBasicInjector<String> ggNameInjector;
-
-    /** Local host binding injector. */
-    private GridResourceBasicInjector<String> locHostInjector;
-
-    /** MBean server injector. */
-    private GridResourceBasicInjector<MBeanServer> mbeanSrvInjector;
-
-    /** Grid thread executor injector. */
-    private GridResourceBasicInjector<Executor> execInjector;
-
-    /** Grid marshaller injector. */
-    private GridResourceBasicInjector<IgniteMarshaller> marshInjector;
-
-    /** Local node ID injector. */
-    private GridResourceBasicInjector<UUID> nodeIdInjector;
-
     /** Spring application context injector. */
     private GridResourceInjector springCtxInjector;
 
@@ -90,15 +63,9 @@ public class GridResourceProcessor extends GridProcessorAdapter {
     /** Services injector. */
     private GridResourceBasicInjector<Collection<ManagedService>> srvcInjector;
 
-    /** Address resolver injector. */
-    private GridResourceBasicInjector<IgniteAddressResolver> addrsRslvrInjector;
-
     /** Spring bean resources injector. */
     private GridResourceInjector springBeanInjector;
 
-    /** Task resources injector. */
-    private GridResourceCustomInjector customInjector;
-
     /** Cleaning injector. */
     private final GridResourceInjector nullInjector = new GridResourceBasicInjector<>(null);
 
@@ -117,34 +84,12 @@ public class GridResourceProcessor extends GridProcessorAdapter {
         super(ctx);
 
         gridInjector = new GridResourceBasicInjector<>(ctx.grid());
-        ggHomeInjector = new GridResourceBasicInjector<>(ctx.config().getGridGainHome());
-        ggNameInjector = new GridResourceBasicInjector<>(ctx.config().getGridName());
-        locHostInjector = new GridResourceBasicInjector<>(ctx.config().getLocalHost());
-        mbeanSrvInjector = new GridResourceBasicInjector<>(ctx.config().getMBeanServer());
-        marshInjector = new GridResourceBasicInjector<>(ctx.config().getMarshaller());
-        execInjector = new GridResourceBasicInjector<Executor>(ctx.config().getExecutorService());
-        nodeIdInjector = new GridResourceBasicInjector<>(ctx.config().getNodeId());
         logInjector = new GridResourceLoggerInjector(ctx.config().getGridLogger());
         srvcInjector = new GridResourceServiceInjector(ctx.grid());
-        addrsRslvrInjector = new GridResourceBasicInjector<>(ctx.config().getAddressResolver());
     }
 
     /** {@inheritDoc} */
     @Override public void start() throws IgniteCheckedException {
-        customInjector = new GridResourceCustomInjector(log, ioc);
-
-        customInjector.setExecutorInjector(execInjector);
-        customInjector.setGridgainHomeInjector(ggHomeInjector);
-        customInjector.setGridNameInjector(ggNameInjector);
-        customInjector.setGridInjector(gridInjector);
-        customInjector.setMbeanServerInjector(mbeanSrvInjector);
-        customInjector.setNodeIdInjector(nodeIdInjector);
-        customInjector.setMarshallerInjector(marshInjector);
-        customInjector.setSpringContextInjector(springCtxInjector);
-        customInjector.setSpringBeanInjector(springBeanInjector);
-        customInjector.setLogInjector(logInjector);
-        customInjector.setSrvcInjector(srvcInjector);
-
         if (log.isDebugEnabled())
             log.debug("Started resource processor.");
     }
@@ -175,8 +120,6 @@ public class GridResourceProcessor extends GridProcessorAdapter {
      * @param dep Deployment to release resources for.
      */
     public void onUndeployed(GridDeployment dep) {
-        customInjector.undeploy(dep);
-
         ioc.onUndeployed(dep.classLoader());
     }
 
@@ -227,9 +170,6 @@ public class GridResourceProcessor extends GridProcessorAdapter {
         ioc.inject(target, IgniteSpringResource.class, springBeanInjector, dep, depCls);
         ioc.inject(target, IgniteLoggerResource.class, logInjector, dep, depCls);
         ioc.inject(target, IgniteServiceResource.class, srvcInjector, dep, depCls);
-
-        // Inject users resource.
-        ioc.inject(target, IgniteUserResource.class, customInjector, dep, depCls);
     }
 
     /**
@@ -352,11 +292,6 @@ public class GridResourceProcessor extends GridProcessorAdapter {
                     ioc.inject(job, IgniteLoggerResource.class, logInjector, dep, taskCls);
                 else if (annCls == IgniteServiceResource.class)
                     ioc.inject(job, IgniteServiceResource.class, srvcInjector, dep, taskCls);
-                else {
-                    assert annCls == IgniteUserResource.class;
-
-                    ioc.inject(job, IgniteUserResource.class, customInjector, dep, taskCls);
-                }
             }
         }
     }
@@ -416,11 +351,6 @@ public class GridResourceProcessor extends GridProcessorAdapter {
                 ioc.inject(obj, IgniteLoggerResource.class, logInjector, dep, taskCls);
             else if (annCls == IgniteServiceResource.class)
                 ioc.inject(obj, IgniteServiceResource.class, srvcInjector, dep, taskCls);
-            else {
-                assert annCls == IgniteUserResource.class;
-
-                ioc.inject(obj, IgniteUserResource.class, customInjector, dep, taskCls);
-            }
         }
     }
 
@@ -643,15 +573,6 @@ public class GridResourceProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Returns GridResourceCustomInjector object. For tests only!!!
-     *
-     * @return GridResourceCustomInjector object.
-     */
-    GridResourceCustomInjector getResourceCustomInjector() {
-        return customInjector;
-    }
-
-    /**
      * Return original object if Spring AOP used with proxy objects.
      *
      * @param target Target object.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PJobClassLoaderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PJobClassLoaderSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PJobClassLoaderSelfTest.java
index 859cc0e..577b919 100644
--- a/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PJobClassLoaderSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PJobClassLoaderSelfTest.java
@@ -115,10 +115,6 @@ public class GridP2PJobClassLoaderSelfTest extends GridCommonAbstractTest {
             ldr = getClass().getClassLoader();
 
             return Collections.singletonList(new ComputeJobAdapter() {
-                    /** User resource */
-                    @IgniteUserResource
-                    private transient UserResource rsrcJob;
-
                     /** {@inheritDoc} */
                     @SuppressWarnings({"ObjectEquality"})
                     public Serializable execute() throws IgniteCheckedException {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PLocalDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PLocalDeploymentSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PLocalDeploymentSelfTest.java
index 2d129db..e0b4dce 100644
--- a/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PLocalDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PLocalDeploymentSelfTest.java
@@ -34,12 +34,6 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
     private IgniteDeploymentMode depMode;
 
     /** */
-    private static UserResource jobRsrc;
-
-    /** */
-    private static UserResource taskRsrc;
-
-    /** */
     private static ClassLoader jobLdr;
 
     /** */
@@ -68,19 +62,11 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
 
             ignite1.compute().execute(TestTask.class, ignite2.cluster().localNode().id());
 
-            assert jobRsrc != taskRsrc;
-
-            UserResource saveTaskRsrc = taskRsrc;
-            UserResource saveJobRsrc = jobRsrc;
-
             ClassLoader saveTaskLdr = taskLdr;
             ClassLoader saveJobLdr = jobLdr;
 
             ignite2.compute().execute(TestTask.class, ignite1.cluster().localNode().id());
 
-            assert saveJobRsrc == taskRsrc;
-            assert saveTaskRsrc == jobRsrc;
-
             assert saveTaskLdr == jobLdr;
             assert saveJobLdr == taskLdr;
         }
@@ -215,16 +201,9 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
      * Task that will always fail due to non-transient resource injection.
      */
     public static class TestTask extends ComputeTaskAdapter<UUID, Serializable> {
-        /** User resource. */
-        @IgniteUserResource
-        private transient UserResource rsrc;
-
         /** {@inheritDoc} */
         @Override public Map<? extends ComputeJob, ClusterNode> map(final List<ClusterNode> subgrid, UUID arg)
             throws IgniteCheckedException {
-
-            taskRsrc = rsrc;
-
             taskLdr = getClass().getClassLoader();
 
             for (ClusterNode node : subgrid) {
@@ -239,7 +218,6 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
         @Override public int[] reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
             assert results.size() == 1;
 
-            assert taskRsrc == rsrc;
             assert taskLdr == getClass().getClassLoader();
 
             return null;
@@ -249,10 +227,6 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
          * Simple job class.
          */
         public static class TestJob extends ComputeJobAdapter {
-            /** User resource. */
-            @IgniteUserResource
-            private transient UserResource rsrc;
-
             /** Ignite instance. */
             @IgniteInstanceResource
             private Ignite ignite;
@@ -266,8 +240,6 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
             @Override public Serializable execute() throws IgniteCheckedException {
                 assert ignite.configuration().getNodeId().equals(argument(0));
 
-                jobRsrc = rsrc;
-
                 jobLdr = getClass().getClassLoader();
 
                 return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalCacheQueryReducerClosure.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalCacheQueryReducerClosure.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalCacheQueryReducerClosure.java
index 066999f..2b3a471 100644
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalCacheQueryReducerClosure.java
+++ b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalCacheQueryReducerClosure.java
@@ -19,10 +19,6 @@ import java.util.*;
  * {@link GridP2PAwareTestUserResource}.
  */
 public class GridExternalCacheQueryReducerClosure implements IgniteReducer<Map.Entry<Integer, Integer>, Integer> {
-    /** */
-    @IgniteUserResource
-    private transient GridP2PAwareTestUserResource rsrc;
-
     /** {@inheritDoc} */
     @Override public boolean collect(Map.Entry<Integer, Integer> e) {
         return true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java
index 18f6733..2a7b576 100644
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java
+++ b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java
@@ -33,26 +33,6 @@ public class GridP2PAwareTestUserResource {
     private IgniteLogger log;
 
     /**
-     * Invoked on resource deploy. Increments deploy counter
-     * in node-local store.
-     */
-    @SuppressWarnings("ConstantConditions")
-    @IgniteUserResourceOnDeployed
-    public void onDeployed() {
-        concurrentIncrement(DEPLOY_CNT_KEY);
-    }
-
-    /**
-     * Invoked on resource undeploy. Increments undeploy counter
-     * in node-local store.
-     */
-    @SuppressWarnings("ConstantConditions")
-    @IgniteUserResourceOnUndeployed
-    public void onUndeployed() {
-        concurrentIncrement(UNDEPLOY_CNT_KEY);
-    }
-
-    /**
      * Concurrently increments numeric cache value.
      *
      * @param key Key for the value to be incremented.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java
index 322e6b7..0224cba 100644
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java
+++ b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java
@@ -20,10 +20,6 @@ import org.gridgain.grid.*;
  */
 @SuppressWarnings({"ProhibitedExceptionThrown"})
 public class GridP2PEventFilterExternalPath1 implements IgnitePredicate<IgniteEvent> {
-    /** */
-    @IgniteUserResource
-    private transient GridTestUserResource rsrc;
-
     /** Instance of grid. Used for save class loader and injected resource. */
     @IgniteInstanceResource
     private Ignite ignite;
@@ -32,7 +28,6 @@ public class GridP2PEventFilterExternalPath1 implements IgnitePredicate<IgniteEv
     @Override public boolean apply(IgniteEvent evt) {
         try {
             int[] res = new int[] {
-                System.identityHashCode(rsrc),
                 System.identityHashCode(getClass().getClassLoader())
             };
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java
index 15c1133..7c4cde3 100644
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java
+++ b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java
@@ -20,10 +20,6 @@ import org.gridgain.grid.*;
  */
 @SuppressWarnings({"ProhibitedExceptionThrown"})
 public class GridP2PEventFilterExternalPath2 implements IgnitePredicate<IgniteEvent> {
-    /** */
-    @IgniteUserResource
-    private transient GridTestUserResource rsrc;
-
     /** Instance of grid. Used for save class loader and injected resource. */
     @IgniteInstanceResource
     private Ignite ignite;
@@ -32,7 +28,6 @@ public class GridP2PEventFilterExternalPath2 implements IgnitePredicate<IgniteEv
     @Override public boolean apply(IgniteEvent evt) {
         try {
             int[] res = new int[] {
-                System.identityHashCode(rsrc),
                 System.identityHashCode(getClass().getClassLoader())
             };
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java
index 7d7be4b..2f18ace 100644
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java
+++ b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java
@@ -82,10 +82,6 @@ public class GridP2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, int
      */
     @SuppressWarnings({"PublicInnerClass"})
     public static class TestJob extends ComputeJobAdapter {
-        /** User resource. */
-        @IgniteUserResource
-        private transient GridTestUserResource rsrc;
-
         /** Task session. */
         @IgniteTaskSessionResource
         private ComputeTaskSession ses;
@@ -136,7 +132,6 @@ public class GridP2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, int
             }
 
             return new int[] {
-                System.identityHashCode(rsrc),
                 System.identityHashCode(ses.getClassLoader())
             };
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java
index bfff917..2c0ef3c 100644
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java
+++ b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java
@@ -82,10 +82,6 @@ public class GridP2PTestTaskExternalPath2 extends ComputeTaskAdapter<Object, int
      */
     @SuppressWarnings("PublicInnerClass")
     public static class TestJob extends ComputeJobAdapter {
-        /** User resource. */
-        @IgniteUserResource
-        private transient GridTestUserResource rsrc;
-
         /** Ignite instance. */
         @IgniteInstanceResource
         private Ignite ignite;
@@ -129,7 +125,6 @@ public class GridP2PTestTaskExternalPath2 extends ComputeTaskAdapter<Object, int
             }
 
             return new int[] {
-                System.identityHashCode(rsrc),
                 System.identityHashCode(ses.getClassLoader())
             };
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridAbstractUserExternalResource.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridAbstractUserExternalResource.java b/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridAbstractUserExternalResource.java
deleted file mode 100644
index 134d34a..0000000
--- a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridAbstractUserExternalResource.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.external.resource;
-
-import org.apache.ignite.*;
-import org.apache.ignite.resources.*;
-import org.springframework.context.*;
-import javax.management.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- * Tests task resource injection.
- */
-@SuppressWarnings({"UnusedDeclaration"})
-public abstract class GridAbstractUserExternalResource {
-    /** */
-    static final Map<Class<?>, Integer> createClss = new HashMap<>();
-
-    /** */
-    static final Map<Class<?>, Integer> deployClss = new HashMap<>();
-
-    /** */
-    static final Map<Class<?>, Integer> undeployClss = new HashMap<>();
-
-    /** */
-    @IgniteLoggerResource
-    private IgniteLogger log;
-
-    /** */
-    @IgniteInstanceResource
-    private Ignite ignite;
-
-    /** */
-    @IgniteSpringApplicationContextResource
-    private ApplicationContext springCtx;
-
-    /** */
-    GridAbstractUserExternalResource() {
-        addUsage(createClss);
-    }
-
-    /** */
-    @SuppressWarnings("unused")
-    @IgniteUserResourceOnDeployed
-    private void deploy() {
-        addUsage(deployClss);
-
-        assert log != null;
-        assert ignite != null;
-        assert springCtx != null;
-
-        log.info("Deploying resource: " + this);
-    }
-
-    /** */
-    @SuppressWarnings("unused")
-    @IgniteUserResourceOnUndeployed
-    private void undeploy() {
-        addUsage(undeployClss);
-
-        assert log != null;
-        assert ignite != null;
-        assert springCtx != null;
-
-        log.info("Undeploying resource: " + this);
-    }
-
-    /** */
-    @SuppressWarnings("unused")
-    private void neverCalled() {
-        assert false;
-    }
-
-    /**
-     * @param map Usage map to check.
-     */
-    @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
-    private void addUsage(Map<Class<?>, Integer> map) {
-        synchronized (map) {
-            Integer cnt = map.get(getClass());
-
-            map.put(getClass(), cnt == null ? 1 : cnt + 1);
-        }
-    }
-
-    /**
-     * @param usage Map of classes to their usages.
-     * @param cls Used class.
-     * @param cnt Expected number of usages.
-     */
-    public static void checkUsageCount(Map<Class<?>, Integer> usage, Class<?> cls, int cnt) {
-        Integer used = usage.get(cls);
-
-        if (used == null)
-            used = 0;
-
-        assert used == cnt : "Invalid count [expected=" + cnt + ", actual=" + used + ", usageMap=" + usage + ']';
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        StringBuilder buf = new StringBuilder();
-
-        buf.append(getClass().getSimpleName()).append(" [");
-        buf.append(']');
-
-        return buf.toString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResource1.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResource1.java b/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResource1.java
deleted file mode 100644
index 9c02a3f..0000000
--- a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResource1.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.external.resource;
-
-/**
- * External resource which could be injected.
- */
-public class GridUserExternalResource1 extends GridAbstractUserExternalResource {
-    // No-op.
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResource2.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResource2.java b/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResource2.java
deleted file mode 100644
index fd9ffdf..0000000
--- a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResource2.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.external.resource;
-
-/**
- * External resource which could be injected.
- */
-public class GridUserExternalResource2 extends GridAbstractUserExternalResource {
-    // No-op.
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResourceTask1.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResourceTask1.java b/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResourceTask1.java
deleted file mode 100644
index 2164a70..0000000
--- a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResourceTask1.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.external.resource;
-
-import org.apache.ignite.*;
-import org.apache.ignite.compute.*;
-import org.apache.ignite.resources.*;
-import org.gridgain.grid.*;
-
-import java.io.*;
-import java.util.*;
-
-import static org.gridgain.grid.external.resource.GridAbstractUserExternalResource.*;
-
-/**
- * Resource injection task.
- */
-public class GridUserExternalResourceTask1 extends ComputeTaskSplitAdapter<Object, Object> {
-    /** User resource. */
-    @IgniteUserResource(resourceClass = GridUserExternalResource1.class)
-    private transient GridAbstractUserExternalResource rsrc1;
-
-    /** User resource. */
-    @IgniteUserResource
-    private transient GridUserExternalResource2 rsrc2;
-
-    /** User resource. */
-    @IgniteUserResource(resourceClass = GridUserExternalResource1.class, resourceName = "rsrc3")
-    private transient GridAbstractUserExternalResource rsrc3;
-
-    /** User resource. */
-    @IgniteUserResource(resourceName = "rsrc4")
-    private transient GridUserExternalResource2 rsrc4;
-
-    /** */
-    @IgniteLoggerResource
-    private IgniteLogger log;
-
-    /** {@inheritDoc} */
-    @Override protected Collection<ComputeJobAdapter> split(int gridSize, Object arg) throws IgniteCheckedException {
-        assert rsrc1 != null;
-        assert rsrc2 != null;
-        assert rsrc3 != null;
-        assert rsrc4 != null;
-        assert log != null;
-
-        checkUsageCount(createClss, GridUserExternalResource1.class, 2);
-        checkUsageCount(createClss, GridUserExternalResource2.class, 2);
-        checkUsageCount(deployClss, GridUserExternalResource1.class, 2);
-        checkUsageCount(deployClss, GridUserExternalResource2.class, 2);
-
-        log.info("Injected shared resource1 into task: " + rsrc1);
-        log.info("Injected shared resource2 into task: " + rsrc2);
-        log.info("Injected shared resource3 into task: " + rsrc3);
-        log.info("Injected shared resource4 into task: " + rsrc4);
-        log.info("Injected log resource into task: " + log);
-
-        Collection<ComputeJobAdapter> jobs = new ArrayList<>(gridSize);
-
-        for (int i = 0; i < gridSize; i++)
-            jobs.add(new GridUserExternalResourceJob1());
-
-        return jobs;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
-        assert rsrc1 != null;
-        assert rsrc2 != null;
-        assert rsrc3 != null;
-        assert rsrc4 != null;
-        assert log != null;
-
-        checkUsageCount(createClss, GridUserExternalResource1.class, 2);
-        checkUsageCount(createClss, GridUserExternalResource2.class, 2);
-        checkUsageCount(deployClss, GridUserExternalResource1.class, 2);
-        checkUsageCount(deployClss, GridUserExternalResource2.class, 2);
-
-        // Nothing to reduce.
-        return null;
-    }
-
-    /**
-     * Job with injected resources.
-     */
-    public final class GridUserExternalResourceJob1 extends ComputeJobAdapter {
-        /** User resource. */
-        @IgniteUserResource
-        private transient GridUserExternalResource1 rsrc5;
-
-        /** User resource. */
-        @IgniteUserResource(resourceClass = GridUserExternalResource2.class)
-        private transient GridAbstractUserExternalResource rsrc6;
-
-        /** User resource. */
-        @IgniteUserResource(resourceName = "rsrc3")
-        private transient GridUserExternalResource1 rsrc7;
-
-        /** User resource. */
-        @IgniteUserResource(resourceClass = GridUserExternalResource2.class, resourceName = "rsrc4")
-        private transient GridAbstractUserExternalResource rsrc8;
-
-        /** {@inheritDoc} */
-        @SuppressWarnings({"ObjectEquality"})
-        @Override public Serializable execute() throws IgniteCheckedException {
-            assert rsrc1 != null;
-            assert rsrc2 != null;
-            assert rsrc3 != null;
-            assert rsrc4 != null;
-            assert log != null;
-
-            assert rsrc5 != null;
-            assert rsrc6 != null;
-            assert rsrc7 != null;
-            assert rsrc8 != null;
-
-            checkUsageCount(createClss, GridUserExternalResource1.class, 2);
-            checkUsageCount(createClss, GridUserExternalResource2.class, 2);
-            checkUsageCount(deployClss, GridUserExternalResource1.class, 2);
-            checkUsageCount(deployClss, GridUserExternalResource2.class, 2);
-
-            // Make sure that neither task nor global scope got
-            // created more than once.
-            assert rsrc1 == rsrc5;
-            assert rsrc2 == rsrc6;
-            assert rsrc3 == rsrc7;
-            assert rsrc4 == rsrc8;
-
-            log.info("Injected shared resource1 into job: " + rsrc1);
-            log.info("Injected shared resource2 into job: " + rsrc2);
-            log.info("Injected shared resource3 into job: " + rsrc3);
-            log.info("Injected shared resource4 into job: " + rsrc4);
-            log.info("Injected shared resource5 into job: " + rsrc5);
-            log.info("Injected shared resource6 into job: " + rsrc6);
-            log.info("Injected shared resource7 into job: " + rsrc7);
-            log.info("Injected shared resource8 into job: " + rsrc8);
-            log.info("Injected log resource into job: " + log);
-
-            return null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResourceTask2.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResourceTask2.java b/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResourceTask2.java
deleted file mode 100644
index ec39d6b..0000000
--- a/modules/spring/src/test/java/org/gridgain/grid/external/resource/GridUserExternalResourceTask2.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.external.resource;
-
-import org.apache.ignite.*;
-import org.apache.ignite.compute.*;
-import org.apache.ignite.resources.*;
-import org.gridgain.grid.*;
-
-import java.io.*;
-import java.util.*;
-
-import static org.gridgain.grid.external.resource.GridAbstractUserExternalResource.*;
-
-/**
- * Resource injection task.
- */
-@SuppressWarnings("PublicInnerClass")
-public class GridUserExternalResourceTask2 extends ComputeTaskSplitAdapter<Object, Object> {
-    /** User resource. */
-    @IgniteUserResource
-    private transient GridUserExternalResource1 rsrc1;
-
-    /** User resource. */
-    @IgniteUserResource(resourceClass = GridUserExternalResource2.class)
-    private transient GridAbstractUserExternalResource rsrc2;
-
-    /** User resource. */
-    @IgniteUserResource(resourceName = "rsrc3")
-    private transient GridUserExternalResource1 rsrc3;
-
-    /** User resource. */
-    @IgniteUserResource(resourceClass = GridUserExternalResource2.class, resourceName = "rsrc4")
-    private transient GridAbstractUserExternalResource rsrc4;
-
-    /** */
-    @IgniteLoggerResource
-    private IgniteLogger log;
-
-    /** */
-    @IgniteTaskSessionResource
-    private ComputeTaskSession ses;
-
-    /** {@inheritDoc} */
-    @Override protected Collection<ComputeJobAdapter> split(int gridSize, Object arg) throws IgniteCheckedException {
-        assert rsrc1 != null;
-        assert rsrc2 != null;
-        assert rsrc3 != null;
-        assert rsrc4 != null;
-        assert log != null;
-        assert ses != null;
-
-        checkUsageCount(createClss, GridUserExternalResource1.class, 2);
-        checkUsageCount(createClss, GridUserExternalResource2.class, 2);
-        checkUsageCount(deployClss, GridUserExternalResource1.class, 2);
-        checkUsageCount(deployClss, GridUserExternalResource2.class, 2);
-
-        log.info("Injected shared resource1 into task: " + rsrc1);
-        log.info("Injected shared resource2 into task: " + rsrc2);
-        log.info("Injected shared resource3 into task: " + rsrc3);
-        log.info("Injected shared resource4 into task: " + rsrc4);
-
-        Collection<ComputeJobAdapter> jobs = new ArrayList<>(gridSize);
-
-        for (int i = 0; i < gridSize; i++)
-            jobs.add(new GridUserExternalResourceJob2());
-
-        return jobs;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
-        assert rsrc1 != null;
-        assert rsrc2 != null;
-        assert rsrc3 != null;
-        assert rsrc4 != null;
-        assert log != null;
-
-        checkUsageCount(createClss, GridUserExternalResource1.class, 2);
-        checkUsageCount(createClss, GridUserExternalResource2.class, 2);
-        checkUsageCount(deployClss, GridUserExternalResource1.class, 2);
-        checkUsageCount(deployClss, GridUserExternalResource2.class, 2);
-
-        // Nothing to reduce.
-        return null;
-    }
-    /**
-     * Job with injected resources.
-     */
-    public final class GridUserExternalResourceJob2 extends ComputeJobAdapter {
-        /** User resource. */
-        @IgniteUserResource(resourceClass = GridUserExternalResource1.class)
-        private transient GridAbstractUserExternalResource rsrc5;
-
-        /** User resource. */
-        @IgniteUserResource
-        private transient GridUserExternalResource2 rsrc6;
-
-        /** User resource. */
-        @IgniteUserResource(resourceClass = GridUserExternalResource1.class, resourceName = "rsrc3")
-        private transient GridAbstractUserExternalResource rsrc7;
-
-        /** User resource. */
-        @IgniteUserResource(resourceName = "rsrc4")
-        private transient GridUserExternalResource2 rsrc8;
-
-        /** {@inheritDoc} */
-        @SuppressWarnings({"ObjectEquality"})
-        @Override public Serializable execute() {
-            assert rsrc1 != null;
-            assert rsrc2 != null;
-            assert rsrc3 != null;
-            assert rsrc4 != null;
-            assert log != null;
-
-            assert rsrc5 != null;
-            assert rsrc6 != null;
-            assert rsrc7 != null;
-            assert rsrc8 != null;
-
-            // Make sure that neither task nor global scope got
-            // created more than once.
-            assert rsrc1 == rsrc5;
-            assert rsrc2 == rsrc6;
-            assert rsrc3 == rsrc7;
-            assert rsrc4 == rsrc8;
-
-            // According to the UserResource class description
-            // different tasks should have different resources deployed.
-            // Thus second task (this one) should have 4 created/deployed resources.
-            checkUsageCount(createClss, GridUserExternalResource1.class, 2);
-            checkUsageCount(createClss, GridUserExternalResource2.class, 2);
-            checkUsageCount(deployClss, GridUserExternalResource1.class, 2);
-            checkUsageCount(deployClss, GridUserExternalResource2.class, 2);
-
-            log.info("Injected shared resource1 into job: " + rsrc1);
-            log.info("Injected shared resource2 into job: " + rsrc2);
-            log.info("Injected shared resource3 into job: " + rsrc3);
-            log.info("Injected shared resource4 into job: " + rsrc4);
-            log.info("Injected shared resource5 into job: " + rsrc5);
-            log.info("Injected shared resource6 into job: " + rsrc6);
-            log.info("Injected shared resource7 into job: " + rsrc7);
-            log.info("Injected shared resource8 into job: " + rsrc8);
-            log.info("Injected log resource into job: " + log);
-
-            return null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/spring/src/test/java/org/gridgain/grid/external/resource/package.html
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/external/resource/package.html b/modules/spring/src/test/java/org/gridgain/grid/external/resource/package.html
deleted file mode 100644
index 5cad80a..0000000
--- a/modules/spring/src/test/java/org/gridgain/grid/external/resource/package.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<!--
-    @html.file.header
-    _________        _____ __________________        _____
-    __  ____/___________(_)______  /__  ____/______ ____(_)_______
-    _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
-    / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
-    \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
--->
-<html>
-<body>
-    <!-- Package description. -->
-    Contains internal tests or test related classes and interfaces.
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridAbstractUserResource.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridAbstractUserResource.java b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridAbstractUserResource.java
index 68c1f1d..26a75b7 100644
--- a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridAbstractUserResource.java
+++ b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridAbstractUserResource.java
@@ -69,32 +69,6 @@ abstract class GridAbstractUserResource {
 
     /** */
     @SuppressWarnings("unused")
-    @IgniteUserResourceOnDeployed
-    private void deploy() {
-        addUsage(deployClss);
-
-        assert log != null;
-        assert ignite != null;
-        assert springCtx != null;
-
-        log.info("Deploying resource: " + this);
-    }
-
-    /** */
-    @SuppressWarnings("unused")
-    @IgniteUserResourceOnUndeployed
-    private void undeploy() {
-        addUsage(undeployClss);
-
-        assert log != null;
-        assert ignite != null;
-        assert springCtx != null;
-
-        log.info("Undeploying resource: " + this);
-    }
-
-    /** */
-    @SuppressWarnings("unused")
     private void neverCalled() {
         assert false;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad57f8ed/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceConcurrentUndeploySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceConcurrentUndeploySelfTest.java b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceConcurrentUndeploySelfTest.java
index 4947af2..fba23d2 100644
--- a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceConcurrentUndeploySelfTest.java
+++ b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceConcurrentUndeploySelfTest.java
@@ -395,22 +395,11 @@ public class GridResourceConcurrentUndeploySelfTest extends GridCommonAbstractTe
 
     /** */
     public static class UserResourceTask1 extends ComputeTaskAdapter<Boolean, Object> {
-        /** */
-        @IgniteUserResource
-        private transient UserResource rsrcTask;
-
         /** {@inheritDoc} */
         @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Boolean arg) throws IgniteCheckedException {
-            assert rsrcTask != null;
-
             for (ClusterNode node : subgrid) {
                 if (node.id().equals(nodeToExec)) {
                     return Collections.singletonMap(new ComputeJobAdapter(arg) {
-                        /** */
-                        @SuppressWarnings("unused")
-                        @IgniteUserResource
-                        private transient UserResource2 rsrc2;
-
                         /** {@inheritDoc} */
                         @SuppressWarnings({"ObjectEquality"})
                         @Override public Serializable execute() {
@@ -450,8 +439,6 @@ public class GridResourceConcurrentUndeploySelfTest extends GridCommonAbstractTe
 
         /** {@inheritDoc} */
         @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
-            assert rsrcTask != null;
-
             return null;
         }
     }


Mime
View raw message