Class DeploymentExample
- java.lang.Object
-
- org.apache.ignite.examples.misc.deployment.DeploymentExample
-
public final class DeploymentExample extends java.lang.ObjectDemonstrates 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 theIgnite.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
ExampleNodeStartupin another JVM which will start node withexamples/config/example-ignite.xmlconfiguration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeploymentExample.ExampleTaskExample task used to demonstrate direct task deployment through API.
-
Constructor Summary
Constructors Constructor Description DeploymentExample()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)Executes example.
-