PART - Pervasive Applications RunTime


This page describes how to install the PART binary distribution and how to run the various sample and tools applications.

Installing PART binary distributions

Get the latest binary distribution from the PART download page and unpack the file contents to a directory of your choice. This will create a directory tree with a root directory named partVersion, where Version is the PART version number, e.g., 1.2. In the text below, we have assumed that the PART version is 1.2 and the top directory name thus is part1.2.

The main contents of the binary distribution are precompiled PART jar files for various platforms, listed in the table below. These files are intended to be used when developing Java applications that use the PART library, and can be copied as needed to relevant development directories of any Java project.

File Location Description
part_j2se.jar part1.2/java/dist/j2se PART jar file that can be used when developing applications for J2SE platforms. Has been compiled using the Java SE SDK 1.4 compiler
part_j2me.jar part1.2/java/dist/j2me PART jar file that can be used when developing applications for J2ME platforms
part_tini.jar part1.2/java/dist/tini PART jar file that can be used when developing applications for the TINI microcontroller
part_snap.jar part1.2/java/dist/snap PART jar file that can be used when developing applications for the SNAP platforms.

The binary distribution also contains a number of sample application Jar files. These applications can be used to quickly test that PART works on the target platform, and for instance that the PART communication between different devices seems to work. There is also a tool, the PART Object Browser, included in the distribution. This page describes how this tool can be used to browse and manipulate distributed objects in a PART session.

The sections below will describe how to run these files on various platforms.

Running J2SE sample applications

The jar files for the sample J2SE applications are located in the part1.2/java/dist/j2se/test directory. For each such jar file, there is also a bat (.bat) file in the part1.2/java/dist/j2se/test/run_win32 directory and a shell script (.sh) file in the part1.2/java/dist/j2se/test/run_unix directory. These files (.bat and .sh) can be used to run the corresponding applications under Windows or Linux, either directly from the command line or by clicking on the file icon in a visual file browser application (e.g., a Windows Explorer window).

For instance, to start the ConnectionServer sample application on a Linux platform, do:

>cd part1.2/java/dist/j2se/test/run_unix
>./ConnectionServer.sh


The table below describes the available J2SE sample applications.

Name Description
ConnectionServer.jar
StartConnectionServer.[bat/sh]
  • An application that starts to listen for incoming PART Tcp connections on a particular port
  • The port number can be given from the command line (e.g, 'ConnectionServer.bat portnr')
  • If no port is specified, the application will listen to port 4321.
  • The source code file for this application is part1.2/java/src/test-j2se/org/iperg/part/core/test/j2se/ConnectionServerTest.java
ConnectionClient.jar
StartConnectionClient.[bat/sh]
  • An application that tries to set up a PART Tcp connection to a particular port on a particular host
  • The port number and host name can be given from the command line (e.g., 'ConnectionClient.bat hostname portnr')
  • If no arguments are given, the application will try to connect to port 4321 on the local machine
  • The source code file for this application is part1.2/java/src/test-j2se/org/iperg/part/core/test/j2se/ConnectionClientTest.java
ObjectServer.jar
StartObjectServer.[bat/sh]
  • An application that starts to listen for incoming PART Tcp connections on a particular port
  • The port number can be given from the command line (e.g., 'ObjectServer.bat portnr')
  • If no port is specified, the application will listen to port 4321
  • When a client connects, the server will search for, replicate and subscribe to all distributed objects held by the client
  • The source code file for this application is part1.2/java/src/test-j2se/org/iperg/part/core/test/j2se/ObjectServerTest.java
ObjectClient.jar
StartObjectClient.[bat/sh]
  • An application that tries to set up a PART Tcp connection to a particular port on a particular host
  • The port number and host name can be given from the command line (e.g., 'ObjectClient.bat hostname portnr')
  • If no arguments are given, the application will try to connect to port 4321 on the local machine
  • The client will also create a distributed object and continuously update its properties.
  • The source code file for this application is part1.2/java/src/test-j2se/org/iperg/part/core/test/j2se/ObjectClientTest.java


Running J2ME sample applications

The jar and jad files for the sample J2ME application midlets are located in the part1.2/java/dist/j2me/test directory. However, in order for the midlets to be run, they need to be installed on a mobile phone. This can be done in several ways:
  • Over the air - Requires that the sample midlet jar or jad file (or both) is made accessible (linked) from a web page. Once this has been achieved, the phone's web browser can be directed to this page, and by selecting the link to the jar or jad file, the midlet will be transferred to your phone. Note that the exact details concerning this procedure depends on the phone model. 
  • From a computer, for instance via a USB cable or Bluetooth. Requires some software on the computer side that can install midlets on a connected phone. This can for instance be achieved using the Sony Ericsson SDK for the ME platform. 
Once a same applications has been installed on the phone, use the phones meny system or GUI to locate and start the midlet.

The table below describes the available J2ME sample applications.

Name Description
ConnectionClient.[jad/jar]
  • An application that tries to set up a PART Tcp connection to a particular port on a particular host
  • The application will ask for the host name and port number when started
  • Once this information has been entered, press the Connect button in order to initiate the connection
  • This application is unsigned, so it will cause the phone to ask or permission to set up the connection and send data
  • The source code file for this application is part1.2/java/src/test-j2me/org/iperg/part/core/test/j2me/ConnectionClientTest.java and 
    part1.2/java/src/test-j2me/org/iperg/part/core/test/j2me/ConfigForm.java 


Running TINI sample applications

The sample applications for the TINI microcontroller are located in the part1.2/java/dist/tini/test directory. All such files have extensions ending with .tini. In order to run the applications, they first need to be downloaded to a microcontroller board. This can be done using FTP from your computer or from the TINI.

To start a sample application on a TINI platform, log on to the TINI using JavKit or telnet from a computer, and then change directory to the one where you downloaded the .tini file(s). The application can then be started using the java shell command, for example:

>cd install_dir
>java ConnectionServer.tini


Command line parameters can be after the .tini argument:

>java ConnectionServer.tini 1111

The table below describes the available TINI sample applications.

Name Description
ConnectionServer.tini
  • An application that starts to listen for incoming PART Tcp connections on a particular port
  • The port number can be given from the command line ('java ConnectionServer.tini portnr')
  • If no port is specified, the application will listen to port 4321
  • The source code file for this application is part1.2/java/src/test-tini/org/iperg/part/core/test/tini/ConnectionServerTest.java
ConnectionClient.tini
  • An application that tries to set up a PART Tcp connection to a particular port on a particular host
  • The port number and host name can be given from the command line ('java ConnectionClient.tini hostname portnr'
  • If no arguments are given, the application will try to connect to port 4321 on the local TINI device
  • The source code file for this application is part1.2/java/src/test-tini/org/iperg/part/core/test/tini/ConnectionClientTest.java


Running SNAP sample applications

The sample application jar files for the SNAP platform are located in the part1.2/java/dist/snap/test directory. For each such jar file, there is also a shell script (.sh) file in the part1.2/java/dist/snap/test/run directory, which can be used to start the corresponding application, as described below. However, first you need to download these (.jar and .sh) files to the SNAP platform. This can be done at least in two different ways:
  • Using the SnapDev application from a computer. SnapDev is part of the SNAP firmware distribution from Imsys (download instructions can be found here). This requires that the SNAP board is connected to the computer via a serial cable. 
    • Start SnapDev (snapdev.exe located in the bin directory of the firmware distribution).
    • Open a connection to the SNAP using the Open Port entry in the File menu. Note that you might have to change the port and baud rate using the Settings entry in the File menu for this to work. 
    • Log on to the SNAP
    • At the SnapDev command promt, type recv to open a file browser window on the computer.
    • Select the file you want to transfer to the SNAP 
    • Repeat if more files need to be transferred
  • Using ordinary FTP. This requires that you can log on to the SNAP over the network. 
To start a sample application on a SNAP platform, log on to the SNAP using SnapDev or telnet from a computer, and then change directory to the one where the .jar and .sh files were downloaded. The application can then be started using the source shell command, for example:

>cd install_dir
>source ConnectionClient.sh

The table below describes the available SNAP sample applications.

Name Description
ConnectionServer.jar
StartConnectionServer.sh
  • An application that starts to listen for incoming PART Tcp connections on a particular port
  • By default, port 4321 is used
  • To use another port, edit the file part1.2/java/dist/snap/test/run/ConnectionServer.sh
  • The source code file for this application is part1.2/java/src/test-snap/org/iperg/part/core/test/snap/ConnectionServerTest.java
ConnectionClient.jar
StartConnectionClient.sh
  • An application that tries to set up a PART Tcp connection to a particular port on a particular host
  • By default, host localhost and port 4321 are used
  • To use another host and/or port, edit the file part1.2/java/dist/snap/test/run/ConnectionClient.sh
  • The source code file for this application is part1.2/java/src/test-snap/org/iperg/part/core/test/snap/ConnectionClientTest.java

gtheme by Chris M