Class DeploymentExample


  • public final class DeploymentExample
    extends java.lang.Object
    Demonstrates how to explicitly deploy a task. Note that it is very rare when you would need such functionality as tasks are auto-deployed on demand first time you execute them. So in most cases you would just apply any of the Ignite.execute(...) methods directly. However, sometimes a task is not in local class path, so you may not even know the code it will execute, but you still need to execute it. For example, you have two independent components in the system, and one loads the task classes from some external source and deploys it; then another component can execute it just knowing the name of the task.

    Also note that for simplicity of the example, the task we execute is in system classpath, so even in this case the deployment step is unnecessary.

    Remote nodes should always be started with special configuration file which enables P2P class loading: 'ignite.{sh|bat} examples/config/example-ignite.xml'.

    Alternatively you can run ExampleNodeStartup in another JVM which will start node with examples/config/example-ignite.xml configuration.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  DeploymentExample.ExampleTask
      Example task used to demonstrate direct task deployment through API.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      Executes example.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeploymentExample

        public DeploymentExample()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Executes example.
        Parameters:
        args - Command line arguments, none required.
        Throws:
        java.lang.Exception - If example execution failed.