Common Classes Library
Introduction
This sample includes a set of common classes that are used by the configuration applet and
other samples. These common classes are all built and stored in a single jar file (common.jar).
This jar file has classes for connecting and communicating with an ME device server, finding
application resources and configuration settings, error logging, etc...
These classes are offered for demonstration purposes so users may learn how to
create custom java applications that configure and control the device server.
Please be aware that this is sample code that is provided AS-IS. There is no written or
expressed warantee or support for this code. Feel free to examine and extend the code to your liking but
understand that future releases of this code may changed without notice.
How To Build
This sample has been written and tested with the J2SE 1.4.2 SDK and can be built
using Apache Ant 1.5.3. These can be downloaded from the following locations:
To build this sample
-
Open a command prompt.
-
Go to the common directory.
-
Execute the build.bat file, specifying the target 'all' (e.g. build all)
Two environment variables are required to build the sample: JAVA_HOME and ANT_HOME. The default values
for these are C:\j2sdk1.4.2 and C:\apache-ant-1.5.3-1, respectively. If you install Java
or Ant into different directories you will need to set these environment variables appropriately.
Output of the build
The build creates 2 subdirectories: build and dist. The build
subdirectory contains the all the generated class files, javadoc files, jar
files, etc. The dist subdirectory is intended to be used as a self-contained
distribution of the common.jar library file.
How To Run
This sample does not produce a runnable application, rather it builds a library of
common code that can be used by other applications. Therefore, this sample is
typcially built when function of the common library is changed or enhanced. Once the
common.jar is updated, it must be placed in a location where the applications using
it can find it. If the using application is an applet, the config.jar should be placed
in the same location as the applet.
This sample can be run as an applet or an application. When run as an applet the
configapp resides on the device and is downloaded and run from within a browser
on your PC. When run as an application the configapp resides on your PC and
is executed from there.
To update for an applet:
You must load the jar file onto the device (this only has to be done once).
When executed, the configuration applet will connect back to the device it was loaded from.
-
Access the administration web interface by entering the following URL in
in a browser's URL window:
http://ip-address-of-device/admin/administration.htm
-
Select File Management under the Administration menu.
-
Click Browse. Locate and select the common.jar file in the configapp\dist\bin\applet
directory. Click Open.
-
Click Upload.
To update for an application:
To make the new common.jar file available for an application, simply move the file to the
location that the application is looking for it. This is typically found in the classpath
specified on the invocation of the application.
Common Library Code Adjustments
Customers familiar with java devlopment can examine the classes shipped in the library to see
how to properly interact with a device server from a java application. You can change or modify
this code as you desire but be aware that it is sample code may change in the future without notice.
This code is supplied AS-IS and it or derivations based on it will not be supported. Please see
the supplied javadoc for details on how the classes are organized and used:
|