ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsetrak...@apache.org
Subject [1/6] incubator-ignite git commit: sprint-1 - Renaming ManagedServices to IgniteServices.
Date Fri, 06 Feb 2015 00:32:12 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-188 [created] 9200ef5e8


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/main/java/org/apache/ignite/services/ServiceConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/services/ServiceConfiguration.java b/modules/core/src/main/java/org/apache/ignite/services/ServiceConfiguration.java
new file mode 100644
index 0000000..fedcfbf
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/services/ServiceConfiguration.java
@@ -0,0 +1,305 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.services;
+
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.util.tostring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+
+import java.io.*;
+
+/**
+ * Managed service configuration. In addition to deploying managed services by
+ * calling any of the provided {@code deploy(...)} methods, managed services
+ * can also be automatically deployed on startup by specifying them in {@link org.apache.ignite.configuration.IgniteConfiguration}
+ * like so:
+ * <pre name="code" class="java">
+ * GridConfiguration gridCfg = new GridConfiguration();
+ *
+ * GridServiceConfiguration svcCfg1 = new GridServiceConfiguration();
+ *
+ * svcCfg1.setName("myClusterSingletonService");
+ * svcCfg1.setMaxPerNodeCount(1);
+ * svcCfg1.setTotalCount(1);
+ * svcCfg1.setService(new MyClusterSingletonService());
+ *
+ * GridServiceConfiguration svcCfg2 = new GridServiceConfiguration();
+ *
+ * svcCfg2.setName("myNodeSingletonService");
+ * svcCfg2.setMaxPerNodeCount(1);
+ * svcCfg2.setService(new MyNodeSingletonService());
+ *
+ * gridCfg.setServiceConfiguration(svcCfg1, svcCfg2);
+ * ...
+ * GridGain.start(gridCfg);
+ * </pre>
+ * The above configuration can also be specified in a Spring configuration file.
+ */
+public class ServiceConfiguration implements Serializable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Service name. */
+    private String name;
+
+    /** Service instance. */
+    @GridToStringExclude
+    private Service svc;
+
+    /** Total count. */
+    private int totalCnt;
+
+    /** Max per-node count. */
+    private int maxPerNodeCnt;
+
+    /** Cache name. */
+    private String cacheName;
+
+    /** Affinity key. */
+    private Object affKey;
+
+    /** Node filter. */
+    @GridToStringExclude
+    private IgnitePredicate<ClusterNode> nodeFilter;
+
+    /**
+     * Gets service name.
+     * <p>
+     * This parameter is mandatory when deploying a service.
+     *
+     * @return Service name.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets service name.
+     * <p>
+     * This parameter is mandatory when deploying a service.
+     *
+     * @param name Service name.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Gets service instance.
+     * <p>
+     * This parameter is mandatory when deploying a service.
+     *
+     * @return Service instance.
+     */
+    public Service getService() {
+        return svc;
+    }
+
+    /**
+     * Sets service instance.
+     * <p>
+     * This parameter is mandatory when deploying a service.
+     *
+     * @param svc Service instance.
+     */
+    public void setService(Service svc) {
+        this.svc = svc;
+    }
+
+    /**
+     * Gets total number of deployed service instances in the cluster, {@code 0} for unlimited.
+     * <p>
+     * At least one of {@code getTotalCount()} or {@link #getMaxPerNodeCount()} values must be positive.
+     *
+     * @return Total number of deployed service instances in the cluster, {@code 0} for unlimited.
+     */
+    public int getTotalCount() {
+        return totalCnt;
+    }
+
+    /**
+     * Sets total number of deployed service instances in the cluster, {@code 0} for unlimited.
+     * <p>
+     * At least one of {@code getTotalCount()} or {@link #getMaxPerNodeCount()} values must be positive.
+     *
+     * @param totalCnt Total number of deployed service instances in the cluster, {@code 0} for unlimited.
+     */
+    public void setTotalCount(int totalCnt) {
+        this.totalCnt = totalCnt;
+    }
+
+    /**
+     * Gets maximum number of deployed service instances on each node, {@code 0} for unlimited.
+     * <p>
+     * At least one of {@code getMaxPerNodeCount()} or {@link #getTotalCount()} values must be positive.
+     *
+     * @return Maximum number of deployed service instances on each node, {@code 0} for unlimited.
+     */
+    public int getMaxPerNodeCount() {
+        return maxPerNodeCnt;
+    }
+
+    /**
+     * Sets maximum number of deployed service instances on each node, {@code 0} for unlimited.
+     * <p>
+     * At least one of {@code getMaxPerNodeCount()} or {@link #getTotalCount()} values must be positive.
+     *
+     * @param maxPerNodeCnt Maximum number of deployed service instances on each node, {@code 0} for unlimited.
+     */
+    public void setMaxPerNodeCount(int maxPerNodeCnt) {
+        this.maxPerNodeCnt = maxPerNodeCnt;
+    }
+
+    /**
+     * Gets cache name used for key-to-node affinity calculation.
+     * <p>
+     * This parameter is optional and is set only when deploying service based on key-affinity.
+     *
+     * @return Cache name, possibly {@code null}.
+     */
+    public String getCacheName() {
+        return cacheName;
+    }
+
+    /**
+     * Sets cache name used for key-to-node affinity calculation.
+     * <p>
+     * This parameter is optional and is set only when deploying service based on key-affinity.
+     *
+     * @param cacheName Cache name, possibly {@code null}.
+     */
+    public void setCacheName(String cacheName) {
+        this.cacheName = cacheName;
+    }
+
+    /**
+     * Gets affinity key used for key-to-node affinity calculation.
+     * <p>
+     * This parameter is optional and is set only when deploying service based on key-affinity.
+     *
+     * @return Affinity key, possibly {@code null}.
+     */
+    public Object getAffinityKey() {
+        return affKey;
+    }
+
+    /**
+     * Sets affinity key used for key-to-node affinity calculation.
+     * <p>
+     * This parameter is optional and is set only when deploying service based on key-affinity.
+     *
+     * @param affKey Affinity key, possibly {@code null}.
+     */
+    public void setAffinityKey(Object affKey) {
+        this.affKey = affKey;
+    }
+
+    /**
+     * Gets node filter used to filter nodes on which the service will be deployed.
+     * <p>
+     * This parameter is optional. If not provided service may be deployed on any or all
+     * nodes in the grid, based on configuration.
+     *
+     * @return Node filter used to filter nodes on which the service will be deployed, possibly {@code null}.
+     */
+    public IgnitePredicate<ClusterNode> getNodeFilter() {
+        return nodeFilter;
+    }
+
+    /**
+     * Sets node filter used to filter nodes on which the service will be deployed.
+     * <p>
+     * This parameter is optional. If not provided service may be deployed on any or all
+     * nodes in the grid, based on configuration.
+     *
+     * @param nodeFilter Node filter used to filter nodes on which the service will be deployed, possibly {@code null}.
+     */
+    public void setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter) {
+        this.nodeFilter = nodeFilter;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"RedundantIfStatement", "EqualsWhichDoesntCheckParameterClass"})
+    @Override public boolean equals(Object o) {
+        if (!equalsIgnoreNodeFilter(o))
+            return false;
+
+        ServiceConfiguration that = (ServiceConfiguration)o;
+
+        if (nodeFilter != null && that.nodeFilter != null) {
+            if (!nodeFilter.getClass().equals(that.nodeFilter.getClass()))
+                return false;
+        }
+        else if (nodeFilter != null || that.nodeFilter != null)
+            return false;
+
+        return true;
+    }
+
+    /**
+     * Checks if configurations are equal ignoring the node filter. Node filters control on which
+     * nodes the services are deployed and often can be ignored for equality checks.
+     *
+     * @param o Other configuration.
+     * @return {@code True} if configurations are equal, {@code false} otherwise.
+     */
+    @SuppressWarnings("RedundantIfStatement")
+    public boolean equalsIgnoreNodeFilter(Object o) {
+        if (this == o)
+            return true;
+
+        if (o == null || getClass() != o.getClass())
+            return false;
+
+        ServiceConfiguration that = (ServiceConfiguration)o;
+
+        if (maxPerNodeCnt != that.maxPerNodeCnt)
+            return false;
+
+        if (totalCnt != that.totalCnt)
+            return false;
+
+        if (affKey != null ? !affKey.equals(that.affKey) : that.affKey != null)
+            return false;
+
+        if (cacheName != null ? !cacheName.equals(that.cacheName) : that.cacheName != null)
+            return false;
+
+        if (name != null ? !name.equals(that.name) : that.name != null)
+            return false;
+
+        if (svc != null ? !svc.getClass().equals(that.svc.getClass()) : that.svc != null)
+            return false;
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        return name == null ? 0 : name.hashCode();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        String svcCls = svc == null ? "" : svc.getClass().getSimpleName();
+        String nodeFilterCls = nodeFilter == null ? "" : nodeFilter.getClass().getSimpleName();
+
+        return S.toString(ServiceConfiguration.class, this, "svcCls", svcCls, "nodeFilterCls", nodeFilterCls);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/main/java/org/apache/ignite/services/ServiceContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/services/ServiceContext.java b/modules/core/src/main/java/org/apache/ignite/services/ServiceContext.java
new file mode 100644
index 0000000..2868c4a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/services/ServiceContext.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.services;
+
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Service execution context. Execution context is provided into {@link Service#execute(ServiceContext)}
+ * and {@link Service#cancel(ServiceContext)} methods and contains information about specific service
+ * execution.
+ */
+public interface ServiceContext extends Serializable {
+    /**
+     * Gets service name.
+     *
+     * @return Service name.
+     */
+    public String name();
+
+    /**
+     * Gets service execution ID. Execution ID is guaranteed to be unique across
+     * all service deployments.
+     *
+     * @return Service execution ID.
+     */
+    public UUID executionId();
+
+    /**
+     * Get flag indicating whether service has been cancelled or not.
+     *
+     * @return Flag indicating whether service has been cancelled or not.
+     */
+    public boolean isCancelled();
+
+    /**
+     * Gets cache name used for key-to-node affinity calculation. This parameter is optional
+     * and is set only when key-affinity service was deployed.
+     *
+     * @return Cache name, possibly {@code null}.
+     */
+    @Nullable public String cacheName();
+
+    /**
+     * Gets affinity key used for key-to-node affinity calculation. This parameter is optional
+     * and is set only when key-affinity service was deployed.
+     *
+     * @return Affinity key, possibly {@code null}.
+     */
+    @Nullable public <K> K affinityKey();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/main/java/org/apache/ignite/services/ServiceDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/services/ServiceDescriptor.java b/modules/core/src/main/java/org/apache/ignite/services/ServiceDescriptor.java
new file mode 100644
index 0000000..927d778
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/services/ServiceDescriptor.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.services;
+
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Service deployment descriptor. Contains all service deployment configuration, and also
+ * deployment topology snapshot as well as origin node ID.
+ * <p>
+ * Service descriptors can be retrieved by calling {@link org.apache.ignite.IgniteServices#serviceDescriptors()} method.
+ */
+public interface ServiceDescriptor extends Serializable {
+    /**
+     * Gets service name.
+     *
+     * @return Service name.
+     */
+    public String name();
+
+    /**
+     * Gets service class.
+     *
+     * @return Service class.
+     */
+    public Class<? extends Service> serviceClass();
+
+    /**
+     * Gets maximum allowed total number of deployed services in the grid, {@code 0} for unlimited.
+     *
+     * @return Maximum allowed total number of deployed services in the grid, {@code 0} for unlimited.
+     */
+    public int totalCount();
+
+    /**
+     * Gets maximum allowed number of deployed services on each node, {@code 0} for unlimited.
+     *
+     * @return Maximum allowed total number of deployed services on each node, {@code 0} for unlimited.
+     */
+    public int maxPerNodeCount();
+
+    /**
+     * Gets cache name used for key-to-node affinity calculation. This parameter is optional
+     * and is set only when key-affinity service was deployed.
+     *
+     * @return Cache name, possibly {@code null}.
+     */
+    @Nullable public String cacheName();
+
+    /**
+     * Gets affinity key used for key-to-node affinity calculation. This parameter is optional
+     * and is set only when key-affinity service was deployed.
+     *
+     * @return Affinity key, possibly {@code null}.
+     */
+    @Nullable public <K> K affinityKey();
+
+    /**
+     * Gets ID of grid node that initiated the service deployment.
+     *
+     * @return ID of grid node that initiated the service deployment.
+     */
+    public UUID originNodeId();
+
+    /**
+     * Gets service deployment topology snapshot. Service topology snapshot is represented
+     * by number of service instances deployed on a node mapped to node ID.
+     *
+     * @return Map of number of service instances per node ID.
+     */
+    public Map<UUID, Integer> topologySnapshot();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/main/java/org/apache/ignite/services/package.html
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/services/package.html b/modules/core/src/main/java/org/apache/ignite/services/package.html
new file mode 100644
index 0000000..fe62d60
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/services/package.html
@@ -0,0 +1,23 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<body>
+    Contains main <b>Managed Services APIs.</b>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/internal/processors/service/DummyService.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/DummyService.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/DummyService.java
index 6929696..a633bb5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/DummyService.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/DummyService.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.processors.service;
 
-import org.apache.ignite.managed.*;
+import org.apache.ignite.services.*;
 import org.jdk8.backport.*;
 
 import java.util.concurrent.*;
@@ -26,7 +26,7 @@ import java.util.concurrent.atomic.*;
 /**
  * Dummy service.
  */
-public class DummyService implements ManagedService {
+public class DummyService implements Service {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -46,7 +46,7 @@ public class DummyService implements ManagedService {
     private static final ConcurrentMap<String, AtomicInteger> cancelled = new ConcurrentHashMap8<>();
 
     /** {@inheritDoc} */
-    @Override public void cancel(ManagedServiceContext ctx) {
+    @Override public void cancel(ServiceContext ctx) {
         AtomicInteger cntr = cancelled.get(ctx.name());
 
         if (cntr == null) {
@@ -67,7 +67,7 @@ public class DummyService implements ManagedService {
     }
 
     /** {@inheritDoc} */
-    @Override public void init(ManagedServiceContext ctx) throws Exception {
+    @Override public void init(ServiceContext ctx) throws Exception {
         AtomicInteger cntr = inited.get(ctx.name());
 
         if (cntr == null) {
@@ -83,7 +83,7 @@ public class DummyService implements ManagedService {
     }
 
     /** {@inheritDoc} */
-    @Override public void execute(ManagedServiceContext ctx) {
+    @Override public void execute(ServiceContext ctx) {
         AtomicInteger cntr = started.get(ctx.name());
 
         if (cntr == null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java
index 595b17d..0c74458 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java
@@ -24,7 +24,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
-import org.apache.ignite.managed.*;
+import org.apache.ignite.services.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -61,7 +61,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         c.setDiscoverySpi(discoSpi);
 
-        ManagedServiceConfiguration[] svcs = services();
+        ServiceConfiguration[] svcs = services();
 
         if (svcs != null)
             c.setServiceConfiguration(svcs);
@@ -89,7 +89,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
      *
      * @return Services configuration.
      */
-    protected ManagedServiceConfiguration[] services() {
+    protected ServiceConfiguration[] services() {
         return null;
     }
 
@@ -141,8 +141,8 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
     public void testSameConfiguration() throws Exception {
         String name = "dupService";
 
-        IgniteManaged svcs1 = randomGrid().managed().withAsync();
-        IgniteManaged svcs2 = randomGrid().managed().withAsync();
+        IgniteServices svcs1 = randomGrid().services().withAsync();
+        IgniteServices svcs2 = randomGrid().services().withAsync();
 
         svcs1.deployClusterSingleton(name, new DummyService());
 
@@ -170,8 +170,8 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
     public void testDifferentConfiguration() throws Exception {
         String name = "dupService";
 
-        IgniteManaged svcs1 = randomGrid().managed().withAsync();
-        IgniteManaged svcs2 = randomGrid().managed().withAsync();
+        IgniteServices svcs1 = randomGrid().services().withAsync();
+        IgniteServices svcs2 = randomGrid().services().withAsync();
 
         svcs1.deployClusterSingleton(name, new DummyService());
 
@@ -205,13 +205,13 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         Ignite g = randomGrid();
 
-        g.managed().deployNodeSingleton(name, new DummyService());
+        g.services().deployNodeSingleton(name, new DummyService());
 
-        DummyService svc = g.managed().service(name);
+        DummyService svc = g.services().service(name);
 
         assertNotNull(svc);
 
-        Collection<DummyService> svcs = g.managed().services(name);
+        Collection<DummyService> svcs = g.services().services(name);
 
         assertEquals(1, svcs.size());
     }
@@ -224,7 +224,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         Ignite g = randomGrid();
 
-        g.managed().deployMultiple(name, new DummyService(), nodeCount() * 2, 3);
+        g.services().deployMultiple(name, new DummyService(), nodeCount() * 2, 3);
 
         GridTestUtils.retryAssert(log, 50, 200, new CA() {
             @Override
@@ -232,7 +232,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
                 int cnt = 0;
 
                 for (int i = 0; i < nodeCount(); i++) {
-                    Collection<DummyService> svcs = grid(i).managed().services(name);
+                    Collection<DummyService> svcs = grid(i).services().services(name);
 
                     if (svcs != null)
                         cnt += svcs.size();
@@ -255,7 +255,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         DummyService.exeLatch(name, latch);
 
-        IgniteManaged svcs = g.managed().withAsync();
+        IgniteServices svcs = g.services().withAsync();
 
         svcs.deployNodeSingleton(name, new DummyService());
 
@@ -272,7 +272,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
         assertEquals(name, nodeCount(), DummyService.started(name));
         assertEquals(name, 0, DummyService.cancelled(name));
 
-        checkCount(name, g.managed().deployedServices(), nodeCount());
+        checkCount(name, g.services().serviceDescriptors(), nodeCount());
     }
 
     /**
@@ -287,7 +287,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         DummyService.exeLatch(name, latch);
 
-        IgniteManaged svcs = g.managed().withAsync();
+        IgniteServices svcs = g.services().withAsync();
 
         svcs.deployClusterSingleton(name, new DummyService());
 
@@ -304,7 +304,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
         assertEquals(name, 1, DummyService.started(name));
         assertEquals(name, 0, DummyService.cancelled(name));
 
-        checkCount(name, g.managed().deployedServices(), 1);
+        checkCount(name, g.services().serviceDescriptors(), 1);
     }
 
     /**
@@ -320,7 +320,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         String name = "serviceAffinity";
 
-        IgniteManaged svcs = g.managed().withAsync();
+        IgniteServices svcs = g.services().withAsync();
 
         svcs.deployKeyAffinitySingleton(name, new AffinityService(affKey),
                 CACHE_NAME, affKey);
@@ -333,7 +333,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         info("Finished waiting for service future: " + name);
 
-        checkCount(name, g.managed().deployedServices(), 1);
+        checkCount(name, g.services().serviceDescriptors(), 1);
     }
 
     /**
@@ -348,7 +348,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         DummyService.exeLatch(name, latch);
 
-        IgniteManaged svcs = g.managed().withAsync();
+        IgniteServices svcs = g.services().withAsync();
 
         svcs.deployMultiple(name, new DummyService(), nodeCount() * 2, 3);
 
@@ -365,7 +365,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
         assertEquals(name, nodeCount() * 2, DummyService.started(name));
         assertEquals(name, 0, DummyService.cancelled(name));
 
-        checkCount(name, g.managed().deployedServices(), nodeCount() * 2);
+        checkCount(name, g.services().serviceDescriptors(), nodeCount() * 2);
     }
 
     /**
@@ -382,7 +382,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         DummyService.exeLatch(name, latch);
 
-        IgniteManaged svcs = g.managed().withAsync();
+        IgniteServices svcs = g.services().withAsync();
 
         svcs.deployMultiple(name, new DummyService(), cnt, 3);
 
@@ -399,7 +399,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
         assertEquals(name, cnt, DummyService.started(name));
         assertEquals(name, 0, DummyService.cancelled(name));
 
-        checkCount(name, g.managed().deployedServices(), cnt);
+        checkCount(name, g.services().serviceDescriptors(), cnt);
     }
 
     /**
@@ -414,7 +414,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         DummyService.exeLatch(name, latch);
 
-        g.managed().deployClusterSingleton(name, new DummyService());
+        g.services().deployClusterSingleton(name, new DummyService());
 
         info("Deployed service: " + name);
 
@@ -427,7 +427,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         DummyService.cancelLatch(name, latch);
 
-        g.managed().cancel(name);
+        g.services().cancel(name);
 
         info("Cancelled service: " + name);
 
@@ -449,7 +449,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         DummyService.exeLatch(name, latch);
 
-        g.managed().deployNodeSingleton(name, new DummyService());
+        g.services().deployNodeSingleton(name, new DummyService());
 
         info("Deployed service: " + name);
 
@@ -462,7 +462,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
 
         DummyService.cancelLatch(name, latch);
 
-        g.managed().cancel(name);
+        g.services().cancel(name);
 
         info("Cancelled service: " + name);
 
@@ -477,7 +477,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
      * @param descs Descriptors.
      * @param cnt Expected count.
      */
-    protected void checkCount(String svcName, Iterable<ManagedServiceDescriptor> descs, int cnt) {
+    protected void checkCount(String svcName, Iterable<ServiceDescriptor> descs, int cnt) {
         assertEquals(cnt, actualCount(svcName, descs));
     }
 
@@ -486,10 +486,10 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
      * @param descs Descriptors.
      * @return Services count.
      */
-    protected int actualCount(String svcName, Iterable<ManagedServiceDescriptor> descs) {
+    protected int actualCount(String svcName, Iterable<ServiceDescriptor> descs) {
         int sum = 0;
 
-        for (ManagedServiceDescriptor d : descs) {
+        for (ServiceDescriptor d : descs) {
             if (d.name().equals(svcName)) {
                 for (Integer i : d.topologySnapshot().values())
                     sum += i;
@@ -522,7 +522,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
     /**
      * Affinity service.
      */
-    protected static class AffinityService implements ManagedService {
+    protected static class AffinityService implements Service {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -541,12 +541,12 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
         }
 
         /** {@inheritDoc} */
-        @Override public void cancel(ManagedServiceContext ctx) {
+        @Override public void cancel(ServiceContext ctx) {
             // No-op.
         }
 
         /** {@inheritDoc} */
-        @Override public void init(ManagedServiceContext ctx) throws Exception {
+        @Override public void init(ServiceContext ctx) throws Exception {
             X.println("Initializing affinity service for key: " + affKey);
 
             ClusterNode n = g.cache(CACHE_NAME).affinity().mapKeyToNode(affKey);
@@ -556,7 +556,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
         }
 
         /** {@inheritDoc} */
-        @Override public void execute(ManagedServiceContext ctx) {
+        @Override public void execute(ServiceContext ctx) {
             X.println("Executing affinity service for key: " + affKey);
         }
     }
@@ -564,7 +564,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
     /**
      * Counter service implementation.
      */
-    protected static class CounterServiceImpl implements CounterService, ManagedService {
+    protected static class CounterServiceImpl implements CounterService, Service {
         /** Auto-injected grid instance. */
         @IgniteInstanceResource
         private Ignite ignite;
@@ -623,12 +623,12 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
         }
 
         /** {@inheritDoc} */
-        @Override public void cancel(ManagedServiceContext ctx) {
+        @Override public void cancel(ServiceContext ctx) {
             X.println("Stopping counter service: " + ctx.name());
         }
 
         /** {@inheritDoc} */
-        @Override public void init(ManagedServiceContext ctx) throws Exception {
+        @Override public void init(ServiceContext ctx) throws Exception {
             X.println("Initializing counter service: " + ctx.name());
 
             key = ctx.name();
@@ -637,7 +637,7 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs
         }
 
         /** {@inheritDoc} */
-        @Override public void execute(ManagedServiceContext ctx) throws Exception {
+        @Override public void execute(ServiceContext ctx) throws Exception {
             X.println("Executing counter service: " + ctx.name());
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
index 07c9c6c..5fd378f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.service;
 
 import org.apache.ignite.*;
 import org.apache.ignite.internal.util.lang.*;
-import org.apache.ignite.managed.*;
+import org.apache.ignite.services.*;
 import org.apache.ignite.testframework.*;
 
 import java.util.concurrent.*;
@@ -46,10 +46,10 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc
     }
 
     /** {@inheritDoc} */
-    @Override protected ManagedServiceConfiguration[] services() {
-        ManagedServiceConfiguration[] arr = new ManagedServiceConfiguration[3];
+    @Override protected ServiceConfiguration[] services() {
+        ServiceConfiguration[] arr = new ServiceConfiguration[3];
 
-        ManagedServiceConfiguration cfg = new ManagedServiceConfiguration();
+        ServiceConfiguration cfg = new ServiceConfiguration();
 
         cfg.setName(CLUSTER_SINGLE);
         cfg.setMaxPerNodeCount(1);
@@ -58,7 +58,7 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc
 
         arr[0] = cfg;
 
-        cfg = new ManagedServiceConfiguration();
+        cfg = new ServiceConfiguration();
 
         cfg.setName(NODE_SINGLE);
         cfg.setMaxPerNodeCount(1);
@@ -66,7 +66,7 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc
 
         arr[1] = cfg;
 
-        cfg = new ManagedServiceConfiguration();
+        cfg = new ServiceConfiguration();
 
         cfg.setName(AFFINITY);
         cfg.setCacheName(CACHE_NAME);
@@ -92,7 +92,7 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc
                         DummyService.cancelled(CLUSTER_SINGLE) == 0 &&
                         DummyService.started(NODE_SINGLE) == nodeCount() &&
                         DummyService.cancelled(NODE_SINGLE) == 0 &&
-                        actualCount(AFFINITY, randomGrid().managed().deployedServices()) == 1;
+                        actualCount(AFFINITY, randomGrid().services().serviceDescriptors()) == 1;
                 }
             },
             2000
@@ -132,14 +132,14 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc
     public void testAffinityUpdateTopology() throws Exception {
         Ignite g = randomGrid();
 
-        checkCount(AFFINITY, g.managed().deployedServices(), 1);
+        checkCount(AFFINITY, g.services().serviceDescriptors(), 1);
 
         int nodeCnt = 2;
 
         startExtraNodes(nodeCnt);
 
         try {
-            checkCount(AFFINITY, g.managed().deployedServices(), 1);
+            checkCount(AFFINITY, g.services().serviceDescriptors(), 1);
         }
         finally {
             stopExtraNodes(nodeCnt);
@@ -163,7 +163,7 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc
 
             info(">>> Passed checks.");
 
-            checkCount(name, g.managed().deployedServices(), 1);
+            checkCount(name, g.services().serviceDescriptors(), 1);
         }
         finally {
             stopExtraNodes(nodeCnt);
@@ -191,7 +191,7 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc
             assertEquals(name, newNodes, DummyService.started(name));
             assertEquals(name, 0, DummyService.cancelled(name));
 
-            checkCount(name, g.managed().deployedServices(), nodeCount() + newNodes);
+            checkCount(name, g.services().serviceDescriptors(), nodeCount() + newNodes);
         }
         finally {
             stopExtraNodes(newNodes);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
index fccbf85..77b2ea5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
@@ -44,7 +44,7 @@ public class GridServiceProcessorMultiNodeSelfTest extends GridServiceProcessorA
 
         DummyService.exeLatch(name, latch);
 
-        IgniteManaged svcs = g.managed().withAsync();
+        IgniteServices svcs = g.services().withAsync();
 
         svcs.deployClusterSingleton(name, new DummyService());
 
@@ -71,7 +71,7 @@ public class GridServiceProcessorMultiNodeSelfTest extends GridServiceProcessorA
 
             info(">>> Passed checks.");
 
-            checkCount(name, g.managed().deployedServices(), 1);
+            checkCount(name, g.services().serviceDescriptors(), 1);
         }
         finally {
             stopExtraNodes(nodeCnt);
@@ -91,7 +91,7 @@ public class GridServiceProcessorMultiNodeSelfTest extends GridServiceProcessorA
 
         String name = "serviceAffinityUpdateTopology";
 
-        IgniteManaged svcs = g.managed().withAsync();
+        IgniteServices svcs = g.services().withAsync();
 
         svcs.deployKeyAffinitySingleton(name, new AffinityService(affKey),
             CACHE_NAME, affKey);
@@ -104,14 +104,14 @@ public class GridServiceProcessorMultiNodeSelfTest extends GridServiceProcessorA
 
         info("Finished waiting for service future: " + name);
 
-        checkCount(name, g.managed().deployedServices(), 1);
+        checkCount(name, g.services().serviceDescriptors(), 1);
 
         int nodeCnt = 2;
 
         startExtraNodes(nodeCnt);
 
         try {
-            checkCount(name, g.managed().deployedServices(), 1);
+            checkCount(name, g.services().serviceDescriptors(), 1);
         }
         finally {
             stopExtraNodes(nodeCnt);
@@ -130,7 +130,7 @@ public class GridServiceProcessorMultiNodeSelfTest extends GridServiceProcessorA
 
         DummyService.exeLatch(name, latch);
 
-        IgniteManaged svcs = g.managed().withAsync();
+        IgniteServices svcs = g.services().withAsync();
 
         svcs.deployNodeSingleton(name, new DummyService());
 
@@ -161,7 +161,7 @@ public class GridServiceProcessorMultiNodeSelfTest extends GridServiceProcessorA
             TestCase.assertEquals(name, nodeCount() + newNodes, DummyService.started(name));
             TestCase.assertEquals(name, 0, DummyService.cancelled(name));
 
-            checkCount(name, g.managed().deployedServices(), nodeCount() + newNodes);
+            checkCount(name, g.services().serviceDescriptors(), nodeCount() + newNodes);
         }
         finally {
             stopExtraNodes(newNodes);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorProxySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorProxySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorProxySelfTest.java
index ae82b48..967a1da 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorProxySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorProxySelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.processors.service;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.managed.*;
+import org.apache.ignite.services.*;
 
 import java.util.*;
 import java.util.concurrent.*;
@@ -43,22 +43,22 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         Ignite ignite = randomGrid();
 
-        ignite.managed().deployNodeSingleton(name, new CounterServiceImpl());
+        ignite.services().deployNodeSingleton(name, new CounterServiceImpl());
 
-        CounterService svc = ignite.managed().serviceProxy(name, CounterService.class, false);
+        CounterService svc = ignite.services().serviceProxy(name, CounterService.class, false);
 
         for (int i = 0; i < 10; i++)
             svc.increment();
 
         assertEquals(10, svc.get());
         assertEquals(10, svc.localIncrements());
-        assertEquals(10, ignite.managed(ignite.cluster().forLocal()).
+        assertEquals(10, ignite.services(ignite.cluster().forLocal()).
             serviceProxy(name, CounterService.class, false).localIncrements());
 
         // Make sure that remote proxies were not called.
         for (ClusterNode n : ignite.cluster().forRemotes().nodes()) {
             CounterService rmtSvc =
-                    ignite.managed(ignite.cluster().forNode(n)).serviceProxy(name, CounterService.class, false);
+                    ignite.services(ignite.cluster().forNode(n)).serviceProxy(name, CounterService.class, false);
 
             assertEquals(0, rmtSvc.localIncrements());
         }
@@ -72,9 +72,9 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         Ignite ignite = randomGrid();
 
-        ignite.managed().deployClusterSingleton(name, new CounterServiceImpl());
+        ignite.services().deployClusterSingleton(name, new CounterServiceImpl());
 
-        CounterService svc = ignite.managed().serviceProxy(name, CounterService.class, true);
+        CounterService svc = ignite.services().serviceProxy(name, CounterService.class, true);
 
         for (int i = 0; i < 10; i++)
             svc.increment();
@@ -94,9 +94,9 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         String name = "testMultiNodeProxy";
 
-        ignite.managed().deployNodeSingleton(name, new CounterServiceImpl());
+        ignite.services().deployNodeSingleton(name, new CounterServiceImpl());
 
-        CounterService svc = ignite.managed().serviceProxy(name, CounterService.class, false);
+        CounterService svc = ignite.services().serviceProxy(name, CounterService.class, false);
 
         for (int i = 0; i < extras; i++) {
             svc.increment();
@@ -116,12 +116,12 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
         Ignite ignite = randomGrid();
 
         // Deploy only on remote nodes.
-        ignite.managed(ignite.cluster().forRemotes()).deployNodeSingleton(name, new CounterServiceImpl());
+        ignite.services(ignite.cluster().forRemotes()).deployNodeSingleton(name, new CounterServiceImpl());
 
         info("Deployed service: " + name);
 
         // Get local proxy.
-        CounterService svc = ignite.managed().serviceProxy(name, CounterService.class, false);
+        CounterService svc = ignite.services().serviceProxy(name, CounterService.class, false);
 
         for (int i = 0; i < 10; i++)
             svc.increment();
@@ -132,7 +132,7 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         for (ClusterNode n : ignite.cluster().forRemotes().nodes()) {
             CounterService rmtSvc =
-                    ignite.managed(ignite.cluster().forNode(n)).serviceProxy(name, CounterService.class, false);
+                    ignite.services(ignite.cluster().forNode(n)).serviceProxy(name, CounterService.class, false);
 
             int cnt = rmtSvc.localIncrements();
 
@@ -154,10 +154,10 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
         Ignite ignite = randomGrid();
 
         // Deploy only on remote nodes.
-        ignite.managed(ignite.cluster().forRemotes()).deployNodeSingleton(name, new CounterServiceImpl());
+        ignite.services(ignite.cluster().forRemotes()).deployNodeSingleton(name, new CounterServiceImpl());
 
         // Get local proxy.
-        CounterService svc = ignite.managed().serviceProxy(name, CounterService.class, true);
+        CounterService svc = ignite.services().serviceProxy(name, CounterService.class, true);
 
         for (int i = 0; i < 10; i++)
             svc.increment();
@@ -168,7 +168,7 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         for (ClusterNode n : ignite.cluster().forRemotes().nodes()) {
             CounterService rmtSvc =
-                    ignite.managed(ignite.cluster().forNode(n)).serviceProxy(name, CounterService.class, false);
+                    ignite.services(ignite.cluster().forNode(n)).serviceProxy(name, CounterService.class, false);
 
             int cnt = rmtSvc.localIncrements();
 
@@ -188,18 +188,18 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         final Ignite ignite = grid(0);
 
-        ignite.managed(ignite.cluster().forLocal()).deployClusterSingleton(name, new MapServiceImpl<String, Integer>());
+        ignite.services(ignite.cluster().forLocal()).deployClusterSingleton(name, new MapServiceImpl<String, Integer>());
 
         for (int i = 1; i < nodeCount(); i++) {
-            MapService<Integer, String> svc =  grid(i).managed().serviceProxy(name, MapService.class, false);
+            MapService<Integer, String> svc =  grid(i).services().serviceProxy(name, MapService.class, false);
 
             // Make sure service is a proxy.
-            assertFalse(svc instanceof ManagedService);
+            assertFalse(svc instanceof Service);
 
             svc.put(i, Integer.toString(i));
         }
 
-        assertEquals(nodeCount() - 1, ignite.managed().serviceProxy(name, MapService.class, false).size());
+        assertEquals(nodeCount() - 1, ignite.services().serviceProxy(name, MapService.class, false).size());
     }
 
     /**
@@ -210,18 +210,18 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         final Ignite ignite = grid(0);
 
-        ignite.managed().deployNodeSingleton(name, new MapServiceImpl<String, Integer>());
+        ignite.services().deployNodeSingleton(name, new MapServiceImpl<String, Integer>());
 
         for (int i = 0; i < nodeCount(); i++) {
-            MapService<Integer, String> svc =  grid(i).managed().serviceProxy(name, MapService.class, false);
+            MapService<Integer, String> svc =  grid(i).services().serviceProxy(name, MapService.class, false);
 
             // Make sure service is a local instance.
-            assertTrue(svc instanceof ManagedService);
+            assertTrue(svc instanceof Service);
 
             svc.put(i, Integer.toString(i));
         }
 
-        MapService<Integer, String> map = ignite.managed().serviceProxy(name, MapService.class, false);
+        MapService<Integer, String> map = ignite.services().serviceProxy(name, MapService.class, false);
 
         for (int i = 0; i < nodeCount(); i++)
             assertEquals(1, map.size());
@@ -235,14 +235,14 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         final Ignite ignite = grid(0);
 
-        ignite.managed().deployNodeSingleton(name, new MapServiceImpl<String, Integer>());
+        ignite.services().deployNodeSingleton(name, new MapServiceImpl<String, Integer>());
 
         // Get remote proxy.
-        MapService<Integer, String> svc =  ignite.managed(ignite.cluster().forRemotes()).
+        MapService<Integer, String> svc =  ignite.services(ignite.cluster().forRemotes()).
             serviceProxy(name, MapService.class, false);
 
         // Make sure service is a local instance.
-        assertFalse(svc instanceof ManagedService);
+        assertFalse(svc instanceof Service);
 
         for (int i = 0; i < nodeCount(); i++)
             svc.put(i, Integer.toString(i));
@@ -250,11 +250,11 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
         int size = 0;
 
         for (ClusterNode n : ignite.cluster().forRemotes().nodes()) {
-            MapService<Integer, String> map = ignite.managed(ignite.cluster().forNode(n)).
+            MapService<Integer, String> map = ignite.services(ignite.cluster().forNode(n)).
                 serviceProxy(name, MapService.class, false);
 
             // Make sure service is a local instance.
-            assertFalse(map instanceof ManagedService);
+            assertFalse(map instanceof Service);
 
             size += map.size();
         }
@@ -270,14 +270,14 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
 
         final Ignite ignite = grid(0);
 
-        ignite.managed().deployNodeSingleton(name, new MapServiceImpl<String, Integer>());
+        ignite.services().deployNodeSingleton(name, new MapServiceImpl<String, Integer>());
 
         // Get remote proxy.
-        MapService<Integer, String> svc =  ignite.managed(ignite.cluster().forRemotes()).
+        MapService<Integer, String> svc =  ignite.services(ignite.cluster().forRemotes()).
             serviceProxy(name, MapService.class, true);
 
         // Make sure service is a local instance.
-        assertFalse(svc instanceof ManagedService);
+        assertFalse(svc instanceof Service);
 
         for (int i = 0; i < nodeCount(); i++)
             svc.put(i, Integer.toString(i));
@@ -285,11 +285,11 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
         int size = 0;
 
         for (ClusterNode n : ignite.cluster().forRemotes().nodes()) {
-            MapService<Integer, String> map = ignite.managed(ignite.cluster().forNode(n)).
+            MapService<Integer, String> map = ignite.services(ignite.cluster().forNode(n)).
                 serviceProxy(name, MapService.class, false);
 
             // Make sure service is a local instance.
-            assertFalse(map instanceof ManagedService);
+            assertFalse(map instanceof Service);
 
             if (map.size() != 0)
                 size += map.size();
@@ -335,7 +335,7 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
     /**
      * Cache service implementation.
      */
-    protected static class MapServiceImpl<K, V> implements MapService<K, V>, ManagedService {
+    protected static class MapServiceImpl<K, V> implements MapService<K, V>, Service {
         /** Underlying cache map. */
         private final Map<K, V> map = new ConcurrentHashMap<>();
 
@@ -359,17 +359,17 @@ public class GridServiceProcessorProxySelfTest extends GridServiceProcessorAbstr
         }
 
         /** {@inheritDoc} */
-        @Override public void cancel(ManagedServiceContext ctx) {
+        @Override public void cancel(ServiceContext ctx) {
             X.println("Stopping cache service: " + ctx.name());
         }
 
         /** {@inheritDoc} */
-        @Override public void init(ManagedServiceContext ctx) throws Exception {
+        @Override public void init(ServiceContext ctx) throws Exception {
             X.println("Initializing counter service: " + ctx.name());
         }
 
         /** {@inheritDoc} */
-        @Override public void execute(ManagedServiceContext ctx) throws Exception {
+        @Override public void execute(ServiceContext ctx) throws Exception {
             X.println("Executing cache service: " + ctx.name());
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorSingleNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorSingleNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorSingleNodeSelfTest.java
index 0e25c14..645f1cd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorSingleNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorSingleNodeSelfTest.java
@@ -38,12 +38,12 @@ public class GridServiceProcessorSingleNodeSelfTest extends GridServiceProcessor
         Ignite ignite = randomGrid();
 
         // Deploy only on remote nodes.
-        ignite.managed(ignite.cluster().forRemotes()).deployNodeSingleton(name, new CounterServiceImpl());
+        ignite.services(ignite.cluster().forRemotes()).deployNodeSingleton(name, new CounterServiceImpl());
 
         info("Deployed service: " + name);
 
         // Get local proxy.
-        CounterService svc = ignite.managed().serviceProxy(name, CounterService.class, false);
+        CounterService svc = ignite.services().serviceProxy(name, CounterService.class, false);
 
         try {
             svc.increment();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java
index 7f2f0ce..09bf964 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceReassignmentSelfTest.java
@@ -67,7 +67,7 @@ public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstrac
      * @throws Exception If failed.
      */
     private CounterService proxy(Ignite g) throws Exception {
-        return g.managed().serviceProxy("testService", CounterService.class, false);
+        return g.services().serviceProxy("testService", CounterService.class, false);
     }
 
     /**
@@ -80,7 +80,7 @@ public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstrac
 
         DummyService.exeLatch("testService", latch);
 
-        grid(0).managed().deployMultiple("testService", new CounterServiceImpl(), total, maxPerNode);
+        grid(0).services().deployMultiple("testService", new CounterServiceImpl(), total, maxPerNode);
 
         for (int i = 0; i < 10; i++)
             proxy(randomGrid()).increment();
@@ -128,7 +128,7 @@ public class GridServiceReassignmentSelfTest extends GridServiceProcessorAbstrac
             }
         }
         finally {
-            grid(F.first(startedGrids)).managed().cancel("testService");
+            grid(F.first(startedGrids)).services().cancel("testService");
 
             stopAllGrids();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/marshaller/GridMarshallerAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/marshaller/GridMarshallerAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/marshaller/GridMarshallerAbstractTest.java
index 3708ab5..cd294b4 100644
--- a/modules/core/src/test/java/org/apache/ignite/marshaller/GridMarshallerAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/marshaller/GridMarshallerAbstractTest.java
@@ -772,7 +772,7 @@ public abstract class GridMarshallerAbstractTest extends GridCommonAbstractTest
         IgniteConfiguration cfg = optimize(getConfiguration("g1"));
 
         try (Ignite g1 = G.start(cfg)) {
-            IgniteManaged services = grid().managed(grid().forNode(g1.cluster().localNode()));
+            IgniteServices services = grid().services(grid().forNode(g1.cluster().localNode()));
 
             services.deployNodeSingleton("test", new DummyService());
 
@@ -785,14 +785,14 @@ public abstract class GridMarshallerAbstractTest extends GridCommonAbstractTest
             assert inBean.getObjectField() != null;
             assert outBean.getObjectField() != null;
 
-            assert inBean.getObjectField().getClass().equals(IgniteManagedImpl.class);
-            assert outBean.getObjectField().getClass().equals(IgniteManagedImpl.class);
+            assert inBean.getObjectField().getClass().equals(IgniteServicesImpl.class);
+            assert outBean.getObjectField().getClass().equals(IgniteServicesImpl.class);
 
             assert inBean != outBean;
             assert inBean.equals(outBean);
 
             ClusterGroup inPrj = services.clusterGroup();
-            ClusterGroup outPrj = ((IgniteManaged)outBean.getObjectField()).clusterGroup();
+            ClusterGroup outPrj = ((IgniteServices)outBean.getObjectField()).clusterGroup();
 
             assert inPrj.getClass().equals(outPrj.getClass());
             assert F.eqNotOrdered(inPrj.nodes(), outPrj.nodes());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
index 9297995..f3d222e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
@@ -100,7 +100,7 @@ public class IgniteMock implements Ignite {
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteCompute compute(ClusterGroup prj) {
+    @Override public IgniteCompute compute(ClusterGroup grp) {
         return null;
     }
 
@@ -120,17 +120,17 @@ public class IgniteMock implements Ignite {
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteEvents events(ClusterGroup prj) {
+    @Override public IgniteEvents events(ClusterGroup grp) {
         return null;
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteManaged managed() {
+    @Override public IgniteServices services() {
         return null;
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteManaged managed(ClusterGroup prj) {
+    @Override public IgniteServices services(ClusterGroup grp) {
         return null;
     }
 
@@ -140,7 +140,7 @@ public class IgniteMock implements Ignite {
     }
 
     /** {@inheritDoc} */
-    @Override public ExecutorService executorService(ClusterGroup prj) {
+    @Override public ExecutorService executorService(ClusterGroup grp) {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
index e876747..d19f063 100644
--- a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
+++ b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
@@ -158,10 +158,10 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteManaged managed() {
+    @Override public IgniteServices services() {
         assert g != null;
 
-        return g.managed();
+        return g.services();
     }
 
     /** {@inheritDoc} */
@@ -193,10 +193,10 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteCompute compute(ClusterGroup prj) {
+    @Override public IgniteCompute compute(ClusterGroup grp) {
         assert g != null;
 
-        return g.compute(prj);
+        return g.compute(grp);
     }
 
     /** {@inheritDoc} */
@@ -207,24 +207,24 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteEvents events(ClusterGroup prj) {
+    @Override public IgniteEvents events(ClusterGroup grp) {
         assert g != null;
 
-        return g.events(prj);
+        return g.events(grp);
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteManaged managed(ClusterGroup prj) {
+    @Override public IgniteServices services(ClusterGroup grp) {
         assert g != null;
 
-        return g.managed(prj);
+        return g.services(grp);
     }
 
     /** {@inheritDoc} */
-    @Override public ExecutorService executorService(ClusterGroup prj) {
+    @Override public ExecutorService executorService(ClusterGroup grp) {
         assert g != null;
 
-        return g.executorService(prj);
+        return g.executorService(grp);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
index 62b7f60..7134b56 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.resource;
 
 import org.apache.ignite.*;
 import org.apache.ignite.lang.*;
-import org.apache.ignite.managed.*;
+import org.apache.ignite.services.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.testframework.junits.common.*;
 
@@ -45,8 +45,8 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
         startGrid(0);
         startGrid(1);
 
-        grid(0).managed().deployNodeSingleton(SERVICE_NAME1, new DummyServiceImpl());
-        grid(0).managed(grid(0).cluster().forLocal()).deployClusterSingleton(SERVICE_NAME2, new DummyServiceImpl());
+        grid(0).services().deployNodeSingleton(SERVICE_NAME1, new DummyServiceImpl());
+        grid(0).services(grid(0).cluster().forLocal()).deployClusterSingleton(SERVICE_NAME2, new DummyServiceImpl());
 
         assertEquals(2, grid(0).nodes().size());
         assertEquals(2, grid(1).nodes().size());
@@ -69,7 +69,7 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
 
             @Override public Object call() throws Exception {
                 assertNotNull(svc);
-                assertTrue(svc instanceof ManagedService);
+                assertTrue(svc instanceof Service);
 
                 svc.noop();
 
@@ -90,7 +90,7 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
                 assertNotNull(svc);
 
                 // Ensure proxy instance.
-                assertFalse(svc instanceof ManagedService);
+                assertFalse(svc instanceof Service);
 
                 svc.noop();
 
@@ -111,7 +111,7 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
                 assertNotNull(svc);
 
                 // Ensure proxy instance.
-                assertTrue(svc instanceof ManagedService);
+                assertTrue(svc instanceof Service);
 
                 svc.noop();
 
@@ -154,7 +154,7 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
             private void service(DummyService svc) {
                 assertNotNull(svc);
 
-                assertTrue(svc instanceof ManagedService);
+                assertTrue(svc instanceof Service);
 
                 this.svc = svc;
             }
@@ -179,7 +179,7 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
                 assertNotNull(svc);
 
                 // Ensure proxy instance.
-                assertFalse(svc instanceof ManagedService);
+                assertFalse(svc instanceof Service);
 
                 this.svc = svc;
             }
@@ -204,7 +204,7 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
                 assertNotNull(svc);
 
                 // Ensure proxy instance.
-                assertTrue(svc instanceof ManagedService);
+                assertTrue(svc instanceof Service);
 
                 this.svc = svc;
             }
@@ -282,7 +282,7 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
     /**
      * No-op test service.
      */
-    public static class DummyServiceImpl implements DummyService, ManagedService {
+    public static class DummyServiceImpl implements DummyService, Service {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -292,17 +292,17 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest impleme
         }
 
         /** {@inheritDoc} */
-        @Override public void cancel(ManagedServiceContext ctx) {
+        @Override public void cancel(ServiceContext ctx) {
             System.out.println("Cancelling service: " + ctx.name());
         }
 
         /** {@inheritDoc} */
-        @Override public void init(ManagedServiceContext ctx) throws Exception {
+        @Override public void init(ServiceContext ctx) throws Exception {
             System.out.println("Initializing service: " + ctx.name());
         }
 
         /** {@inheritDoc} */
-        @Override public void execute(ManagedServiceContext ctx) {
+        @Override public void execute(ServiceContext ctx) {
             System.out.println("Executing service: " + ctx.name());
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9200ef5e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3980367..15c22ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -651,7 +651,7 @@
                                         </group>
                                         <group>
                                             <title>Distributed Services APIs</title>
-                                            <packages>org.apache.ignite.managed</packages>
+                                            <packages>org.apache.ignite.services</packages>
                                         </group>
                                         <group>
                                             <title>MXBeans classes</title>
@@ -861,7 +861,7 @@
                                         </group>
                                         <group>
                                             <title>Distributed Services APIs</title>
-                                            <packages>org.apache.ignite.managed</packages>
+                                            <packages>org.apache.ignite.services</packages>
                                         </group>
                                         <group>
                                             <title>JDBC Driver</title>


Mime
View raw message