Skip to content
Permalink
Browse files

implemented issue JPPF-566

  • Loading branch information...
lolocohen committed Dec 9, 2018
1 parent 7534c70 commit 3fe278eac4280465d85df60fd3e3d867fc7bd566
Binary file not shown.
@@ -145,7 +145,7 @@ public void run() {
if (!isStopped()) reset(true);
throw new JPPFError(e);
} catch(final IOException e) {
if (!getShuttingDown().get()) log.error(e.getMessage(), e);
if (!getShuttingDown().get() && !isStopped()) log.error(e.getMessage(), e);
if (checkConnection) connectionChecker.stop();
if (!isStopped()) {
reset(true);
@@ -8,6 +8,7 @@
<classpathentry kind="src" output="CustomMBeans/classes" path="CustomMBeans/src"/>
<classpathentry kind="src" output="DataDependency/classes" path="DataDependency/src"/>
<classpathentry kind="src" output="DataEncryption/classes" path="DataEncryption/src"/>
<classpathentry kind="src" output="EmbeddedGrid/classes" path="EmbeddedGrid/src"/>
<classpathentry kind="src" output="ExtendedClassLoading/classes" path="ExtendedClassLoading/src"/>
<classpathentry kind="src" output="ExtendedClassLoading/classes2" path="ExtendedClassLoading/src2"/>
<classpathentry kind="src" output="ForkJoinNodeExecutor/classes" path="ForkJoinNodeExecutor/src"/>
@@ -73,5 +74,7 @@
<classpathentry kind="lib" path="KryoSerializer/lib/kryo-serializers-0.42.jar"/>
<classpathentry kind="lib" path="KryoSerializer/lib/kryo-shaded-4.0.2.jar" sourcepath="C:/Users/lcohen/AppData/Local/Temp/.org.sf.feeling.decompiler1540100587978/source/kryo-shaded-4.0.2-sources.jar"/>
<classpathentry kind="lib" path="KryoSerializer/lib/objenesis-2.1.jar" sourcepath="C:/Users/lcohen/AppData/Local/Temp/.org.sf.feeling.decompiler1540100587978/source/objenesis-2.1-sources.jar"/>
<classpathentry kind="lib" path="shared/lib/jppf-node-6.1-alpha.jar"/>
<classpathentry kind="lib" path="shared/lib/jppf-server-6.1-alpha.jar"/>
<classpathentry kind="output" path="JobRecovery/classes"/>
</classpath>
@@ -0,0 +1 @@
/classes/
@@ -0,0 +1,73 @@
$template{name="sample-readme-html-header" title="Embedded Grid demo"}$
<h3>What does the sample do?</h3>
This sample demonstrates how to start and use an embedded JPPF <a href="https://www.jppf.org/doc/6.1/index.php?title=Embedded_driver_and_node#Embedded_driver">driver</a> and
<a href="https://www.jppf.org/doc/6.1/index.php?title=Embedded_driver_and_node#Embedded_node">node</a> programmatically, in the same JVM as the client.

<h3>How do I run it?</h3>
From a command prompt, type the following:
<ul class="samplesList">
<li>On a Linux/Unix/MacOS system: <b>./run.sh</b></li>
<li>On a Windows system: <b>run.bat</b></li>
</ul>

<p>The demo produces an output put that looks like this, where messages from the demo itself are prefixed with `>>>`:
<pre class="samples" style="white-space: pre-wrap">
>>> starting the JPPF driver
driver process id: 4444, uuid: 2C901290-ADAA-4D96-8B73-224B8594DB2B
ClientClassServer initialized
NodeClassServer initialized
ClientJobServer initialized
NodeJobServer initialized
management initialized and listening on port 11111
Acceptor initialized
- accepting plain connections on port 11111
JPPF Driver initialization complete
>>> starting the JPPF node
>>> starting the JPPF client
client process id: 4444, uuid: B6CDC36A-F4CA-4D1B-A693-396E926A3F93
node process id: 4444, uuid: 1624196C-E0CB-4FD0-8A90-78C9FE1BA6DC
[client: driver1-1 - ClassServer] Attempting connection to the class server at localhost:11111
[client: driver1-1 - ClassServer] Reconnected to the class server
[client: driver1-1 - TasksServer] Attempting connection to the task server at localhost:11111
[client: driver1-1 - TasksServer] Reconnected to the JPPF task server
>>> client connected, now submitting a job
Attempting connection to the class server at 192.168.1.24:11111
RemoteClassLoaderConnection: Reconnected to the class server
JPPF Node management initialized on port 11111
Attempting connection to the node server at 192.168.1.24:11111
Reconnected to the node server
Node successfully initialized
Hello! from the node
>>> execution result for job 'embedded grid': Hello!
>>> connecting to local driver JMX server
>>> nb nodes in server: 1
>>> connecting to local node JMX server
>>> node state: JPPFNodeState[threadPoolSize=8, threadPriority=5, nbTasksExecuted=1, executionStatus=IDLE, connectionStatus=CONNECTED, cpuTime=0, pendingAction=NONE]
>>> shutting down node
>>> nb nodes in server: 0
>>> shutting down driver
>>> done, exiting program
</pre>

<h3>Demo source code</h3>
<ul class="samplesList">
<li><a href="src/org/jppf/example/embedded/EmbeddedGrid.java.html">EmbeddedGrid.java</a>: fully commented source code for this demo</li>
</ul>

<h3>Documentation references</h3>
<ul class="samplesList">
<li><a href="https://www.jppf.org/doc/6.1/index.php?title=Embedded_driver_and_node">Embedded driver and node</a></li>
<li><a href="https://www.jppf.org/doc/6.1/index.php?title=The_JPPF_configuration_API">The JPPF configuration API</a></li>
</ul>

<h3>How can I build the sample?</h3>
To compile the source code, from a command prompt, type: <b>&quot;ant compile&quot;</b><br>
To generate the Javadoc, from a command prompt, type: <b>&quot;ant javadoc&quot;</b>

<h3>I have additional questions and comments, where can I go?</h3>
<p>There are 2 privileged places you can go to:
<ul>
<li><a href="https://www.jppf.org/forums">The JPPF Forums</a></li>
<li><a href="https://www.jppf.org/doc/6.1">The JPPF documentation</a></li>
</ul>
$template{name="sample-readme-html-footer"}$
@@ -0,0 +1,74 @@
# Embedded Grid demo

<h3>What does the sample do?</h3>
This sample demonstrates how to start and use an embedded JPPF <a href="https://www.jppf.org/doc/6.1/index.php?title=Embedded_driver_and_node#Embedded_driver">driver</a> and
<a href="https://www.jppf.org/doc/6.1/index.php?title=Embedded_driver_and_node#Embedded_node">node</a> programmatically, in the same JVM as the client.

<h3>How do I run it?</h3>
From a command prompt, type the following:
<ul class="samplesList">
<li>On a Linux/Unix/MacOS system: <b>./run.sh</b></li>
<li>On a Windows system: <b>run.bat</b></li>
</ul>

<p>The demo produces an output put that looks like this, where messages from the demo itself are prefixed with `>>>`:
<pre class="samples" style="white-space: pre-wrap">
>>> starting the JPPF driver
driver process id: 4444, uuid: 2C901290-ADAA-4D96-8B73-224B8594DB2B
ClientClassServer initialized
NodeClassServer initialized
ClientJobServer initialized
NodeJobServer initialized
management initialized and listening on port 11111
Acceptor initialized
- accepting plain connections on port 11111
JPPF Driver initialization complete
>>> starting the JPPF node
>>> starting the JPPF client
client process id: 4444, uuid: B6CDC36A-F4CA-4D1B-A693-396E926A3F93
node process id: 4444, uuid: 1624196C-E0CB-4FD0-8A90-78C9FE1BA6DC
[client: driver1-1 - ClassServer] Attempting connection to the class server at localhost:11111
[client: driver1-1 - ClassServer] Reconnected to the class server
[client: driver1-1 - TasksServer] Attempting connection to the task server at localhost:11111
[client: driver1-1 - TasksServer] Reconnected to the JPPF task server
>>> client connected, now submitting a job
Attempting connection to the class server at 192.168.1.24:11111
RemoteClassLoaderConnection: Reconnected to the class server
JPPF Node management initialized on port 11111
Attempting connection to the node server at 192.168.1.24:11111
Reconnected to the node server
Node successfully initialized
Hello! from the node
>>> execution result for job 'embedded grid': Hello!
>>> connecting to local driver JMX server
>>> nb nodes in server: 1
>>> connecting to local node JMX server
>>> node state: JPPFNodeState[threadPoolSize=8, threadPriority=5, nbTasksExecuted=1, executionStatus=IDLE, connectionStatus=CONNECTED, cpuTime=0, pendingAction=NONE]
>>> shutting down node
>>> nb nodes in server: 0
>>> shutting down driver
>>> done, exiting program
</pre>
<h3>Demo source code</h3>
<ul class="samplesList">
<li><a href="src/org/jppf/example/embedded/EmbeddedGrid.java">EmbeddedGrid.java</a>: fully commented source code for this demo</li>
</ul>

<h3>Documentation references</h3>
<ul class="samplesList">
<li><a href="https://www.jppf.org/doc/6.1/index.php?title=Embedded_driver_and_node">Embedded driver and node</a></li>
<li><a href="https://www.jppf.org/doc/6.1/index.php?title=The_JPPF_configuration_API">The JPPF configuration API</a></li>
</ul>

<h3>How can I build the sample?</h3>
To compile the source code, from a command prompt, type: <b>&quot;ant compile&quot;</b><br>
To generate the Javadoc, from a command prompt, type: <b>&quot;ant javadoc&quot;</b>

<h3>I have additional questions and comments, where can I go?</h3>
<p>There are 2 privileged places you can go to:
<ul>
<li><a href="https://www.jppf.org/forums">The JPPF Forums</a></li>
<li><a href="https://www.jppf.org/doc/6.1">The JPPF documentation</a></li>
</ul>

@@ -0,0 +1,130 @@
<!--
JPPF
Copyright (C) 2005-2018 JPPF Team.
https://www.jppf.org
Licensed 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
https://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.
-->

<project name='EmbeddedGrid' basedir="." default="run">

<!-- ========================================================================= -->
<!-- Property definitions -->
<!-- ========================================================================= -->

<property name="shared" value="${basedir}/../shared"/>
<property name="shared.lib" value="${shared}/lib"/>
<property name="shared.img" value="${shared}/images"/>
<property name="config.dir" value="${basedir}/config"/>
<property name="classes.dir" value="${basedir}/classes"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="javadoc" value="${basedir}/javadoc"/>

<!-- ========================================================================= -->
<!-- Classpath definitions -->
<!-- ========================================================================= -->

<path id="project.classpath">
<pathelement location="${classes.dir}"/>
<pathelement location="${config.dir}"/>
<fileset dir="${shared.lib}">
<include name="**/*.jar"/>
</fileset>
</path>

<path id="javadoc.classpath">
<pathelement location="${shared.img}"/>
<path refid="project.classpath"/>
</path>

<!-- ========================================================================= -->
<!-- Clean -->
<!-- ========================================================================= -->

<target name="clean">
<delete dir="${classes.dir}" quiet="true"/>
</target>

<!-- ========================================================================= -->
<!-- Init -->
<!-- ========================================================================= -->

<target name="init">
<mkdir dir="${classes.dir}"/>
</target>

<!-- ========================================================================= -->
<!-- Compile -->
<!-- ========================================================================= -->

<target name="compile" depends="clean, init">
<javac srcdir="" destdir="${classes.dir}"
debug="on" deprecation="off" optimize="on" includes="**/*.java">
<classpath refid="project.classpath"/>
<compilerarg line="-Xlint:unchecked"/>
<src path="${src.dir}"/>
</javac>
<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
<exclude name="**/package.html"/>
</fileset>
</copy>
</target>

<!-- ========================================================================= -->
<!-- Run the sample application -->
<!-- ========================================================================= -->

<target name="run" description="run the demo">
<echo message="starting the Embedded Grid application"/>
<java fork="yes" classname="org.jppf.example.embedded.EmbeddedGrid" classpathref="project.classpath">
<jvmarg value="-Xmx512m"/>
<jvmarg value="-Dlog4j.configuration=log4j.properties"/>
</java>
</target>

<!-- ========================================================================= -->
<!-- Generate the Javadoc -->
<!-- ========================================================================= -->

<target name="javadoc" description="generate the javadoc">
<delete dir="${javadoc}" quiet="true"/>
<mkdir dir="${javadoc}"/>
<javadoc destdir="${javadoc}" access="private" Windowtitle="JPPF"
packagenames="**/*.*" classpathref="javadoc.classpath" verbose="false" use="true"
stylesheetfile="${shared.img}/javadoc.css" additionalparam="-quiet">
<packageset dir="${src.dir}"/>
<link href="https://docs.oracle.com/javase/8/docs/api"/>
<link href="https://www.jppf.org/api"/>
<doctitle><![CDATA[JPPF - Matrix Multiplication Sample]]></doctitle>
<header>
<![CDATA[
<table><tr><td valign="center">
<a href="https://www.jppf.org" target="_top">
<img src="https://www.jppf.org/images/jppf_group_large.gif" border="0"/>
</a>
</td></tr></table>
]]>
</header>
<bottom>
<![CDATA[
<font face="Arial" size=2 color="#6D78B6"><i>Copyright &copy; 2005-2018 JPPF Team.</i></font>
]]>
</bottom>
</javadoc>
<copy todir="${javadoc}/resources" overwrite="true">
<fileset dir="${shared.img}" includes="inherit.gif"/>
</copy>
</target>

</project>
@@ -0,0 +1,39 @@
#------------------------------------------------------------------------------#
# JPPF #
# Copyright (C) 2005-2018 JPPF Team. #
# http://www.jppf.org #
# #
# Licensed 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. #
#------------------------------------------------------------------------------#

### direct log messages to stdout ###
#log4j.appender.stdout=org.apache.log4j.ConsoleAppender
#log4j.appender.stdout.Target=System.out
#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

### direct messages to file jppf-client.log ###
log4j.appender.JPPF=org.apache.log4j.FileAppender
log4j.appender.JPPF.File=jppf.log
log4j.appender.JPPF.Append=false
log4j.appender.JPPF.layout=org.apache.log4j.PatternLayout
#log4j.appender.JPPF.layout.ConversionPattern=%d{ABSOLUTE} [%-5p][%c.%M(%L)]: %m\n
log4j.appender.JPPF.layout.ConversionPattern=%d [%-5p][%c.%M(%L)]: %m\n

### set log levels - for more verbose logging change 'info' to 'debug' ###

log4j.rootLogger=INFO, JPPF
#log4j.rootLogger=DEBUG, JPPF

#log4j.logger.org.jppf.client=DEBUG
#log4j.logger.org.jppf.common.socket=DEBUG
@@ -0,0 +1,2 @@
@echo off
call java -cp config;classes;../shared/lib/* -Xmx512m -Dlog4j.configuration=log4j.properties org.jppf.example.embedded.EmbeddedGrid
@@ -0,0 +1,3 @@
#! /bin/sh

java -cp config:classes:../shared/lib/* -Xmx512m -Dlog4j.configuration=log4j.properties org.jppf.example.embedded.EmbeddedGrid

0 comments on commit 3fe278e

Please sign in to comment.
You can’t perform that action at this time.