Merge pull request #114 from eboasson/cross-i-dot-t
Dotting i's and crossing t's for a 0.1.0 release
This commit is contained in:
commit
a54ebff1c3
55 changed files with 1246 additions and 2124 deletions
144
README.md
144
README.md
|
@ -1,52 +1,137 @@
|
|||
# Eclipse Cyclone DDS
|
||||
|
||||
Eclipse Cyclone DDS is by far the most performant and robust DDS implementation available on the market.
|
||||
|
||||
Beside, Cyclone DDS is developed completely in the open and is undergoing the acceptance process to become part of Eclipse IoT (see [eclipse-cyclone-dds](https://projects.eclipse.org/proposals/eclipse-cyclone-dds)).
|
||||
|
||||
Eclipse Cyclone DDS is by far the most performant and robust DDS implementation available on the
|
||||
market. Moreover, Cyclone DDS is developed completely in the open as an Eclipse IoT project
|
||||
(see [eclipse-cyclone-dds](https://projects.eclipse.org/projects/iot.cyclonedds)).
|
||||
|
||||
# Getting Started
|
||||
## Building Cyclone DDS
|
||||
|
||||
In order to build cyclone DDS you need to have installed on your host [cmake](https://cmake.org/download/) **v3.6.0** or higher, the [Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) or simply the [Java 8 RE](http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html), and [Apache Maven 3.5.x or higher](http://maven.apache.org/download.cgi).
|
||||
## Building Eclipse Cyclone DDS
|
||||
|
||||
Assuming that **git** is also available on your machine then, simply do:
|
||||
In order to build Cyclone DDS you need a Linux, Mac or Windows 10 machine with the following
|
||||
installed on your host:
|
||||
|
||||
$ git clone https://github.com/eclipse/cyclonedds.git
|
||||
* [CMake](https://cmake.org/download/), version 3.7 or later. (Version 3.6 should work but you
|
||||
will have to edit the ``cmake_minimum_required`` version and may have to disable building the
|
||||
tests.)
|
||||
* [OpenSSL](https://www.openssl.org/), preferably version 1.1 or later. If you wish, you can
|
||||
build without support for OpenSSL by setting DDSC\_ENABLE\_OPENSSL to FALSE on the ``cmake ``
|
||||
command line (i.e., ``cmake -DDDSC_ENABLE_OPENSSL=FALSE`` ../src). In that, there is no need to
|
||||
have openssl available.
|
||||
* Java JDK, version 8 or later, e.g., [OpenJDK 11](http://jdk.java.net/11/).
|
||||
* [Apache Maven](http://maven.apache.org/download.cgi), version 3.5 or later.
|
||||
|
||||
The Java-based components are the preprocessor and a configurator tool. The run-time libraries are
|
||||
pure C code, so there is no need to have Java available on "target" machines.
|
||||
|
||||
To obtain Eclipse Cyclone DDS, do
|
||||
|
||||
$ git clone https://github.com/eclipse-cyclonedds/cyclonedds.git
|
||||
$ cd cyclonedds
|
||||
$ mkdir build
|
||||
|
||||
Depending on whether you want to develop applications using Cyclone DDS or contribute to it you can
|
||||
follow different procedures
|
||||
|
||||
### For application developers
|
||||
|
||||
To build and install the required libraries needed to develop your own applications using Cyclone
|
||||
DDS requires a few simple steps. There are some small differences between Linux and macOS on the one
|
||||
hand, and Windows on the other. For Linux or macOS:
|
||||
|
||||
$ cd build
|
||||
$ cmake ../src
|
||||
$ make
|
||||
$ make install
|
||||
$ cmake -DCMAKE_INSTALL_PREFIX=<install-location> ../src
|
||||
$ cmake --build .
|
||||
|
||||
At this point you are ready to use **cyclonedds** for your next DDS project!
|
||||
and for Windows:
|
||||
|
||||
$ cd build
|
||||
$ cmake -G "<generator-name>" -DCMAKE_INSTALL_PREFIX=<install-location> ../src
|
||||
$ cmake --build .
|
||||
|
||||
where you should replace ``<install-location>`` by the directory under which you would like to
|
||||
install Cyclone DDS and ``<generator-name>`` by one of the ways
|
||||
CMake [generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) offer for
|
||||
generating build files. For example, "Visual Studio 15 2017 Win64" would target a 64-bit build
|
||||
using Visual Studio 2017.
|
||||
|
||||
To install it after a successful build, do:
|
||||
|
||||
$ cmake --build . --target install
|
||||
|
||||
which will copy everything to:
|
||||
|
||||
* ``<install-location>/lib``
|
||||
* ``<install-location>/bin``
|
||||
* ``<install-location>/include/ddsc``
|
||||
* ``<install-location>/share/CycloneDDS``
|
||||
* ``<install-location>/etc/CycloneDDS``
|
||||
|
||||
Depending on the installation location you may need administrator privileges.
|
||||
|
||||
At this point you are ready to use Eclipse Cyclone DDS in your own projects.
|
||||
|
||||
Note that the default build type is a release build with debug information included
|
||||
(RelWithDebInfo), which is generally the most convenient type of build to use from applications
|
||||
because of a good mix between performance and still being able to debug things. If you'd rather
|
||||
have a Debug or pure Release build, set ``CMAKE_BUILD_TYPE`` accordingly.
|
||||
|
||||
### Contributing to Eclipse Cyclone DDS
|
||||
|
||||
We very much welcome all contributions to the project, whether that is questions, examples, bug
|
||||
fixes, enhancements or improvements to the documentation, or anything else really. When considering
|
||||
contributing code, it might be good to know that build configurations for Travis CI and AppVeyor are
|
||||
present in the repository and that there is a test suite using CTest and CUnit that can be built
|
||||
locally if desired. To build it, set the cmake variable ``BUILD_TESTING`` to on when configuring, e.g.:
|
||||
|
||||
$ cd build
|
||||
$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ../src
|
||||
$ cmake --build .
|
||||
$ ctest
|
||||
|
||||
Such a build requires the presence of [CUnit](http://cunit.sourceforge.net/). You can install this
|
||||
yourself, or you can choose to instead rely on the [Conan](https://conan.io) packaging system that
|
||||
the CI build infrastructure also uses. In that case, install Conan and do:
|
||||
|
||||
$ conan install ..
|
||||
|
||||
in the build directory prior to running cmake. For Windows, depending on the generator, you might
|
||||
also need to add switches to select the architecture and build type, e.g., ``conan install -s
|
||||
arch=x86_64 -s build_type=Debug ..`` This will automatically download and/or build CUnit (and, at
|
||||
the moment, OpenSSL).
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation is still rather limited, and at the moment only available in the sources (in the
|
||||
form of restructured text files in ``src/docs`` and Doxygen comments in the header files), or as
|
||||
a
|
||||
[PDF](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/pdf/CycloneDDS-0.1.0.pdf). The
|
||||
intent is to automate the process of building the documentation and have them available in more
|
||||
convenient formats and in the usual locations.
|
||||
|
||||
## Performance
|
||||
|
||||
Median small message throughput measured using the Throughput example between two Intel(R) Xeon(R)
|
||||
CPU E3-1270 V2 @ 3.50GHz (that's 2012 hardware ...) running Linux 3.8.13-rt14.20.el6rt.x86_64,
|
||||
connected via a quiet GbE and when using gcc-6.2.0 for a RelWithDebInfo build is:
|
||||
connected via a quiet GbE and when using gcc-6.2.0 for a default (i.e., "RelWithDebInfo") build is:
|
||||
|
||||

|
||||
<img src="https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/throughput-polling.png" alt="Throughput" height="400">
|
||||
|
||||
This is with the subscriber in polling mode. Listener mode is marginally slower; using a waitset the
|
||||
message rate for minimal size messages drops to 600k sample/s in synchronous delivery mode and about
|
||||
750k samples/s in asynchronous delivery mode. The configuration is an out-of-the-box configuration,
|
||||
tweaked only to increase the high-water mark for the reliability window on the writer side. For
|
||||
details, see the scripts in the ``performance`` directory and the [data](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/throughput.txt).
|
||||
details, see the scripts in the ``performance`` directory and
|
||||
the
|
||||
[data](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/throughput.txt).
|
||||
|
||||
There is some data on roundtrip latency below.
|
||||
|
||||
## Building and Running the Roundtrip Example
|
||||
|
||||
## Examples
|
||||
Now that you have built and installed **cyclonecdds** it is time to experiment with some examples.
|
||||
|
||||
### Building and Running the Roundtrip Example
|
||||
The first example we will show you how to build and run, measures cyclonedds latency and will allow you to see with your eyes how fast it is!
|
||||
|
||||
Do as follows:
|
||||
We will show you how to build and run an example program that measures latency. The examples are
|
||||
built automatically when you build Cyclone DDS, so you don't need to follow these steps to be able
|
||||
to run the program, it is merely to illustrate the process.
|
||||
|
||||
$ cd cyclonedds/src/examples/roundtrip
|
||||
$ mkdir build
|
||||
|
@ -54,12 +139,11 @@ Do as follows:
|
|||
$ cmake ..
|
||||
$ make
|
||||
|
||||
Now that you've build the roundtrip example it is time to run it.
|
||||
On one terminal start the application that will be responding to pings:
|
||||
|
||||
On one terminal start the applications that will be responding to **cyclonedds** pings.
|
||||
$ ./RoundtripPong
|
||||
|
||||
On another terminal, start the application that will be sending the ping.
|
||||
On another terminal, start the application that will be sending the pings:
|
||||
|
||||
$ ./RoundtripPing 0 0 0
|
||||
# payloadSize: 0 | numSamples: 0 | timeOut: 0
|
||||
|
@ -79,8 +163,12 @@ On another terminal, start the application that will be sending the ping.
|
|||
9 28242 17 16 24 132 28242 8 6 28242 1 0
|
||||
10 28075 17 16 23 46 28075 8 6 28075 1 0
|
||||
|
||||
The numbers above were measured on Mac running a 4.2 GHz Intel Core i7 on December 12th 2018. From
|
||||
these numbers you can see how the roundtrip is very stable and the minimal latency is now down to 17
|
||||
micro-seconds (used to be 25 micro-seconds) on this HW.
|
||||
|
||||
The number above were measure on Mac running a 4,2 GHz Intel Core i7 on December 12th 2018. From these number you can see how the roundtrip is incredibly stable and the minimal latency is now down to 17 micro-seconds (used to be 25 micro-seconds) on this HW.
|
||||
# Trademarks
|
||||
|
||||
## Documentation
|
||||
The Cyclone DDS documentation is available [here](http://cdds.io/docs).
|
||||
* "Eclipse Cyclone DDS" and "Cyclone DDS" are trademarks of the Eclipse Foundation.
|
||||
|
||||
* "DDS" is a trademark of the Object Management Group, Inc.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
#
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
|
||||
# Set a default build type if none was specified
|
||||
set(default_build_type "RelWithDebInfo")
|
||||
|
@ -38,8 +38,8 @@ execute_process(COMMAND git submodule update
|
|||
|
||||
# Set module path before defining project so platform files will work.
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
|
||||
set(CMAKE_PROJECT_NAME_FULL "Cyclone DDS")
|
||||
string(REPLACE " " "" PROJECT_NAME "${CMAKE_PROJECT_NAME_FULL}")
|
||||
set(CMAKE_PROJECT_NAME_FULL "Eclipse Cyclone DDS")
|
||||
set(PROJECT_NAME "CycloneDDS")
|
||||
project(${PROJECT_NAME} VERSION 0.1.0)
|
||||
|
||||
# Set some convenience variants of the project-name
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
/** @file
|
||||
*
|
||||
* @brief C DDS header
|
||||
* @brief Eclipse Cyclone DDS C header
|
||||
*/
|
||||
|
||||
#if defined (__cplusplus)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @brief DDS C Allocation API
|
||||
*
|
||||
* This header file defines the public API of allocation convenience functions
|
||||
* in the CycloneDDS C language binding.
|
||||
* in the Eclipse Cyclone DDS C language binding.
|
||||
*/
|
||||
#ifndef DDS_ALLOC_H
|
||||
#define DDS_ALLOC_H
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @brief DDS C Implementation API
|
||||
*
|
||||
* This header file defines the public API for all kinds of things in the
|
||||
* CycloneDDS C language binding.
|
||||
* Eclipse Cyclone DDS C language binding.
|
||||
*/
|
||||
#ifndef DDS_IMPL_H
|
||||
#define DDS_IMPL_H
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* @brief DDS C Listener API
|
||||
*
|
||||
* This header file defines the public API of listeners in the
|
||||
* CycloneDDS C language binding.
|
||||
* Eclipse Cyclone DDS C language binding.
|
||||
*/
|
||||
#ifndef _DDS_PUBLIC_LISTENER_H_
|
||||
#define _DDS_PUBLIC_LISTENER_H_
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* @brief DDS C QoS API
|
||||
*
|
||||
* This header file defines the public API of QoS and Policies in the
|
||||
* CycloneDDS C language binding.
|
||||
* Eclipse Cyclone DDS C language binding.
|
||||
*/
|
||||
#ifndef DDS_QOS_H
|
||||
#define DDS_QOS_H
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* @brief DDS C Communication Status API
|
||||
*
|
||||
* This header file defines the public API of the Communication Status in the
|
||||
* CycloneDDS C language binding.
|
||||
* Eclipse Cyclone DDS C language binding.
|
||||
*/
|
||||
#ifndef DDS_STATUS_H
|
||||
#define DDS_STATUS_H
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* @brief DDS C Stream API
|
||||
*
|
||||
* This header file defines the public API of the Streams in the
|
||||
* CycloneDDS C language binding.
|
||||
* Eclipse Cyclone DDS C language binding.
|
||||
*/
|
||||
#ifndef DDS_STREAM_H
|
||||
#define DDS_STREAM_H
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* @brief DDS C Time support API
|
||||
*
|
||||
* This header file defines the public API of the in the
|
||||
* CycloneDDS C language binding.
|
||||
* Eclipse Cyclone DDS C language binding.
|
||||
*/
|
||||
#ifndef DDS_TIME_H
|
||||
#define DDS_TIME_H
|
||||
|
|
|
@ -51,10 +51,10 @@ struct ut_thread_pool_s;
|
|||
struct debug_monitor;
|
||||
struct ddsi_tkmap;
|
||||
|
||||
typedef struct ospl_in_addr_node {
|
||||
typedef struct config_in_addr_node {
|
||||
nn_locator_t loc;
|
||||
struct ospl_in_addr_node *next;
|
||||
} ospl_in_addr_node;
|
||||
struct config_in_addr_node *next;
|
||||
} config_in_addr_node;
|
||||
|
||||
enum recvips_mode {
|
||||
RECVIPS_MODE_ALL, /* all MC capable interfaces */
|
||||
|
@ -174,7 +174,7 @@ struct q_globals {
|
|||
advertised in discovery messages (so that an external IP address on
|
||||
a NAT may be advertised), and the DDSI multi-cast address. */
|
||||
enum recvips_mode recvips_mode;
|
||||
struct ospl_in_addr_node *recvips;
|
||||
struct config_in_addr_node *recvips;
|
||||
nn_locator_t extmask;
|
||||
|
||||
nn_locator_t ownloc;
|
||||
|
|
|
@ -165,7 +165,7 @@ static int joinleave_mcgroup (ddsi_tran_conn_t conn, int join, const nn_locator_
|
|||
|
||||
static int interface_in_recvips_p (const struct nn_interface *interf)
|
||||
{
|
||||
struct ospl_in_addr_node *nodeaddr;
|
||||
struct config_in_addr_node *nodeaddr;
|
||||
for (nodeaddr = gv.recvips; nodeaddr; nodeaddr = nodeaddr->next)
|
||||
{
|
||||
if (locator_compare_no_port(&nodeaddr->loc, &interf->loc) == 0)
|
||||
|
|
|
@ -502,7 +502,7 @@ static const struct cfgelem heartbeat_interval_attrs[] = {
|
|||
};
|
||||
|
||||
static const struct cfgelem liveliness_monitoring_attrs[] = {
|
||||
{ LEAF("StackTraces"), 1, "true", ABSOFF(noprogress_log_stacktraces), 0, uf_boolean, 0, pf_boolean,
|
||||
{ ATTR("StackTraces"), 1, "true", ABSOFF(noprogress_log_stacktraces), 0, uf_boolean, 0, pf_boolean,
|
||||
"<p>This element controls whether or not to write stack traces to the DDSI2 trace when a thread fails to make progress (on select platforms only).</p>" },
|
||||
END_MARKER
|
||||
};
|
||||
|
|
|
@ -204,7 +204,7 @@ static int set_recvips (void)
|
|||
#endif
|
||||
else
|
||||
{
|
||||
struct ospl_in_addr_node **recvnode = &gv.recvips;
|
||||
struct config_in_addr_node **recvnode = &gv.recvips;
|
||||
int i, j;
|
||||
gv.recvips_mode = RECVIPS_MODE_SOME;
|
||||
for (i = 0; config.networkRecvAddressStrings[i] != NULL; i++)
|
||||
|
@ -225,7 +225,7 @@ static int set_recvips (void)
|
|||
DDS_ERROR("No interface bound to requested address '%s'\n", config.networkRecvAddressStrings[i]);
|
||||
return -1;
|
||||
}
|
||||
*recvnode = os_malloc (sizeof (struct ospl_in_addr_node));
|
||||
*recvnode = os_malloc (sizeof (struct config_in_addr_node));
|
||||
(*recvnode)->loc = loc;
|
||||
recvnode = &(*recvnode)->next;
|
||||
*recvnode = NULL;
|
||||
|
@ -584,8 +584,7 @@ int rtps_config_prep (struct cfgst *cfgst)
|
|||
if it had been created using create_thread(). */
|
||||
|
||||
{
|
||||
/* For Lite - Temporary
|
||||
Thread states for each application thread is managed using thread_states structure
|
||||
/* Temporary: thread states for each application thread is managed using thread_states structure
|
||||
*/
|
||||
#define USER_MAX_THREADS 50
|
||||
|
||||
|
@ -864,8 +863,6 @@ int rtps_init (void)
|
|||
uint32_t port_data_uc = 0;
|
||||
bool mc_available = true;
|
||||
|
||||
/* Initialize implementation (Lite or OSPL) */
|
||||
|
||||
ddsi_plugin_init ();
|
||||
ddsi_iid_init ();
|
||||
|
||||
|
@ -1386,7 +1383,7 @@ err_network_partition_addrset:
|
|||
err_set_ext_address:
|
||||
while (gv.recvips)
|
||||
{
|
||||
struct ospl_in_addr_node *n = gv.recvips;
|
||||
struct config_in_addr_node *n = gv.recvips;
|
||||
gv.recvips = n->next;
|
||||
os_free (n);
|
||||
}
|
||||
|
@ -1670,7 +1667,7 @@ void rtps_fini (void)
|
|||
|
||||
while (gv.recvips)
|
||||
{
|
||||
struct ospl_in_addr_node *n = gv.recvips;
|
||||
struct config_in_addr_node *n = gv.recvips;
|
||||
/* The compiler doesn't realize that n->next is always initialized. */
|
||||
OS_WARNING_MSVC_OFF(6001);
|
||||
gv.recvips = n->next;
|
||||
|
|
|
@ -587,7 +587,7 @@ static void test_conditions (dds_entity_t pp, dds_entity_t tp, const int count,
|
|||
if (conds[ci] <= 0) abort ();
|
||||
rhcconds[ci] = get_condaddr (conds[ci]);
|
||||
if (print) {
|
||||
char buf[10];
|
||||
char buf[18];
|
||||
snprintf (buf, sizeof (buf), "conds[%d]", ci);
|
||||
print_cond_w_addr (buf, conds[ci]);
|
||||
}
|
||||
|
|
|
@ -131,11 +131,9 @@ elseif(BUILD_DOCS)
|
|||
endif()
|
||||
|
||||
# Process sphinx configuration file
|
||||
set(sph_conf_author "ADLINK")
|
||||
string(TIMESTAMP sph_conf_copyright "%Y, ADLINK")
|
||||
set(sph_conf_author "Eclipse Cyclone DDS project")
|
||||
set(sph_conf_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||
set(sph_conf_release "${PROJECT_VERSION}")
|
||||
set(sph_logo "${PROJECT_SOURCE_DIR}/docs/_static/pictures/VORTEX_LOGO.png")
|
||||
configure_file(conf.py.in conf.py @ONLY)
|
||||
|
||||
# Define a list of output formats (-b option for sphinx-build)
|
||||
|
|
|
@ -2037,7 +2037,7 @@ INCLUDE_FILE_PATTERNS =
|
|||
# recursively expanded use the := operator instead of the = operator.
|
||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||
|
||||
PREDEFINED = __restrict= __attribute__(x)=
|
||||
PREDEFINED = __restrict= __attribute__(x)= __declspec(x)=
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
||||
# tag can be used to specify a list of macro names that should be expanded. The
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
|
||||
\newpage
|
||||
|
||||
###############################
|
||||
Building CycloneDDS applications
|
||||
###############################
|
||||
#########################################
|
||||
Building Eclipse Cyclone DDS applications
|
||||
#########################################
|
||||
|
||||
.. .. contents::
|
||||
|
||||
|
@ -36,15 +36,12 @@ to be done to code the *Hello World!* example.
|
|||
The procedure used to build the *Hello World!* example can also be
|
||||
used for building your own applications.
|
||||
|
||||
:Windows: It is advised to have the CycloneDDS examples component installed (see
|
||||
:ref:`Windows installation <WindowsInstallMSI>`) when actively
|
||||
building the CycloneDDS examples on Windows. This chapter refers to the
|
||||
CycloneDDS examples installed in the User Profile directory on Windows.
|
||||
:Windows: ...
|
||||
|
||||
:Linux: It is advised to have copied the CycloneDDS examples to a user-friendly
|
||||
:Linux: It is advised to have copied the Eclipse Cyclone DDS examples to a user-friendly
|
||||
location as described in :ref:`this <CopyLinuxExamplesToUserFriendlyLocation>`
|
||||
paragraph when actively building the CycloneDDS examples on Linux.
|
||||
This chapter refers to the CycloneDDS examples installed
|
||||
paragraph when actively building the Eclipse Cyclone DDS examples on Linux.
|
||||
This chapter refers to the Eclipse Cyclone DDS examples installed
|
||||
in the user-defined location.
|
||||
|
||||
|
||||
|
@ -116,8 +113,8 @@ Creating the *Hello World!* example executables is as simple as
|
|||
selecting the required configuration and building the solution.
|
||||
|
||||
:code:`helloworld\vs\directories.props` contains the location of where
|
||||
the CycloneDDS header files and libraries are be placed. These locations
|
||||
are based on the default installation directory structure. When CycloneDDS
|
||||
the Eclipse Cyclone DDS header files and libraries are be placed. These locations
|
||||
are based on the default installation directory structure. When Eclipse Cyclone DDS
|
||||
is installed in a different directory, the following paths in
|
||||
:code:`helloworld\vs\directories.props` should be changed, like:
|
||||
|
||||
|
@ -191,7 +188,7 @@ scope of this document.
|
|||
.. _`CycloneDdsPackage`:
|
||||
|
||||
Hello World! CMake (CycloneDDS Package)
|
||||
======================================
|
||||
=======================================
|
||||
|
||||
After the CMake digression, we're back with the *Hello World!*
|
||||
example. Apart from the native build files, CMake build files
|
||||
|
@ -304,13 +301,13 @@ using the binaries that were just build. Be sure to use the right directories.
|
|||
Summary
|
||||
*******
|
||||
|
||||
We've seen that a CycloneDDS application can be build by using a Makefile on Linux
|
||||
or a Visual Studio Solutions on Windows. Also CMake can be used to build a CycloneDDS
|
||||
We've seen that a Eclipse Cyclone DDS application can be build by using a Makefile on Linux
|
||||
or a Visual Studio Solutions on Windows. Also CMake can be used to build a Eclipse Cyclone DDS
|
||||
application. In fact, it is the preferred way of building.
|
||||
|
||||
In the end, a predefined way of generating and building the source code should
|
||||
be followed when building CycloneDDS applications. The figure below shows how a
|
||||
typical CycloneDDS application is build.
|
||||
be followed when building Eclipse Cyclone DDS applications. The figure below shows how a
|
||||
typical Eclipse Cyclone DDS application is build.
|
||||
|
||||
.. image:: ../_static/pictures/BuildSchema.png
|
||||
:scale: 30 %
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
|
||||
\newpage
|
||||
|
||||
#################
|
||||
Install CycloneDDS
|
||||
#################
|
||||
##############################
|
||||
Installing Eclipse Cyclone DDS
|
||||
##############################
|
||||
|
||||
.. .. contents::
|
||||
|
||||
|
@ -28,31 +28,12 @@ Install CycloneDDS
|
|||
System requirements
|
||||
*******************
|
||||
|
||||
Currently AdLink CycloneDDS is supported on the following platforms:
|
||||
|
||||
+-------------------+--------------+--------------------+
|
||||
| Operating systems | Architecture | Compiler |
|
||||
+===================+==============+====================+
|
||||
| Ubuntu 16.04 LTS | 64-bit | gcc 5.4 or later |
|
||||
+-------------------+--------------+--------------------+
|
||||
| Windows 10 | 64 -bit | VS2015 |
|
||||
+-------------------+--------------+--------------------+
|
||||
At the time of writing, Eclipse Cyclone DDS is known to run on Linux, macOS and Windows. The build-process is not yet able to generate native packages.
|
||||
|
||||
|
||||
|
||||
*****
|
||||
Linux
|
||||
*****
|
||||
|
||||
Ubuntu
|
||||
======
|
||||
|
||||
On Ubuntu and other debian-derived platforms, the product can be installed using a native package.
|
||||
|
||||
::
|
||||
|
||||
sudo dpkg -i cyclonedds_<version>_<architecture>.deb
|
||||
sudo dpkg -i cyclonedds-dev_<version>_<architecture>.deb
|
||||
***************
|
||||
Linux and macOS
|
||||
***************
|
||||
|
||||
|
||||
.. _`CopyLinuxExamplesToUserFriendlyLocation`:
|
||||
|
@ -60,11 +41,10 @@ On Ubuntu and other debian-derived platforms, the product can be installed using
|
|||
Post install steps
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The installation package installs examples in system directories.
|
||||
In order to have a better user experience when building the CycloneDDS
|
||||
examples, it is advised to copy the examples to a user-defined location.
|
||||
This is to be able to build the examples natively and experiment with
|
||||
the example source code.
|
||||
The installation package installs examples in system directories. In order to have a better user
|
||||
experience when building the Eclipse Cyclone DDS examples, it is advised to copy the examples to a
|
||||
user-defined location. This is to be able to build the examples natively and experiment with the
|
||||
example source code.
|
||||
|
||||
For this, the installation package provides the vdds_install_examples
|
||||
script, located in /usr/bin.
|
||||
|
@ -76,42 +56,15 @@ and the examples will be installed in the current location.
|
|||
Type :code:`vdds_install_examples -h` for more information.
|
||||
|
||||
|
||||
Red Hat
|
||||
=======
|
||||
|
||||
Not supported yet (CHAM-326).
|
||||
|
||||
|
||||
Tarball
|
||||
=======
|
||||
|
||||
For more generic Linux installations, different tar-balls (with the same
|
||||
content) are provided.
|
||||
|
||||
+----------------------------------+---------------------------------------+
|
||||
| Tarball | Description |
|
||||
+==================================+=======================================+
|
||||
| CycloneDDS-<version>-Linux.tar.Z | Tar Compress compression. |
|
||||
+----------------------------------+---------------------------------------+
|
||||
| CycloneDDS-<version>-Linux.tar.gz | Tar GZip compression. |
|
||||
+----------------------------------+---------------------------------------+
|
||||
| CycloneDDS-<version>-Linux.tar.sh | Self extracting Tar GZip compression. |
|
||||
+----------------------------------+---------------------------------------+
|
||||
|
||||
By extracting one of them at any preferred location, CycloneDDS can be used.
|
||||
|
||||
.. _`LinuxSetLibPath`:
|
||||
|
||||
Paths
|
||||
=====
|
||||
|
||||
To be able to run CycloneDDS executables, the required libraries (like
|
||||
libddsc.so) need to be available to the executables.
|
||||
Normally, these are installed in system default locations and it works
|
||||
out-of-the-box. However, if they are not installed in those locations,
|
||||
it is possible that the library search path has to be changed.
|
||||
This can be achieved by executing the command:
|
||||
::
|
||||
To be able to run Eclipse Cyclone DDS executables, the required libraries (like libddsc.so) need to
|
||||
be available to the executables. Normally, these are installed in system default locations and it
|
||||
works out-of-the-box. However, if they are not installed in those locations, it is possible that the
|
||||
library search path has to be changed. This can be achieved by executing the command: ::
|
||||
|
||||
export LD_LIBRARY_PATH=<install_dir>/lib:$LD_LIBRARY_PATH
|
||||
|
||||
|
@ -120,49 +73,19 @@ This can be achieved by executing the command:
|
|||
Windows
|
||||
*******
|
||||
|
||||
.. _`WindowsInstallMSI`:
|
||||
|
||||
MSI
|
||||
===
|
||||
|
||||
The default deployment method on Windows is to install the product using the MSI installer.
|
||||
|
||||
The installation process is self-explanatory. Three components are available:
|
||||
|
||||
1. a runtime component, containing the runtime libraries
|
||||
2. a development component, containing the header files, the IDL compiler,
|
||||
a precompiled Hello Word! example and other examples.
|
||||
3. an examples component, containing the source code of the CycloneDDS examples.
|
||||
|
||||
The runtime and development components are (by default) installed in "Program Files" while
|
||||
the CycloneDDS example component will be installed in the User Profile directory.
|
||||
The CycloneDDS example code in the User Profile directory can be changed by the user.
|
||||
|
||||
|
||||
ZIP
|
||||
===
|
||||
|
||||
The Windows installation is also provided as a ZIP file. By extracting it
|
||||
at any preferred location, CycloneDDS can be used.
|
||||
|
||||
.. _`WindowsSetLibPath`:
|
||||
|
||||
Paths
|
||||
~~~~~
|
||||
|
||||
To be able to run CycloneDDS executables, the required libraries (like
|
||||
ddsc.dll) need to be available to the executables.
|
||||
Normally, these are installed in system default locations and it works
|
||||
out-of-the-box. However, if they are not installed on those locations,
|
||||
it is possible that the library search path has to be changed.
|
||||
This can be achieved by executing the command:
|
||||
::
|
||||
To be able to run Eclipse Cyclone DDS executables, the required libraries (like ddsc.dll) need to be
|
||||
available to the executables. Normally, these are installed in system default locations and it
|
||||
works out-of-the-box. However, if they are not installed on those locations, it is possible that the
|
||||
library search path has to be changed. This can be achieved by executing the command: ::
|
||||
|
||||
set PATH=<install_dir>/bin;%PATH%
|
||||
|
||||
.. note::
|
||||
The MSI installer will add this path to the PATH environment
|
||||
variable automatically.
|
||||
|
||||
.. _`TestYourInstallation`:
|
||||
|
||||
|
@ -170,11 +93,9 @@ This can be achieved by executing the command:
|
|||
Test your installation
|
||||
**********************
|
||||
|
||||
The installation provides a simple prebuilt :ref:`Hello World! <HelloWorld>` application which
|
||||
can be run in order to test your installation. The *Hello World!* application consists of two
|
||||
executables: a so called HelloworldPublisher and a HelloworldSubscriber, typically located in
|
||||
:code:`/usr/share/CycloneDDS/examples/helloworld/bin` on Linux and in
|
||||
:code:`C:\Program Files\ADLINK\Cyclone DDS\share\CycloneDDS\examples\helloworld\bin` on Windows.
|
||||
Eclipse Cyclone DDS includes a simple :ref:`Hello World! <HelloWorld>` application which can be run
|
||||
in order to test your installation. The *Hello World!* application consists of two executables: a so
|
||||
called HelloworldPublisher and a HelloworldSubscriber.
|
||||
|
||||
To run the example application, please open two console windows and navigate to the appropriate
|
||||
directory in both console windows. Run the HelloworldSubscriber in one of the console windows by the
|
||||
|
@ -199,10 +120,3 @@ while the HelloworldSubscriber will be looking like this
|
|||
|
||||
For more information on how to build this application your own and the code which has
|
||||
been used, please have a look at the :ref:`Hello World! <HelloWorld>` chapter.
|
||||
|
||||
*******
|
||||
License
|
||||
*******
|
||||
|
||||
TODO: CHAM-325
|
||||
|
||||
|
|
|
@ -19,58 +19,25 @@
|
|||
What's next?
|
||||
############
|
||||
|
||||
Want to know more about CycloneDDS? Please consider following a tutorial or
|
||||
visit some of the pages listed below.
|
||||
Want to know more about DDS? The primary source of information is the
|
||||
OMG website at http://www.omg.org and specifically the `DDS Getting
|
||||
Started <http://www.omg.org/gettingstarted/omg_idl.htm>`_ page and the
|
||||
`DDS specification <http://www.omg.org/spec/DDS/>`_ itself. The
|
||||
specification is a bit wordy and of course deals with minute details,
|
||||
but it is surprisingly easy to follow for a specification.
|
||||
|
||||
*************************
|
||||
The OMG DDS Specification
|
||||
*************************
|
||||
There are also various resources on the web dealing with DDS in general,
|
||||
as the various vendors have posted tutorials, presentations, general
|
||||
information and documentation on their products. While the details
|
||||
between the various implementations do differ, they have much more in
|
||||
common than what separates them, and so this information is also
|
||||
applicable to Eclipse Cyclone DDS. The one thing in which
|
||||
Eclipse Cyclone DDS really differs is in the details of API, but that's
|
||||
just syntax.
|
||||
|
||||
PrismTech (aquired by AdLink) has been an active member of the Object Management
|
||||
Group® (OMG®) for over several years and is heavily involved in the development of the
|
||||
DDS specification. Please visit the OMG website at http://www.omg.org and
|
||||
specifically the
|
||||
`DDS Getting Started <http://www.omg.org/gettingstarted/omg_idl.htm>`_
|
||||
page and the `DDS specification <http://www.omg.org/spec/DDS/>`_ itself.
|
||||
Obviously there are also things specific to Eclipse Cyclone DDS. The
|
||||
level of documentation of Eclipse is not nearly what it should be, but
|
||||
that will improve over time.
|
||||
|
||||
*************************************
|
||||
AdLink Documentation and Tutorials
|
||||
*************************************
|
||||
|
||||
* `Documentation <http://www.prismtech.com/vortex/resources/documentation>`_
|
||||
* `DDS Tutorial <http://download.prismtech.com/docs/Vortex/html/ospl/DDSTutorial/index.html>`_
|
||||
|
||||
********************************
|
||||
AdLink on Youtube and Slideshare
|
||||
********************************
|
||||
|
||||
AdLink is also active on Youtube and Slideshare. Please following
|
||||
the links below to view some interesting videos and presentations.
|
||||
|
||||
* `Overview <http://www.prismtech.com/vortex/resources/presentations>`_
|
||||
* `Vortex Youtube <https://www.youtube.com/channel/UCqADOYgcicDgASLjNxww-Ww>`_
|
||||
* `Vortex Slideshare <https://www.slideshare.net/prismtech1/presentations>`_
|
||||
* `Vortex Demo <http://www.prismtech.com/vortex/vortex-demo>`_
|
||||
|
||||
**********************
|
||||
AdLink on Social Media
|
||||
**********************
|
||||
|
||||
* `Twitter (@ADLINKTech_usa) <https://twitter.com/ADLINKTech_usa>`_
|
||||
* `Facebook <https://www.facebook.com/ADLINKTECH/>`_
|
||||
* `LinkedIn <https://www.linkedin.com/company/79111/>`_
|
||||
|
||||
|
||||
*****************
|
||||
The DDS community
|
||||
*****************
|
||||
|
||||
* `The AdLink DDS-community <http://www.prismtech.com/dds-community>`_
|
||||
* `The AdLink DDS Forum <http://www.prismtech.com/dds-community/community-interaction>`_
|
||||
|
||||
*******
|
||||
Support
|
||||
*******
|
||||
|
||||
* `Knowledge base <https://kb.prismtech.com/>`_
|
||||
* `Support (registered users) <http://www.prismtech.com/support>`_
|
||||
And last but note least: please always feel welcome to ask questions on
|
||||
GitHub!
|
||||
|
|
|
@ -15,53 +15,8 @@
|
|||
|
||||
\newpage
|
||||
|
||||
######################
|
||||
Uninstalling CycloneDDS
|
||||
######################
|
||||
################################
|
||||
Uninstalling Eclipse Cyclone DDS
|
||||
################################
|
||||
|
||||
*****
|
||||
Linux
|
||||
*****
|
||||
|
||||
Uninstalling CycloneDDS on Linux can be established by invoking
|
||||
the following two commands (of which the first is optional):
|
||||
::
|
||||
|
||||
sudo dpkg --remove cyclonedds-dev
|
||||
sudo dpkg --remove cyclonedds
|
||||
|
||||
.. note::
|
||||
Mind the order in which these commands are run. The development
|
||||
package (:code:`cyclonedds-dev`) need to be removed first since
|
||||
it depends on the library version (:code:`cyclonedds`).
|
||||
|
||||
*******
|
||||
Windows
|
||||
*******
|
||||
|
||||
There are two ways to uninstall CycloneDDS from Windows
|
||||
|
||||
1. By using the original CycloneDDS :ref:`MSI <WindowsInstallMSI>` file
|
||||
2. By using Windows "Apps & features"
|
||||
|
||||
Original MSI
|
||||
============
|
||||
|
||||
Locate the original CycloneDDS MSI file on your system and start it.
|
||||
After clicking :code:`Next`, an overview of options appears, amongst which
|
||||
is the remove option. By clicking :code:`Remove`, all files and folders are
|
||||
removed, except the CycloneDDS examples (if installed).
|
||||
|
||||
Apps & features
|
||||
===============
|
||||
|
||||
Go to :code:`Windows Settings` by clicking the :code:`Settings`-icon ( |settings_icon| )
|
||||
in the Windows Start Menu. Choose :code:`Apps` in the
|
||||
:code:`Windows Settings` screen. A list of all installed apps
|
||||
and programs pops up. Select :code:`CycloneDDS` and choose :code:`Uninstall`.
|
||||
All installed files and folders will be removed, except the
|
||||
CycloneDDS examples (if installed).
|
||||
|
||||
.. |settings_icon| image:: ../_static/pictures/settings-icon.png
|
||||
:height: 9
|
||||
:width: 9
|
||||
TBD.
|
||||
|
|
|
@ -49,7 +49,7 @@ source_suffix = '.rst'
|
|||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'@CMAKE_PROJECT_NAME@'
|
||||
project = u'@CMAKE_PROJECT_NAME_FULL@'
|
||||
copyright = u'@sph_conf_copyright@'
|
||||
author = u'@sph_conf_author@'
|
||||
|
||||
|
@ -119,7 +119,7 @@ html_sidebars = {
|
|||
# -- Options for HTMLHelp output ------------------------------------------
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = '@CMAKE_PROJECT_NAME@doc'
|
||||
htmlhelp_basename = '@CMAKE_PROJECT_NAME_FULL@doc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
@ -147,7 +147,7 @@ latex_elements = {
|
|||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, '@CMAKE_PROJECT_NAME@.tex', u'@CMAKE_PROJECT_NAME@',
|
||||
(master_doc, '@CMAKE_PROJECT_NAME@.tex', u'@CMAKE_PROJECT_NAME_FULL@',
|
||||
u'@sph_conf_author@', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -158,7 +158,7 @@ latex_logo = u'@sph_logo@'
|
|||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
#man_pages = [
|
||||
# (master_doc, 'cyclonedds', u'CycloneDDS Documentation',
|
||||
# (master_doc, 'cyclonedds', u'Eclipse Cyclone DDS Documentation',
|
||||
# [author], 1)
|
||||
#]
|
||||
|
||||
|
@ -169,7 +169,7 @@ latex_logo = u'@sph_logo@'
|
|||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, '@CMAKE_PROJECT_NAME@', u'@CMAKE_PROJECT_NAME@ Documentation',
|
||||
(master_doc, '@CMAKE_PROJECT_NAME_FULL@', u'@CMAKE_PROJECT_NAME_FULL@ Documentation',
|
||||
author, '@CMAKE_PROJECT_NAME@', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
###################################################
|
||||
A guide to the configuration options of Cyclone DDS
|
||||
###################################################
|
||||
###########################################################
|
||||
A guide to the configuration options of Eclipse Cyclone DDS
|
||||
###########################################################
|
||||
|
||||
This document attempts to provide background information that will help in adjusting the
|
||||
configuration of Cyclone DDS when the default settings do not give the desired behavior.
|
||||
configuration of Eclipse Cyclone DDS when the default settings do not give the desired behavior.
|
||||
A full listing of all settings is out of scope for this document, but can be extracted
|
||||
from the sources.
|
||||
|
||||
|
||||
.. _`DDSI Concepts`
|
||||
.. _`DDSI Concepts`:
|
||||
|
||||
DDSI Concepts
|
||||
*************
|
||||
|
@ -18,10 +18,10 @@ correspondence between the entities in DDSI and those in DCPS. However, this
|
|||
correspondence is not one-to-one.
|
||||
|
||||
In this section we give a high-level description of the concepts of the DDSI
|
||||
specification, with hardly any reference to the specifics of the Cyclone DDS
|
||||
specification, with hardly any reference to the specifics of the Eclipse Cyclone DDS
|
||||
implementation, which are addressed in subsequent sections. This division was chosen to
|
||||
aid readers interested in interoperability to understand where the specification ends
|
||||
and the Cyclone DDS implementation begins.
|
||||
and the Eclipse Cyclone DDS implementation begins.
|
||||
|
||||
|
||||
.. _`Mapping of DCPS domains to DDSI domains`:
|
||||
|
@ -89,7 +89,7 @@ are stored in the writer history cache (or *WHC*) of the DDSI writer. The DDSI
|
|||
is required to periodically send *Heartbeats* to its readers to ensure that all readers
|
||||
will learn of the presence of new samples in the WHC even when packets get lost. It is
|
||||
allowed to suppress these periodic Heartbeats if there is all samples in the WHC have
|
||||
been acknowledged by all matched readers and the Cyclone DDS exploits this freedom.
|
||||
been acknowledged by all matched readers and the Eclipse Cyclone DDS exploits this freedom.
|
||||
|
||||
If a reader receives a Heartbeat and detects it did not receive all samples, it requests
|
||||
a retransmission by sending an *AckNack* message to the writer. The timing of this is
|
||||
|
@ -106,7 +106,7 @@ from its WHC when it fills up too far, and allows readers to always receive all
|
|||
complication exists in the case of unresponsive readers, readers that do not respond to
|
||||
a Heartbeat at all, or that for some reason fail to receive some samples despite
|
||||
resending it. The specification leaves the way these get treated unspecified. The
|
||||
default beahviour of Cyclone DDS is to never consider readers unresponsive, but it can
|
||||
default beahviour of Eclipse Cyclone DDS is to never consider readers unresponsive, but it can
|
||||
be configured to consider them so after a certain length of time has passed at which
|
||||
point the participant containing the reader is undiscovered.
|
||||
|
||||
|
@ -135,7 +135,7 @@ sample for each existing instance.
|
|||
|
||||
Naturally, once the DCPS writer is deleted (or disappears for whatever reason), the DDSI
|
||||
writer disappears as well, and with it, its history. For this reason, transient data is
|
||||
generally much to be preferred over transient-local data. Cyclone DDS has a facility
|
||||
generally much to be preferred over transient-local data. Eclipse Cyclone DDS has a facility
|
||||
for retrieving transient data from an suitably configured OpenSplice node, but does not
|
||||
yet include a native service for managing transient data.
|
||||
|
||||
|
@ -162,14 +162,14 @@ The protocol does allow for unicast-based discovery, which requires listing the
|
|||
addresses of machines where participants may be located and ensuring each participant
|
||||
uses one of a small set of port numbers. Because of this, some of the port numbers are
|
||||
derived not only from the domain id, but also from a *participant index*, which is a
|
||||
small non-negative integer, unique to a participant within a node. (Cyclone DDS adds an
|
||||
small non-negative integer, unique to a participant within a node. (Eclipse Cyclone DDS adds an
|
||||
indirection and uses at most one participant index for a domain for each process,
|
||||
regardless of how many DCPS participants are created by the process.)
|
||||
|
||||
Once two participants have discovered each other and both have matched the DDSI built-in
|
||||
endpoints their peer is advertising in the SPDP message, the *Simple Endpoint Discovery
|
||||
Protocol* or *SEDP* takes over, exchanging information on the DCPS data readers and data
|
||||
writers (and for Cyclone DDS, also publishers, subscribers and topics in a manner
|
||||
writers (and for Eclipse Cyclone DDS, also publishers, subscribers and topics in a manner
|
||||
compatible with OpenSplice) in the two participants.
|
||||
|
||||
The SEDP data is handled as reliable, transient-local data. Therefore, the SEDP writers
|
||||
|
@ -183,10 +183,10 @@ participant is added to the system: *all* existing participants respond to the S
|
|||
message, following which all start exchanging SEDP data.
|
||||
|
||||
|
||||
.. _`Cyclone DDS specifics`:
|
||||
.. _`Eclipse Cyclone DDS specifics`:
|
||||
|
||||
Cyclone DDS specifics
|
||||
*********************
|
||||
Eclipse Cyclone DDS specifics
|
||||
*****************************
|
||||
|
||||
.. _`Discovery behaviour`:
|
||||
|
||||
|
@ -198,7 +198,7 @@ Discovery behaviour
|
|||
Proxy participants and endpoints
|
||||
--------------------------------
|
||||
|
||||
Cyclone DDS is what the DDSI specification calls a *stateful* implementation. Writers
|
||||
Eclipse Cyclone DDS is what the DDSI specification calls a *stateful* implementation. Writers
|
||||
only send data to discovered readers and readers only accept data from discovered
|
||||
writers. (There is one exception: the writer may choose to multicast the data, and
|
||||
anyone listening will be able to receive it, if a reader has already discovered the
|
||||
|
@ -206,7 +206,7 @@ writer but not vice-versa; it may accept the data even though the connection is
|
|||
fully established yet. At present, not only can such asymmetrical discovery cause data
|
||||
to be delivered when it was perhaps not expected, it can also cause indefinite blocking
|
||||
if the situation persists for a long time.) Consequently, for each remote participant
|
||||
and reader or writer, Cyclone DDS internally creates a proxy participant, proxy reader
|
||||
and reader or writer, Eclipse Cyclone DDS internally creates a proxy participant, proxy reader
|
||||
or proxy writer. In the discovery process, writers are matched with proxy readers, and
|
||||
readers are matched with proxy writers, based on the topic and type names and the QoS
|
||||
settings.
|
||||
|
@ -215,7 +215,7 @@ Proxies have the same natural hierarchy that ‘normal’ DDSI entities have: ea
|
|||
endpoint is owned by some proxy participant, and once the proxy participant is deleted,
|
||||
all of its proxy endpoints are deleted as well. Participants assert their liveliness
|
||||
periodically (called *automic* liveliness in the DCPS specification and the only mode
|
||||
currently supported by Cyclone DDS), and when nothing has been heard from a participant
|
||||
currently supported by Eclipse Cyclone DDS), and when nothing has been heard from a participant
|
||||
for the lease duration published by that participant in its SPDP message, the lease
|
||||
becomes expired triggering a clean-up.
|
||||
|
||||
|
@ -230,11 +230,11 @@ to expire.
|
|||
Sharing of discovery information
|
||||
--------------------------------
|
||||
|
||||
As Cyclone DDS handles any number of participants in an integrated manner, the discovery
|
||||
As Eclipse Cyclone DDS handles any number of participants in an integrated manner, the discovery
|
||||
protocol as sketched earlier is rather wasteful: there is no need for each individual
|
||||
participant in a Cyclone DDS process to run the full discovery protocol for itself.
|
||||
participant in a Eclipse Cyclone DDS process to run the full discovery protocol for itself.
|
||||
|
||||
Instead of implementing the protocol as suggested by the standard, Cyclone DDS shares
|
||||
Instead of implementing the protocol as suggested by the standard, Eclipse Cyclone DDS shares
|
||||
all discovery activities amongst the participants, allowing one to add participants on a
|
||||
process with only a minimal impact on the system. It is even possible to have only a
|
||||
single DDSI participant in a process regardless of the number of DCPS participants
|
||||
|
@ -246,7 +246,7 @@ affected.
|
|||
|
||||
Because other implementations of the DDSI specification may be written on the assumption
|
||||
that all participants perform their own discovery, it is possible to simulate that with
|
||||
Cyclone DDS. It will not actually perform the discovery for each participant
|
||||
Eclipse Cyclone DDS. It will not actually perform the discovery for each participant
|
||||
independently, but it will generate the network traffic *as if* it does. These are
|
||||
controlled by the ``Internal/BuiltinEndpointSet`` and
|
||||
``Internal/ConservativeBuiltinReaderStartup`` options. However, please note that at the
|
||||
|
@ -267,12 +267,12 @@ Lingering writers
|
|||
|
||||
When an application deletes a reliable DCPS data writer, there is no guarantee that all
|
||||
its readers have already acknowledged the correct receipt of all samples. In such a
|
||||
case, Cyclone DDS lets the writer (and the owning participant if necessary) linger in
|
||||
case, Eclipse Cyclone DDS lets the writer (and the owning participant if necessary) linger in
|
||||
the system for some time, controlled by the ``Internal/WriterLingerDuration`` option.
|
||||
The writer is deleted when all samples have been acknowledged by all readers or the
|
||||
linger duration has elapsed, whichever comes first.
|
||||
|
||||
Note that the writer linger duration setting is currently not applied when Cyclone DDS
|
||||
Note that the writer linger duration setting is currently not applied when Eclipse Cyclone DDS
|
||||
is requested to terminate.
|
||||
|
||||
|
||||
|
@ -281,7 +281,7 @@ is requested to terminate.
|
|||
Start-up mode
|
||||
-------------
|
||||
|
||||
A similar issue exists when starting Cyclone DDS: DDSI discovery takes time, and when
|
||||
A similar issue exists when starting Eclipse Cyclone DDS: DDSI discovery takes time, and when
|
||||
data is written immediately after the first participant was created, it is likely that
|
||||
the discovery process hasn’t completed yet and some remote readers have not yet been
|
||||
discovered. This would cause the writers to throw away samples for lack of interest,
|
||||
|
@ -372,7 +372,7 @@ Network and discovery configuration
|
|||
Networking interfaces
|
||||
=====================
|
||||
|
||||
Cyclone DDS uses a single network interface, the *preferred* interface, for transmitting
|
||||
Eclipse Cyclone DDS uses a single network interface, the *preferred* interface, for transmitting
|
||||
its multicast packets and advertises only the address corresponding to this interface in
|
||||
the DDSI discovery protocol.
|
||||
|
||||
|
@ -398,7 +398,7 @@ is always preferred and is the only option that allows selecting the desired one
|
|||
multiple addresses are tied to a single interface.
|
||||
|
||||
The default address family is IPv4, setting General/UseIPv6 will change this to IPv6.
|
||||
Currently, Cyclone DDS does not mix IPv4 and IPv6 addressing. Consequently, all DDSI
|
||||
Currently, Eclipse Cyclone DDS does not mix IPv4 and IPv6 addressing. Consequently, all DDSI
|
||||
participants in the network must use the same addressing mode. When interoperating,
|
||||
this behaviour is the same, i.e., it will look at either IPv4 or IPv6 addresses in the
|
||||
advertised address information in the SPDP and SEDP discovery protocols.
|
||||
|
@ -412,7 +412,7 @@ DDS will operate in a *global addressing* mode and will only consider discovered
|
|||
non-link-local addresses. In this mode, one can select any set of interface for
|
||||
listening to multicasts. Note that this behaviour is essentially identical to that when
|
||||
using IPv4, as IPv4 does not have the formal notion of address scopes that IPv6 has. If
|
||||
instead only a link-local address is available, Cyclone DDS will run in a *link-local
|
||||
instead only a link-local address is available, Eclipse Cyclone DDS will run in a *link-local
|
||||
addressing* mode. In this mode it will accept any address in a discovery packet,
|
||||
assuming that a link-local address is valid on the preferred interface. To minimise the
|
||||
risk involved in this assumption, it only allows the preferred interface for listening
|
||||
|
@ -431,7 +431,7 @@ in the same way as for network interfaces.
|
|||
Multicasting
|
||||
------------
|
||||
|
||||
Cyclone DDS allows configuring to what extent multicast (the regular, any-source
|
||||
Eclipse Cyclone DDS allows configuring to what extent multicast (the regular, any-source
|
||||
multicast as well as source-specific multicast) is to be used:
|
||||
|
||||
+ whether to use multicast for data communications,
|
||||
|
@ -463,7 +463,7 @@ TCP support
|
|||
The DDSI protocol is really a protocol designed for a transport providing
|
||||
connectionless, unreliable datagrams. However, there are times where TCP is the only
|
||||
practical network transport available (for example, across a WAN). Because of this,
|
||||
Cyclone DDS can use TCP instead of UDP.
|
||||
Eclipse Cyclone DDS can use TCP instead of UDP.
|
||||
|
||||
The differences in the model of operation between DDSI and TCP are quite large: DDSI is
|
||||
based on the notion of peers, whereas TCP communication is based on the notion of a
|
||||
|
@ -500,7 +500,7 @@ initiated.
|
|||
Raw Ethernet support
|
||||
--------------------
|
||||
|
||||
As an additional option, on Linux, Cyclone DDS can use a raw Ethernet network interface
|
||||
As an additional option, on Linux, Eclipse Cyclone DDS can use a raw Ethernet network interface
|
||||
to communicate without a configured IP stack.
|
||||
|
||||
|
||||
|
@ -581,7 +581,7 @@ Endpoint discovery
|
|||
..................
|
||||
|
||||
Although the SEDP protocol never requires any configuration, network partitioning does
|
||||
interact with it: so-called ‘ignored partitions’ can be used to instruct Cyclone DDS to
|
||||
interact with it: so-called ‘ignored partitions’ can be used to instruct Eclipse Cyclone DDS to
|
||||
completely ignore certain DCPS topic and partition combinations, which will prevent data
|
||||
for these topic/partition combinations from being forwarded to and from the network.
|
||||
|
||||
|
@ -623,8 +623,8 @@ received for a participant that has not yet been discovered.
|
|||
Controlling port numbers
|
||||
========================
|
||||
|
||||
The port numbers used by by Cyclone DDS are determined as follows, where the first two
|
||||
items are given by the DDSI specification and the third is unique to Cyclone DDS as a
|
||||
The port numbers used by by Eclipse Cyclone DDS are determined as follows, where the first two
|
||||
items are given by the DDSI specification and the third is unique to Eclipse Cyclone DDS as a
|
||||
way of serving multiple participants by a single DDSI instance:
|
||||
|
||||
+ 2 ‘well-known’ multicast ports: ``B`` and ``B+1``
|
||||
|
@ -649,7 +649,7 @@ PI is the most interesting, as it relates to having multiple processes in the sa
|
|||
domain on a single node. Its configured value is either *auto*, *none* or a non-negative
|
||||
integer. This setting matters:
|
||||
|
||||
+ When it is *auto* (which is the default), Cyclone DDS probes UDP port numbers on
|
||||
+ When it is *auto* (which is the default), Eclipse Cyclone DDS probes UDP port numbers on
|
||||
start-up, starting with PI = 0, incrementing it by one each time until it finds a pair
|
||||
of available port numbers, or it hits the limit. The maximum PI it will ever choose
|
||||
is ``Discovery/MaxAutoParticipantIndex`` as a way of limiting the cost of unicast
|
||||
|
@ -674,12 +674,12 @@ item in the list. These are used only because there exist some DDSI implementat
|
|||
that assume each domain participant advertises a unique port number as part of the
|
||||
discovery protocol, and hence that there is never any need for including an explicit
|
||||
destination participant id when intending to address a single domain participant by
|
||||
using its unicast locator. Cyclone DDS never makes this assumption, instead opting to
|
||||
using its unicast locator. Eclipse Cyclone DDS never makes this assumption, instead opting to
|
||||
send a few bytes extra to ensure the contents of a message are all that is needed. With
|
||||
other implementations, you will need to check.
|
||||
|
||||
If all DDSI implementations in the network include full addressing information in the
|
||||
messages like Cyclone DDS does, then the per-domain participant ports serve no purpose
|
||||
messages like Eclipse Cyclone DDS does, then the per-domain participant ports serve no purpose
|
||||
at all. The default ``false`` setting of ``Compatibility/ManySocketsMode`` disables the
|
||||
creation of these ports.
|
||||
|
||||
|
@ -706,7 +706,7 @@ retransmitting the same sample over & over again to many different readers. Sim
|
|||
while readers should try to avoid requesting retransmissions too often, in an
|
||||
interoperable system the writers should be robust against it.
|
||||
|
||||
In Cyclone DDS, upon receiving a Heartbeat that indicates samples are missing, a reader
|
||||
In Eclipse Cyclone DDS, upon receiving a Heartbeat that indicates samples are missing, a reader
|
||||
will schedule the second and following retransmission requests to be sent after
|
||||
``Internal/NackDelay`` or combine it with an already scheduled request if possible. Any
|
||||
samples received in between receipt of the Heartbeat and the sending of the AckNack will
|
||||
|
@ -734,7 +734,7 @@ the writer simply queues all these samples for retransmission, it may well resul
|
|||
huge backlog of samples to be retransmitted. As a result, the ones near the end of the
|
||||
queue may be delayed by so much that the reader issues another retransmit request.
|
||||
|
||||
Therefore, Cyclone DDS limits the number of samples queued for retransmission and
|
||||
Therefore, Eclipse Cyclone DDS limits the number of samples queued for retransmission and
|
||||
ignores (those parts of) retransmission requests that would cause the retransmit queue
|
||||
to contain too many samples or take too much time to process. There are two settings
|
||||
governing the size of these queues, and the limits are applied per timed-event thread.
|
||||
|
@ -754,7 +754,7 @@ Samples in DDS can be arbitrarily large, and will not always fit within a single
|
|||
datagram. DDSI has facilities to fragment samples so they can fit in UDP datagrams, and
|
||||
similarly IP has facilities to fragment UDP datagrams to into network packets. The DDSI
|
||||
specification states that one must not unnecessarily fragment at the DDSI level, but
|
||||
Cyclone DDS simply provides a fully configurable behaviour.
|
||||
Eclipse Cyclone DDS simply provides a fully configurable behaviour.
|
||||
|
||||
If the serialised form of a sample is at least ``Internal/FragmentSize``,
|
||||
it will be fragmented using the DDSI fragmentation. All but the last fragment
|
||||
|
@ -835,14 +835,14 @@ priority, effectively enabling synchronous delivery for all data.
|
|||
Maximum sample size
|
||||
===================
|
||||
|
||||
Cyclone DDS provides a setting, ``Internal/MaxSampleSize``, to control the maximum size
|
||||
Eclipse Cyclone DDS provides a setting, ``Internal/MaxSampleSize``, to control the maximum size
|
||||
of samples that the service is willing to process. The size is the size of the (CDR)
|
||||
serialised payload, and the limit holds both for built-in data and for application data.
|
||||
The (CDR) serialised payload is never larger than the in-memory representation of the
|
||||
data.
|
||||
|
||||
On the transmitting side, samples larger than ``MaxSampleSize`` are dropped with a
|
||||
warning in the. Cyclone DDS behaves as if the sample never existed.
|
||||
warning in the. Eclipse Cyclone DDS behaves as if the sample never existed.
|
||||
|
||||
Similarly, on the receiving side, samples large than ``MaxSampleSize`` are dropped as
|
||||
early as possible, immediately following the reception of a sample or fragment of one,
|
||||
|
@ -904,10 +904,10 @@ partition mappings are specified in the configuration. The first matching mappi
|
|||
the one that will be used. The ``*`` and ``?`` wildcards are available for the DCPS
|
||||
partition/topic combination in the partition mapping.
|
||||
|
||||
As mentioned earlier (see `Local discovery and built-in topics`_), Cyclone DDS can be
|
||||
instructed to ignore all DCPS data readers and writers for certain DCPS partition/topic
|
||||
combinations through the use of *IgnoredPartitions*. The ignored partitions use the
|
||||
same matching rules as normal mappings, and take precedence over the normal mappings.
|
||||
As mentioned earlier, Eclipse Cyclone DDS can be instructed to ignore all DCPS data
|
||||
readers and writers for certain DCPS partition/topic combinations through the use of
|
||||
*IgnoredPartitions*. The ignored partitions use the same matching rules as normal
|
||||
mappings, and take precedence over the normal mappings.
|
||||
|
||||
|
||||
.. _`Multiple matching mappings`:
|
||||
|
@ -926,7 +926,7 @@ data the reader will receive; it only affects the addressing on the network.
|
|||
Thread configuration
|
||||
********************
|
||||
|
||||
Cyclone DDS creates a number of threads and each of these threads has a number of
|
||||
Eclipse Cyclone DDS creates a number of threads and each of these threads has a number of
|
||||
properties that can be controlled individually. The properties that can be controlled
|
||||
are:
|
||||
|
||||
|
@ -941,7 +941,7 @@ anything not specified explicitly is left at the default value.
|
|||
The following threads exist:
|
||||
|
||||
+ *gc*: garbage collector, which sleeps until garbage collection is requested for an
|
||||
entity, at which point it starts monitoring the state of Cyclone DDS, pushing the
|
||||
entity, at which point it starts monitoring the state of Eclipse Cyclone DDS, pushing the
|
||||
entity through whatever state transitions are needed once it is safe to do so, ending
|
||||
with the freeing of the memory.
|
||||
+ *recv*: accepts incoming network packets from all sockets/ports, performs all protocol
|
||||
|
@ -949,7 +949,7 @@ The following threads exist:
|
|||
timed-event thread, queues for delivery or, in special cases, delivers it directly to
|
||||
the data readers.
|
||||
+ *dq.builtins*: processes all discovery data coming in from the network.
|
||||
+ *lease*: performs internal liveliness monitoring of Cyclone DDS.
|
||||
+ *lease*: performs internal liveliness monitoring of Eclipse Cyclone DDS.
|
||||
+ *tev*: timed-event handling, used for all kinds of things, such as: periodic
|
||||
transmission of participant discovery and liveliness messages, transmission of control
|
||||
messages for reliable writers and readers (except those that have their own
|
||||
|
@ -973,7 +973,7 @@ When no channels are explicitly defined, there is one channel named *user*.
|
|||
Reporting and tracing
|
||||
*********************
|
||||
|
||||
Cyclone DDS can produce highly detailed traces of all traffic and internal activities.
|
||||
Eclipse Cyclone DDS can produce highly detailed traces of all traffic and internal activities.
|
||||
It enables individual categories of information, as well as having a simple verbosity
|
||||
level that enables fixed sets of categories.
|
||||
|
||||
|
@ -1058,26 +1058,21 @@ Compatibility and conformance
|
|||
Conformance modes
|
||||
=================
|
||||
|
||||
Cyclone DDS operates in one of three modes: *pedantic*, *strict* and *lax*; the mode is
|
||||
Eclipse Cyclone DDS operates in one of three modes: *pedantic*, *strict* and *lax*; the mode is
|
||||
configured using the ``Compatibility/StandardsConformance`` setting. The default is
|
||||
*lax*.
|
||||
|
||||
The first, *pedantic* mode, is of such limited utility that it will be removed.
|
||||
|
||||
The second mode, *strict*, attempts to follow the *intent* of the specification while
|
||||
staying close to the letter of it. The points in which it deviates from the standard are
|
||||
in all probability editing errors that will be rectified in the next update. When
|
||||
operated in this mode, one would expect it to be fully interoperable with other vendors’
|
||||
implementations, but this is not the case. The deviations in other vendors’
|
||||
implementations are not required to implement DDSI 2.1 (or 2.2), as is proven by, e.g.,
|
||||
the OpenSplice DDSI2 service, and they cannot rightly be considered ‘true’
|
||||
implementations of the DDSI 2.1 (or 2.2) standard.
|
||||
staying close to the letter of it. Recent developments at the OMG have resolved these
|
||||
issues and this mode is no longer of any value.
|
||||
|
||||
The default mode, *lax*, attempts to work around (most of) the deviations of other
|
||||
implementations, and generally provides good interoperability without any further
|
||||
settings. In lax mode, the Cyclone DDS not only accepts some invalid messages, it will
|
||||
settings. In lax mode, the Eclipse Cyclone DDS not only accepts some invalid messages, it will
|
||||
even transmit them. The consequences for interoperability of not doing this are simply
|
||||
too severe. It should be noted that if one configures two Cyclone DDS processes with
|
||||
too severe. It should be noted that if one configures two Eclipse Cyclone DDS processes with
|
||||
different compliancy modes, the one in the stricter mode will complain about messages
|
||||
sent by the one in the less strict mode.
|
||||
|
||||
|
@ -1095,7 +1090,7 @@ establish bidirectional communication between the two.
|
|||
|
||||
Disposing data may also cause problems, as RTI DDS leaves out the serialised key value
|
||||
and instead expects the reader to rely on an embedded hash of the key value. In the
|
||||
strict modes, Cyclone DDS requires a proper key value to be supplied; in the relaxed
|
||||
strict modes, Eclipse Cyclone DDS requires a proper key value to be supplied; in the relaxed
|
||||
mode, it is willing to accept key hash, provided it is of a form that contains the key
|
||||
values in an unmangled form.
|
||||
|
||||
|
@ -1106,14 +1101,14 @@ maximum length larger than 11 bytes. See the DDSI specification for details.
|
|||
|
||||
In *strict* mode, there is interoperation with RTI DDS, but at the cost of incredibly
|
||||
high CPU and network load, caused by a Heartbeats and AckNacks going back-and-forth
|
||||
between a reliable RTI DDS data writer and a reliable Cyclone DDS data reader. The
|
||||
problem is that once Cyclone DDS informs the RTI writer that it has received all data
|
||||
between a reliable RTI DDS data writer and a reliable Eclipse Cyclone DDS data reader. The
|
||||
problem is that once Eclipse Cyclone DDS informs the RTI writer that it has received all data
|
||||
(using a valid AckNack message), the RTI writer immediately publishes a message listing
|
||||
the range of available sequence numbers and requesting an acknowledgement, which becomes
|
||||
an endless loop.
|
||||
|
||||
There is furthermore also a difference of interpretation of the meaning of the
|
||||
‘autodispose_unregistered_instances’ QoS on the writer. Cyclone DDS aligns with
|
||||
‘autodispose_unregistered_instances’ QoS on the writer. Eclipse Cyclone DDS aligns with
|
||||
OpenSplice.
|
||||
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
|
||||
Cyclone DDS C API Reference
|
||||
==========================
|
||||
Eclipse Cyclone DDS C API Reference
|
||||
===================================
|
||||
|
||||
.. doxygenindex::
|
||||
:project: ddsc_api
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
|
||||
.. CycloneDDS documentation master file
|
||||
.. Eclipse Cyclone DDS documentation master file
|
||||
|
||||
Welcome to CycloneDDS's documentation!
|
||||
=====================================
|
||||
Welcome to Eclipse Cyclone DDS's documentation!
|
||||
===============================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
@ -20,6 +20,7 @@ Welcome to CycloneDDS's documentation!
|
|||
|
||||
GettingStartedGuide/index
|
||||
ddsc
|
||||
config
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
|
|
@ -23,24 +23,26 @@ Examples
|
|||
Configuration
|
||||
*************
|
||||
|
||||
Cyclone DDS has various configuration parameters and comes with a default built-in configuration.
|
||||
To run an example, or any application that uses Cyclone DDS for its data exchange, this default
|
||||
configuration is usually fine and no further action is required.
|
||||
Eclipse Cyclone DDS has various configuration parameters and comes with a default built-in
|
||||
configuration. To run an example, or any application that uses Eclipse Cyclone DDS for its data
|
||||
exchange, this default configuration is usually fine and no further action is required.
|
||||
|
||||
Configuration parameters for CycloneDDS are expressed in XML and grouped together in a single XML file.
|
||||
To use a custom XML configuration in an application, the ``CYCLONEDDS_URI`` environment variable needs
|
||||
to be set prior to starting the application and pointed to the location of the configuration file to
|
||||
be used.
|
||||
Configuration parameters for Eclipse CycloneDDS are expressed in XML and grouped together in a
|
||||
single XML file. To use a custom XML configuration in an application, the ``CYCLONEDDS_URI``
|
||||
environment variable needs to be set prior to starting the application and pointed to the location
|
||||
of the configuration file to be used.
|
||||
|
||||
| *Example*
|
||||
| **Windows:** ``set CYCLONEDDS_URI=file://%USERPROFILE%/CycloneDDS/my-config.xml``
|
||||
| **Linux:** ``export CYCLONEDDS_URI="file://$HOME/CycloneDDS/my-config.xml"``
|
||||
|
||||
The CycloneDDS installation comes with a set of standard configuration files for common use cases.
|
||||
You update existing configuration files or create your own by using the CycloneDDS Configurator tool,
|
||||
which provides context-sensitive help on available configuration parameters and their applicability.
|
||||
The Eclipse CycloneDDS installation comes with a configuration file that corresponds to the default
|
||||
behaviour. You can modify it or add your using any text or XML editor, or using by using the
|
||||
Eclipse CycloneDDS Configurator tool, which provides context-sensitive help on available
|
||||
configuration parameters and their applicability.
|
||||
|
||||
You can start the CycloneDDS Configuration tool through the CycloneDDS Launcher, or from your command-prompt
|
||||
by entering the tools directory and running ``java -jar cycloneddsconf.jar``. The default location of the tools
|
||||
directory is ``/usr/share/CycloneDDS/tools`` on Linux or ``C:\Program Files\ADLINK\Vortex DDS\share\CycloneDDS\tools``
|
||||
on Windows.
|
||||
One very important part of the configuration settings are the "tracing" settings: these allow
|
||||
letting Eclipse Cyclone DDS trace very detailed information to a file, and this includes the actual
|
||||
configuration settings in use, including all those that are set at the default. When editing
|
||||
configuration files by hand, this overview can be very useful. Increasing the Verbosity from
|
||||
"warning" to, e.g., "config" already suffices for getting this information written to the log.
|
||||
|
|
|
@ -16,7 +16,7 @@ Description
|
|||
***********
|
||||
|
||||
The basic HelloWorld example is used to illustrate the necessary steps to setup DCPS entities.
|
||||
Note it is also used in the Getting Started Guide to explain the usage of CycloneDDS.
|
||||
Note it is also used in the Getting Started Guide to explain the usage of Eclipse Cyclone DDS.
|
||||
|
||||
Design
|
||||
******
|
||||
|
|
|
@ -50,11 +50,6 @@ public class Compiler
|
|||
|
||||
try
|
||||
{
|
||||
if (!LicenseMgr.checkout (Project.nameCaps + "_IDLC"))
|
||||
{
|
||||
System.exit (1);
|
||||
}
|
||||
|
||||
String pathSep = System.getProperty ("file.separator");
|
||||
String outpath = (opts.outputdir == null) ? "" : opts.outputdir + pathSep;
|
||||
String fileRoot;
|
||||
|
@ -98,7 +93,7 @@ public class Compiler
|
|||
{
|
||||
System.err.println
|
||||
("Input IDL file " + idl.getPath () + " is not valid");
|
||||
licenseCheckAndExit (1);
|
||||
System.exit (1);
|
||||
}
|
||||
fileRoot =
|
||||
idl.getName ().substring (0, idl.getName ().lastIndexOf ('.'));
|
||||
|
@ -109,12 +104,12 @@ public class Compiler
|
|||
if (!ppstatus.isOK ())
|
||||
{
|
||||
System.err.println ("Error: At " + ppstatus.getFilename () + ":" + ppstatus.getLine () + ", " + ppstatus.getMessage ());
|
||||
licenseCheckAndExit(1);
|
||||
System.exit(1);
|
||||
}
|
||||
if (opts.pponly)
|
||||
{
|
||||
System.out.println (ppresult.toCharArray ());
|
||||
licenseCheckAndExit (0);
|
||||
System.exit (0);
|
||||
}
|
||||
|
||||
ANTLRInputStream input =
|
||||
|
@ -136,7 +131,7 @@ public class Compiler
|
|||
System.out.println (t.getText ());
|
||||
}
|
||||
}
|
||||
licenseCheckAndExit (0);
|
||||
System.exit (0);
|
||||
}
|
||||
|
||||
params.linetab =
|
||||
|
@ -149,7 +144,7 @@ public class Compiler
|
|||
ParserRuleContext tree = (ParserRuleContext)parser.specification ();
|
||||
if (parser.getNumberOfSyntaxErrors () != 0)
|
||||
{
|
||||
licenseCheckAndExit (1);
|
||||
System.exit (1);
|
||||
}
|
||||
if (opts.dumptree)
|
||||
{
|
||||
|
@ -164,7 +159,7 @@ public class Compiler
|
|||
jd.setModalityType (java.awt.Dialog.ModalityType.APPLICATION_MODAL);
|
||||
jd.setVisible (true);
|
||||
}
|
||||
licenseCheckAndExit(0);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
params.symtab = new SymbolTable ();
|
||||
|
@ -172,18 +167,18 @@ public class Compiler
|
|||
gst.visit (tree);
|
||||
if (gst.getErrorCount () != 0)
|
||||
{
|
||||
licenseCheckAndExit (1);
|
||||
System.exit (1);
|
||||
}
|
||||
if (gst.unresolvedSymbols ())
|
||||
{
|
||||
licenseCheckAndExit (1);
|
||||
System.exit (1);
|
||||
}
|
||||
|
||||
if (opts.dumpsymbols)
|
||||
{
|
||||
System.out.println ("Symbol table pass complete, symbols are:");
|
||||
params.symtab.dump ();
|
||||
licenseCheckAndExit (0);
|
||||
System.exit (0);
|
||||
}
|
||||
|
||||
params.basename = fileRoot;
|
||||
|
@ -209,13 +204,13 @@ public class Compiler
|
|||
catch (IOException x)
|
||||
{
|
||||
System.err.format("IOException: %s%n", x);
|
||||
licenseCheckAndExit (1);
|
||||
System.exit (1);
|
||||
}
|
||||
}
|
||||
catch (RecognitionException r)
|
||||
{
|
||||
r.printStackTrace ();
|
||||
licenseCheckAndExit (1);
|
||||
System.exit (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -223,16 +218,6 @@ public class Compiler
|
|||
{
|
||||
e.printStackTrace ();
|
||||
}
|
||||
finally
|
||||
{
|
||||
LicenseMgr.checkin ();
|
||||
}
|
||||
}
|
||||
|
||||
private static void licenseCheckAndExit (int exitStatus)
|
||||
{
|
||||
LicenseMgr.checkin ();
|
||||
System.exit (exitStatus);
|
||||
}
|
||||
|
||||
private static void version ()
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
package org.eclipse.cyclonedds;
|
||||
|
||||
class LicenseMgr
|
||||
{
|
||||
static boolean checkout (String feature)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static boolean checkin ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,304 +0,0 @@
|
|||
/*
|
||||
* Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
package org.eclipse.cyclonedds;
|
||||
|
||||
import com.reprisesoftware.rlm.RlmHandle;
|
||||
import com.reprisesoftware.rlm.RlmLicense;
|
||||
import com.reprisesoftware.rlm.RlmException;
|
||||
|
||||
import java.util.Properties;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.File;
|
||||
|
||||
class LicenseMgr
|
||||
{
|
||||
private static final String FS = System.getProperty ("file.separator");
|
||||
|
||||
private static final String LIC_PROPS_FILE = "license.properties";
|
||||
private static final String LIC_FEATURE = Project.nameCaps + "_IDLC";
|
||||
private static final String LIC_VERSION = "#VERSION#";
|
||||
private static final String LIC_REL_PATH = "etc";
|
||||
private static final String LIC_FILE_NAME = "license.lic";
|
||||
private static final String PROJECT_HOME_PROP = Project.nameCaps + "_HOME";
|
||||
|
||||
private static final String LIC_RLM_PROP = "RLM_LICENSE";
|
||||
private static final String LIC_LOC_PROP = "prismtech_LICENSE";
|
||||
|
||||
private static RlmLicense license = null;
|
||||
private static RlmHandle handle = null;
|
||||
|
||||
private static String vlHome = System.getProperty (PROJECT_HOME_PROP);
|
||||
private static String licPropsPath;
|
||||
private static String defaultLic;
|
||||
private static String licRelPath;
|
||||
private static String licLoc = null; // Final var that contains where it is
|
||||
|
||||
private LicenseMgr ()
|
||||
{
|
||||
}
|
||||
|
||||
private static boolean getProjectHome()
|
||||
{
|
||||
// Use the property, if null then fall back to the env
|
||||
if (vlHome == null)
|
||||
{
|
||||
vlHome = System.getenv(Project.nameCaps + "_HOME");
|
||||
if (vlHome == null)
|
||||
{
|
||||
System.err.println (Project.nameCaps + "_HOME environment variable or property must be set");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Need to re-ajust each time we get osplHome
|
||||
setupGlobals();
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void setupGlobals()
|
||||
{
|
||||
licRelPath = vlHome + FS + LIC_REL_PATH + FS;
|
||||
licPropsPath = licRelPath + LIC_PROPS_FILE;
|
||||
defaultLic = licRelPath + LIC_FILE_NAME;
|
||||
}
|
||||
|
||||
|
||||
/* Locations for license:
|
||||
1 : ${PROJECTNAME}_HOME/etc/ANY.lic
|
||||
2 : ../../../license/ANY.lic
|
||||
3 : Read from environment variable prismtech_LICENSE or RLM_LICENSE
|
||||
*/
|
||||
|
||||
static boolean checkout (String feature)
|
||||
{
|
||||
try
|
||||
{
|
||||
String licLocProp = System.getProperty (LIC_LOC_PROP);
|
||||
if (licLocProp == null)
|
||||
{
|
||||
licLocProp = System.getenv(LIC_LOC_PROP);
|
||||
}
|
||||
|
||||
if (licLocProp != null && licLocProp.length() != 0)
|
||||
{
|
||||
File f = new File(licLocProp);
|
||||
if (f.exists())
|
||||
{
|
||||
// Property pointed at a license file directly
|
||||
licLoc = licLocProp;
|
||||
}
|
||||
else
|
||||
{
|
||||
String licFileLoc = licLocProp+FS+LIC_FILE_NAME;
|
||||
f = new File(licFileLoc);
|
||||
if (f.exists())
|
||||
{
|
||||
// Property pointed at the directory containing
|
||||
// a license.lic
|
||||
licLoc = licFileLoc;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try whatever they put on the property as it could
|
||||
// be the server setting
|
||||
licLoc = licLocProp;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// check RLM_LICENSE
|
||||
String licRlmProp = System.getProperty (LIC_RLM_PROP);
|
||||
|
||||
if (licRlmProp == null)
|
||||
{
|
||||
licRlmProp = System.getenv(LIC_RLM_PROP);
|
||||
}
|
||||
|
||||
if (licRlmProp != null && licRlmProp.length() != 0)
|
||||
{
|
||||
File f = new File(licRlmProp);
|
||||
if (f.exists())
|
||||
{
|
||||
// Property pointed at a license file directly
|
||||
licLoc = licRlmProp;
|
||||
}
|
||||
else
|
||||
{
|
||||
String licFileLoc = licRlmProp+FS+LIC_FILE_NAME;
|
||||
f = new File(licFileLoc);
|
||||
if (f.exists())
|
||||
{
|
||||
// Property pointed at the directory containing
|
||||
// a license.lic
|
||||
licLoc = licFileLoc;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try whatever they put on the property as it could
|
||||
// be the server setting
|
||||
licLoc = licRlmProp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// NOTE: VortexLite - This section is not used??
|
||||
if (licLoc == null)
|
||||
{
|
||||
// No Property set lets check for a properties file
|
||||
FileInputStream fis = null;
|
||||
Properties licProps = null;
|
||||
|
||||
if (!getProjectHome())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check for license file location in properties file
|
||||
File f = new File(licPropsPath);
|
||||
if (f.exists())
|
||||
{
|
||||
licProps = new Properties ();
|
||||
try
|
||||
{
|
||||
fis = new FileInputStream (licPropsPath);
|
||||
licProps.load (fis);
|
||||
}
|
||||
catch (FileNotFoundException ex)
|
||||
{} // Ignore
|
||||
finally
|
||||
{
|
||||
fis.close();
|
||||
}
|
||||
String licFileLoc = licProps.getProperty (LIC_LOC_PROP);
|
||||
if (licFileLoc == null)
|
||||
{
|
||||
licFileLoc = System.getenv(LIC_LOC_PROP);
|
||||
}
|
||||
if (licFileLoc != null)
|
||||
{
|
||||
// Property pointed at the directory containing it
|
||||
licLoc = licFileLoc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (licLoc == null)
|
||||
{
|
||||
// No valid source set or found use the default as
|
||||
// ${PROJECTNAME}_HOME/etc/license.lic as fall back
|
||||
if (!getProjectHome())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
File f = new File(defaultLic);
|
||||
if (f.exists())
|
||||
{
|
||||
// Property pointed at the directory containing a license.lic
|
||||
licLoc = defaultLic;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try whatever they put on the property
|
||||
licLoc = licRelPath;
|
||||
}
|
||||
}
|
||||
|
||||
handle = new RlmHandle(licLoc, "", "");
|
||||
license = new RlmLicense(handle, feature, LIC_VERSION, 1);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// From Vortex_v2 there will be a license directory under Vortex_v2 where
|
||||
// a license can be installed for use by all products. If a valid license
|
||||
// is not found in the normal locations then we check this directory for a
|
||||
// valid license. The location of the Vortex_v2 directory will be set by
|
||||
// the release.com/release.bat file.
|
||||
|
||||
String altLicRelPath = vlHome + FS + ".." + FS + ".." + FS + ".." + FS + "license";
|
||||
String altDefaultLic = null;
|
||||
|
||||
if (altLicRelPath != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
altDefaultLic = altLicRelPath + FS + "license" + FS + LIC_FILE_NAME;
|
||||
File f = new File(altDefaultLic);
|
||||
if (f.exists())
|
||||
{
|
||||
// Property pointed at the directory containing a license.lic
|
||||
licLoc = altDefaultLic;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try whatever they put on the property
|
||||
licLoc = altLicRelPath;
|
||||
}
|
||||
handle = new RlmHandle(licLoc, "", "");
|
||||
license = new RlmLicense(handle, feature, LIC_VERSION, 1);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
System.err.println ("dds_idlc: License checkout failed!");
|
||||
System.err.print (" Caught " + ex2.getClass().getName() + ": ");
|
||||
System.err.println (ex2.getMessage());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.err.println ("dds_idlc: License checkout failed!");
|
||||
System.err.print (" Caught " + ex.getClass().getName() + ": ");
|
||||
System.err.println (ex.getMessage());
|
||||
}
|
||||
|
||||
// If we get here then we have not found a valid license
|
||||
if (license != null)
|
||||
{
|
||||
license.checkin ();
|
||||
}
|
||||
if (handle != null)
|
||||
{
|
||||
handle.close();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean checkin ()
|
||||
{
|
||||
if (license != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
license.checkin ();
|
||||
if (handle != null)
|
||||
{
|
||||
handle.close ();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.err.println ("dds_idlc: License checkin failed!");
|
||||
System.err.print (" Caught " + ex.getClass().getName() + ": ");
|
||||
System.err.println (ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -35,7 +35,8 @@ public class IdlcCmdOptions extends CmdOptions
|
|||
io.println (" -notopics Generate type definitions only");
|
||||
io.println (" -nostamp Do not timestamp generated code");
|
||||
io.println (" -lax Skip over structs containing unsupported datatypes");
|
||||
io.println (" -quiet Suppress console output other than error messages");
|
||||
io.println (" -quiet Suppress console output other than error messages (default)");
|
||||
io.println (" -verbose Enable console ouptut other than error messages");
|
||||
io.println (" -map_wide Map the unsupported wchar and wstring types to char and string");
|
||||
io.println (" -map_longdouble Map the unsupported long double type to double");
|
||||
}
|
||||
|
@ -72,6 +73,10 @@ public class IdlcCmdOptions extends CmdOptions
|
|||
{
|
||||
quiet = true;
|
||||
}
|
||||
else if (arg1.equals ("-verbose") || arg1.equals ("-v"))
|
||||
{
|
||||
quiet = false;
|
||||
}
|
||||
else if (arg1.equals ("-lax"))
|
||||
{
|
||||
lax = true;
|
||||
|
@ -111,7 +116,7 @@ public class IdlcCmdOptions extends CmdOptions
|
|||
public boolean allstructs;
|
||||
public boolean notopics;
|
||||
public boolean nostamp;
|
||||
public boolean quiet;
|
||||
public boolean quiet = true;
|
||||
public boolean lax;
|
||||
public boolean mapwide;
|
||||
public boolean mapld;
|
||||
|
|
|
@ -34,7 +34,7 @@ public class Idlcpp
|
|||
|
||||
if (opts.version)
|
||||
{
|
||||
System.out.print ("Cyclone DDS ");
|
||||
System.out.print ("Eclipse Cyclone DDS ");
|
||||
System.out.println ("IDL to C++ compiler v" + Project.version);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -9,20 +9,9 @@
|
|||
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
|
||||
banner (file, date, version) ::= <<
|
||||
/*
|
||||
* Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
/****************************************************************
|
||||
|
||||
Generated by Cyclone DDS IDL to C Translator
|
||||
Generated by Eclipse Cyclone DDS IDL to C Translator
|
||||
File name: <file>.c
|
||||
Source: <file>.idl
|
||||
<if(date)> Generated: <date><endif>
|
||||
|
|
|
@ -9,20 +9,9 @@
|
|||
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
|
||||
banner (file, date, version) ::= <<
|
||||
/*
|
||||
* Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
/****************************************************************
|
||||
|
||||
Generated by Cyclone DDS IDL to C Translator
|
||||
Generated by Eclipse Cyclone DDS IDL to C Translator
|
||||
File name: <file>.h
|
||||
Source: <file>.idl
|
||||
<if(date)> Generated: <date><endif>
|
||||
|
|
|
@ -95,17 +95,6 @@
|
|||
<destinationFile>target/generated-sources/idlc/org/eclipse/cyclonedds/Project.java</destinationFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-LicenseMgr</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceFile>${basedir}/org/eclipse/cyclonedds/LicenseMgr.java.dummy</sourceFile>
|
||||
<destinationFile>target/generated-sources/idlc/org/eclipse/cyclonedds/LicenseMgr.java</destinationFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -1,14 +1,3 @@
|
|||
/*
|
||||
* Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
/* ::[[ @(#) getopt.c 1.5 89/03/11 05:40:23 ]]:: */
|
||||
#ifndef LINT
|
||||
static const char Id[] = "$Id: os_stdlib_getopt.c,v 1.2 2008-11-17 09:53:45 hansv Exp $";
|
||||
|
|
|
@ -13,7 +13,7 @@ find_package(Java 1.8 REQUIRED)
|
|||
include(UseJava)
|
||||
set(CONFJAR_TARGET "${CMAKE_PROJECT_NAME_SMALL}conf")
|
||||
|
||||
set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.8" "-target" "1.8")
|
||||
#set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.8" "-target" "1.8" -Xlint:deprecation)
|
||||
|
||||
# Oddly enough, add_jar can't deal with a resource having an absolute path (experienced on Windows), so
|
||||
# generate into the list-dir.
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -103,153 +103,6 @@ public class Config {
|
|||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the release information from a file named RELEASEINFO located in
|
||||
* the etc directory of the installation.
|
||||
*
|
||||
* @return true if the release information could be loaded, false otherwise.
|
||||
*/
|
||||
public boolean loadReleaseInfo(){
|
||||
FileInputStream fis = null;
|
||||
if (config == null){
|
||||
config = new Properties ();
|
||||
}
|
||||
boolean result = true;
|
||||
String homeDir = System.getenv("OSPL_HOME");
|
||||
String separator = System.getProperty("file.separator");
|
||||
File releaseFile = new File (homeDir + separator + "etc" + separator + "RELEASEINFO");
|
||||
if(releaseFile.exists()) {
|
||||
try {
|
||||
fis = new FileInputStream(releaseFile);
|
||||
config.load(fis);
|
||||
} catch (FileNotFoundException e) {
|
||||
result = false;
|
||||
} catch (IOException e) {
|
||||
result = false;
|
||||
} finally {
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException ie) {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we don't have a value for the version property then try
|
||||
// to load the value from the development tree RELEASE file
|
||||
String version = config.getProperty("PACKAGE_VERSION");
|
||||
if (version == null) {
|
||||
releaseFile = new File (homeDir + separator + "release_info" + separator + "RELEASE");
|
||||
if(releaseFile.exists()) {
|
||||
try {
|
||||
fis = new FileInputStream(releaseFile);
|
||||
config.load(fis);
|
||||
} catch (FileNotFoundException e) {
|
||||
result = false;
|
||||
} catch (IOException e) {
|
||||
result = false;
|
||||
} finally {
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException ie) {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!result){
|
||||
config = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the default configuration. This located in the home directory of
|
||||
* the user in the '.splice_tooling.properties' file.
|
||||
*
|
||||
* @return true if the default configuration could be loaded, false
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean loadDefault(){
|
||||
String key, value;
|
||||
boolean result = true;
|
||||
String homeDir = System.getProperty("user.home");
|
||||
String separator = System.getProperty("file.separator");
|
||||
config = new Properties();
|
||||
FileInputStream fis = null;
|
||||
|
||||
// Load the release information so that we have the PACKAGE_VERSION property.
|
||||
result = loadReleaseInfo();
|
||||
|
||||
if (result) {
|
||||
String version = config.getProperty("PACKAGE_VERSION");
|
||||
if (version != null) {
|
||||
version = version.replaceAll("\"", "");
|
||||
version = new String ("." + version);
|
||||
} else {
|
||||
version = new String ("");
|
||||
}
|
||||
configFile = new File(homeDir + separator + ".ospl_tooling.properties" + version);
|
||||
} else {
|
||||
configFile = new File(homeDir + separator + ".ospl_tooling.properties");
|
||||
// Reset the result flag.
|
||||
result = true;
|
||||
}
|
||||
|
||||
if(!(configFile.exists())) {
|
||||
try {
|
||||
configFile.createNewFile();
|
||||
} catch (IOException e) {
|
||||
result = false;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
fis = new FileInputStream(configFile);
|
||||
config.load(fis);
|
||||
Properties newConfig = new Properties(config);
|
||||
if(validator != null){
|
||||
Iterator<Object> iter = config.keySet().iterator();
|
||||
|
||||
while(iter.hasNext()){
|
||||
key = (String)iter.next();
|
||||
value = config.getProperty(key);
|
||||
value = validator.getValidatedValue(key, value);
|
||||
|
||||
if(value == null){
|
||||
newConfig.remove(key);
|
||||
} else {
|
||||
newConfig.setProperty(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
config = newConfig;
|
||||
} catch (FileNotFoundException e) {
|
||||
result = false;
|
||||
} catch (IOException e) {
|
||||
result = false;
|
||||
} finally {
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException ie) {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!result){
|
||||
config = null;
|
||||
configFile = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Loads the configuration from the supplied URI.
|
||||
*
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
package org.eclipse.cyclonedds.common.util;
|
||||
|
||||
public class ConfigModeIntializer {
|
||||
|
||||
public static final String COMMUNITY = "COMMUNITY";
|
||||
public static final String COMMERCIAL = "COMMERCIAL";
|
||||
public static final int COMMUNITY_MODE = 1;
|
||||
public static final int COMMERCIAL_MODE = 2;
|
||||
public static final int COMMUNITY_MODE_FILE_OPEN = 3;
|
||||
public static final int LITE_MODE = 4;
|
||||
public static int CONFIGURATOR_MODE = COMMERCIAL_MODE;
|
||||
|
||||
public static void setMode(int mode) {
|
||||
CONFIGURATOR_MODE = mode;
|
||||
}
|
||||
|
||||
public int getMode() {
|
||||
return CONFIGURATOR_MODE;
|
||||
}
|
||||
|
||||
}
|
|
@ -22,8 +22,7 @@ import javax.swing.JOptionPane;
|
|||
|
||||
/**
|
||||
* Base class for tooling initializers. Its responsibilities are to initialize
|
||||
* logging facilities according to commandline parameters and to validate
|
||||
* whether the correct Java Vitual Machine version is used.
|
||||
* logging facilities according to commandline parameters.
|
||||
*
|
||||
* @date Sep 1, 2004
|
||||
*/
|
||||
|
@ -48,14 +47,6 @@ public class Initializer {
|
|||
if(args.length > 0){
|
||||
Report.getInstance().writeInfoLog("Reading configuration from " + args[0] + ".");
|
||||
result = Config.getInstance().load(args[0]);
|
||||
|
||||
if(!result){
|
||||
Report.getInstance().writeInfoLog("Applying default configuration.");
|
||||
result = Config.getInstance().loadDefault();
|
||||
}
|
||||
}
|
||||
else{
|
||||
result = Config.getInstance().loadDefault();
|
||||
}
|
||||
|
||||
if(!result){
|
||||
|
@ -95,75 +86,4 @@ public class Initializer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates whether a compatible Java virtual machine is used.
|
||||
*
|
||||
* The version of Java must be >= 1.4 and should be >= 1.5.0. If the
|
||||
* used version is &st; 1.4, the application exits with an error message. If
|
||||
* 1.4 &st;= version &st; 1.5, false is returned, but the application
|
||||
* proceeds.
|
||||
*
|
||||
* @return true, if java version >= 1.5 and false otherwise.
|
||||
*/
|
||||
public boolean validateJVMVersion(){
|
||||
int token;
|
||||
boolean result = true;
|
||||
|
||||
String version = System.getProperty("java.version");
|
||||
StringTokenizer tokenizer = new StringTokenizer(version, ".");
|
||||
|
||||
if(tokenizer.hasMoreTokens()){
|
||||
token = Integer.parseInt(tokenizer.nextToken());
|
||||
|
||||
if(token < 1){
|
||||
this.printVersionErrorAndExit(version);
|
||||
}
|
||||
|
||||
if(tokenizer.hasMoreTokens()){
|
||||
token = Integer.parseInt(tokenizer.nextToken());
|
||||
|
||||
if(token < 4){
|
||||
this.printVersionErrorAndExit(version);
|
||||
} else if(token == 4){
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.printVersionErrorAndExit(version);
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.printVersionErrorAndExit(version);
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints JVM version demands as well as the used version and exits the
|
||||
* application.
|
||||
*/
|
||||
private void printVersionErrorAndExit(String version){
|
||||
System.err.println("Your Java version is '" + version + "', but version >= '1.4' is required.\nBailing out...");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a Java version warning.
|
||||
*
|
||||
* @param parent
|
||||
* The GUI parent which must be used as parent for displaying the
|
||||
* message. If the supplied component == null, the version
|
||||
* warning is displayed on standard out (System.out).
|
||||
*/
|
||||
public void showVersionWarning(Component parent){
|
||||
if(parent != null){
|
||||
JOptionPane.showMessageDialog(parent, "You are using Java version " + System.getProperty("java.version") + ",\nbut version >= 1.5.0 is recommended.", "Warning", JOptionPane.WARNING_MESSAGE);
|
||||
} else{
|
||||
System.err.println("You are using Java version " + System.getProperty("java.version")
|
||||
+ ",\nbut version >= 1.5.0 is recommended.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ public class SpliceConfig extends Initializer {
|
|||
String uri = null;
|
||||
|
||||
SpliceConfig t = new SpliceConfig();
|
||||
t.validateJVMVersion();
|
||||
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
if ("-noredirect".equals(args[i])) {
|
||||
|
|
|
@ -32,7 +32,6 @@ import javax.xml.transform.TransformerFactory;
|
|||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
import org.eclipse.cyclonedds.common.util.Report;
|
||||
import org.eclipse.cyclonedds.config.meta.MetaAttribute;
|
||||
import org.eclipse.cyclonedds.config.meta.MetaConfiguration;
|
||||
|
@ -100,161 +99,6 @@ public class DataConfiguration {
|
|||
}
|
||||
this.initExisting(repair);
|
||||
this.file = file;
|
||||
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE) {
|
||||
// The following code is document validation specific to OpenSplice
|
||||
int currentMode = ConfigModeIntializer.CONFIGURATOR_MODE;
|
||||
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMERCIAL_MODE) {
|
||||
ConfigModeIntializer.setMode(ConfigModeIntializer.COMMERCIAL_MODE);
|
||||
}
|
||||
/* correct service tags */
|
||||
DataElement dataDomain = findDataElement(this.rootElement, "Domain");
|
||||
ArrayList<DataElement> domainServices = new ArrayList<DataElement>();
|
||||
/* collect all service tags */
|
||||
for (DataNode dn : dataDomain.getChildren()) {
|
||||
if (dn instanceof DataElement) {
|
||||
if (dn.getNode().getNodeName().equals("Service")) {
|
||||
domainServices.add((DataElement) dn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<DataElement> tmpServices = new ArrayList<DataElement>(services);
|
||||
ArrayList<DataElement> tmpDomainServices = new ArrayList<DataElement>(domainServices);
|
||||
ArrayList<MetaNode> comServices = new ArrayList<MetaNode>();
|
||||
/* domain element is not a service */
|
||||
tmpServices.remove(dataDomain);
|
||||
|
||||
for (DataElement de : domainServices) {
|
||||
if (dataDomain != de) {
|
||||
String domainserviceName = de.getNode().getAttributes().getNamedItem("name").getNodeValue();
|
||||
for (DataElement del : services) {
|
||||
Node node = del.getNode().getAttributes().getNamedItem("name");
|
||||
if (node != null) {
|
||||
String serviceName = node.getNodeValue();
|
||||
if (serviceName.equals(domainserviceName)) {
|
||||
tmpDomainServices.remove(de);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* tmpDomainServices now contains a list of services that are
|
||||
* not in the configuration file but which are configured in the
|
||||
* domain tag
|
||||
*/
|
||||
|
||||
for (DataElement de : tmpDomainServices) {
|
||||
String serviceName = de.getNode().getAttributes().getNamedItem("name").getNodeValue();
|
||||
MetaNode[] mn = ((MetaElement) this.getRootElement().getMetadata()).getChildren();
|
||||
|
||||
for (MetaNode m : mn) {
|
||||
if (m instanceof MetaElement) {
|
||||
MetaElement metaDomainService = findMetaElement((MetaElement) rootElement.getMetadata(),
|
||||
"Service");
|
||||
MetaElement maDomainCommand = findMetaElement(metaDomainService, "Command");
|
||||
MetaAttribute maServiceName = findMetaAttribute((MetaElement) m, "name");
|
||||
if (maServiceName != null && maDomainCommand != null) {
|
||||
DataValue serviceNameValue = findDataValueforMetaValue(de, maServiceName.getValue());
|
||||
|
||||
DataValue domainCommandValue = findDataValueforMetaValue(de,
|
||||
((MetaValue) maDomainCommand.getChildren()[0]));
|
||||
String name = getServiceForCommand((String) domainCommandValue.getValue());
|
||||
if (((MetaElement) m).getName().equals(name)) {
|
||||
/* we got the service we need to add */
|
||||
comServices.add(m);
|
||||
DataNode dn = this.addNodeWithDependency(rootElement, m);
|
||||
serviceNameValue = findDataValueforMetaValue((DataElement) dn, maServiceName
|
||||
.getValue());
|
||||
|
||||
/* set name for service Element */
|
||||
serviceNameValue.setValue(serviceName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (DataElement de : services) {
|
||||
if (dataDomain != de) {
|
||||
String serviceName = de.getNode().getAttributes().getNamedItem("name").getNodeValue();
|
||||
for (DataElement del : domainServices) {
|
||||
String domainserviceName = del.getNode().getAttributes().getNamedItem("name")
|
||||
.getNodeValue();
|
||||
if (serviceName.equals(domainserviceName)) {
|
||||
/*
|
||||
* found a match in both service and domain
|
||||
* elements remove it from the tmp services
|
||||
* object
|
||||
*/
|
||||
tmpServices.remove(de);
|
||||
MetaAttribute maDomainName = findMetaAttribute((MetaElement) del.getMetadata(), "name");
|
||||
DataValue domainNameValue = findDataValueforMetaValueInCurrentElement(del, maDomainName
|
||||
.getValue());
|
||||
this.serviceNames.add(domainNameValue);
|
||||
|
||||
MetaAttribute maServiceName = findMetaAttribute((MetaElement) de.getMetadata(), "name");
|
||||
DataValue serviceNameValue = findDataValueforMetaValue(de, maServiceName.getValue());
|
||||
this.serviceNames.add(serviceNameValue);
|
||||
|
||||
getServiceNames().add(serviceNameValue);
|
||||
getServiceNames().add(domainNameValue);
|
||||
|
||||
/* set dependencies */
|
||||
domainNameValue.addDataValueDependency(serviceNameValue);
|
||||
serviceNameValue.addDataValueDependency(domainNameValue);
|
||||
de.addDependency(del);
|
||||
del.addDependency(de);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConfigModeIntializer.setMode(currentMode);
|
||||
/*
|
||||
* tmpServices now contains all services that are missing from
|
||||
* the domain service element, we can add them now
|
||||
*/
|
||||
if ((!tmpDomainServices.isEmpty() || !tmpServices.isEmpty()) && !repair) {
|
||||
if (!tmpDomainServices.isEmpty() && !tmpServices.isEmpty()) {
|
||||
throw new DataException("There is/are " + tmpServices.size()
|
||||
+ " service(s) that is/are not configured in the Domain tag and "
|
||||
+ tmpDomainServices.size()
|
||||
+ " service element(s) that do not match a configured service");
|
||||
} else if (!tmpDomainServices.isEmpty()) {
|
||||
throw new DataException("There are " + tmpDomainServices.size()
|
||||
+ " service element(s) that do not match a configured service");
|
||||
} else {
|
||||
throw new DataException("There is/are " + tmpServices.size()
|
||||
+ " service(s) that is/are not configured in the Domain tag");
|
||||
}
|
||||
}
|
||||
|
||||
if (!tmpServices.isEmpty() && repair) {
|
||||
for (DataElement de : tmpServices) {
|
||||
String serviceName = de.getNode().getAttributes().getNamedItem("name").getNodeValue();
|
||||
createDomainServiceForSerivce(de, de.getMetadata(), serviceName);
|
||||
}
|
||||
}
|
||||
/* remove commerial items from xml tree in community mode */
|
||||
for (MetaNode m : comServices) {
|
||||
if (m.getVersion().equals(ConfigModeIntializer.COMMERCIAL)
|
||||
&& (currentMode == ConfigModeIntializer.COMMUNITY_MODE || currentMode == ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN)) {
|
||||
NodeList nl = this.getDocument().getElementsByTagName(
|
||||
((MetaElement) m).getName());
|
||||
for (int i = 0; i < nl.getLength(); i++) {
|
||||
Node child = nl.item(i);
|
||||
if (child != null) {
|
||||
child.getParentNode().removeChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SAXException se) {
|
||||
throw new DataException(se.getMessage());
|
||||
|
@ -352,9 +196,6 @@ public class DataConfiguration {
|
|||
|
||||
public void addNode(DataElement parent, MetaNode child) throws DataException {
|
||||
if((parent.getOwner().equals(this))){
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN) {
|
||||
ConfigModeIntializer.setMode(ConfigModeIntializer.COMMUNITY_MODE);
|
||||
}
|
||||
DataNode added = this.createDataForMeta(parent, child);
|
||||
|
||||
if(parent.equals(this.rootElement)){
|
||||
|
@ -372,9 +213,6 @@ public class DataConfiguration {
|
|||
public DataNode addNodeWithDependency(DataElement parent, MetaNode child) throws DataException {
|
||||
DataNode result = null;
|
||||
if ((parent.getOwner().equals(this))) {
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN) {
|
||||
ConfigModeIntializer.setMode(ConfigModeIntializer.COMMUNITY_MODE);
|
||||
}
|
||||
DataNode added = this.createDataForMeta(parent, child);
|
||||
|
||||
if (parent.equals(this.rootElement)) {
|
||||
|
@ -432,11 +270,6 @@ public class DataConfiguration {
|
|||
/* get the newly created domain element */
|
||||
dataDomain = (DataElement) addNodeWithDependency(dataDomain, metaDomainService);
|
||||
|
||||
if (metaNode.getVersion().equals(ConfigModeIntializer.COMMERCIAL)
|
||||
&& (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE || ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN)) {
|
||||
commercialServices.add(dataDomain.getNode());
|
||||
}
|
||||
|
||||
/*
|
||||
* find name and command DataValue objects for the domain element
|
||||
*/
|
||||
|
@ -581,7 +414,7 @@ public class DataConfiguration {
|
|||
|
||||
try{
|
||||
TransformerFactory tFactory = TransformerFactory.newInstance();
|
||||
tFactory.setAttribute("indent-number", new Integer(4));
|
||||
tFactory.setAttribute("indent-number", Integer.valueOf(4));
|
||||
Transformer transformer = tFactory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
|
||||
|
@ -863,10 +696,6 @@ public class DataConfiguration {
|
|||
throw new DataException("RootElement is 'null'.");
|
||||
}
|
||||
this.document.appendChild(domElement);
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE) {
|
||||
domElement.setAttribute("version", Double.toString(this.metadata.getVersion()));
|
||||
}
|
||||
|
||||
|
||||
this.rootElement = new DataElement(metaElement, domElement);
|
||||
this.rootElement.setOwner(this);
|
||||
|
|
|
@ -13,7 +13,6 @@ package org.eclipse.cyclonedds.config.data;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
import org.eclipse.cyclonedds.config.meta.MetaAttribute;
|
||||
import org.eclipse.cyclonedds.config.meta.MetaElement;
|
||||
import org.eclipse.cyclonedds.config.meta.MetaNode;
|
||||
|
@ -82,10 +81,6 @@ public class DataElement extends DataNode {
|
|||
}
|
||||
|
||||
if(nodeMeta instanceof MetaElement){
|
||||
if (nodeMeta.getVersion().equals(ConfigModeIntializer.COMMERCIAL)
|
||||
&& (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE || ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN)) {
|
||||
addToDOM = 0;
|
||||
}
|
||||
if(count == ((MetaElement)nodeMeta).getMaxOccurrences()){
|
||||
throw new DataException("Maximum number of occurrences for " +
|
||||
((MetaElement)nodeMeta).getName()+ " reached.");
|
||||
|
@ -99,10 +94,6 @@ public class DataElement extends DataNode {
|
|||
this.node.appendChild(textNode);
|
||||
}
|
||||
} else if(nodeMeta instanceof MetaAttribute){
|
||||
if (nodeMeta.getVersion().equals(ConfigModeIntializer.COMMERCIAL)
|
||||
&& (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE || ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN)) {
|
||||
addToDOM = 0;
|
||||
}
|
||||
if (addToDOM == 1) {
|
||||
((Element)this.node).setAttributeNode((Attr)node.getNode());
|
||||
}
|
||||
|
@ -170,29 +161,15 @@ public class DataElement extends DataNode {
|
|||
if(count == ((MetaElement)nodeMeta).getMinOccurrences()){
|
||||
throw new DataException("Minimum number of occurrences for " +
|
||||
((MetaElement)nodeMeta).getName()+ " reached.");
|
||||
} else if (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMERCIAL_MODE) {
|
||||
} else
|
||||
((Element) this.node).removeChild(node.getNode());
|
||||
} else {
|
||||
if (!nodeMeta.getVersion().equals(
|
||||
ConfigModeIntializer.COMMERCIAL)) {
|
||||
if (!node.getOwner().getCommercialServices()
|
||||
.contains(node.getNode())) {
|
||||
((Element) this.node).removeChild(node.getNode());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(nodeMeta instanceof MetaAttribute){
|
||||
if(((MetaAttribute)nodeMeta).isRequired()){
|
||||
throw new DataException("Cannot remove required attribute " +
|
||||
((MetaAttribute)nodeMeta).getName()+ ".");
|
||||
} else if (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMERCIAL_MODE) {
|
||||
} else {
|
||||
((Element) this.node)
|
||||
.removeAttributeNode((Attr) node.getNode());
|
||||
} else {
|
||||
if (!nodeMeta.getVersion().equals(
|
||||
ConfigModeIntializer.COMMERCIAL)) {
|
||||
((Element)this.node).removeAttributeNode((Attr)node.getNode());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
((Element)this.node).removeChild(node.getNode());
|
||||
|
|
|
@ -17,8 +17,8 @@ public class MetaAttribute extends MetaNode {
|
|||
private MetaValue value;
|
||||
|
||||
public MetaAttribute(String doc, String name, boolean required,
|
||||
MetaValue value, String version, String dimension) {
|
||||
super(doc, version, dimension);
|
||||
MetaValue value, String dimension) {
|
||||
super(doc, dimension);
|
||||
this.name = name;
|
||||
this.required = required;
|
||||
this.value = value;
|
||||
|
@ -88,7 +88,6 @@ public class MetaAttribute extends MetaNode {
|
|||
result += "\nAttribute\n";
|
||||
result += "-Name: " + this.name + "\n";
|
||||
result += "-Required: " + this.required + "\n";
|
||||
result += "-Version: " + this.version + "\n";
|
||||
result += "-Value: " + value.toString();
|
||||
|
||||
return result;
|
||||
|
|
|
@ -22,7 +22,6 @@ import javax.xml.parsers.DocumentBuilder;
|
|||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
import org.eclipse.cyclonedds.common.util.Report;
|
||||
import org.w3c.dom.Attr;
|
||||
import org.w3c.dom.Document;
|
||||
|
@ -36,16 +35,13 @@ import org.xml.sax.SAXParseException;
|
|||
|
||||
public class MetaConfiguration {
|
||||
|
||||
private double version;
|
||||
private final MetaElement rootElement;
|
||||
private final ArrayList<MetaElement> services;
|
||||
private static HashMap<String, String> serviceMapping = new HashMap<String, String>();
|
||||
private static final double LATEST_VERSION_OSPL = 6.1;
|
||||
private static MetaConfiguration instance = null;
|
||||
|
||||
|
||||
private MetaConfiguration(double version, MetaElement rootElement, ArrayList<MetaElement> services) {
|
||||
this.version = version;
|
||||
private MetaConfiguration(MetaElement rootElement, ArrayList<MetaElement> services) {
|
||||
this.rootElement = rootElement;
|
||||
this.services = services;
|
||||
}
|
||||
|
@ -76,10 +72,6 @@ public class MetaConfiguration {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
public double getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
private static MetaConfiguration load(String fileName){
|
||||
MetaConfiguration config = null;
|
||||
|
||||
|
@ -87,9 +79,6 @@ public class MetaConfiguration {
|
|||
|
||||
if(is != null){
|
||||
config = load(is);
|
||||
if (config != null) {
|
||||
config.version = LATEST_VERSION_OSPL;
|
||||
}
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
@ -147,7 +136,6 @@ public class MetaConfiguration {
|
|||
@Override
|
||||
public String toString(){
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append("MetaConfiguration version: " + this.version + "\n");
|
||||
buf.append("ROOT_ELEMENT:");
|
||||
buf.append(this.rootElement.toString().replaceAll("\n", "\n\t"));
|
||||
for(MetaElement me: this.services){
|
||||
|
@ -167,8 +155,6 @@ public class MetaConfiguration {
|
|||
try{
|
||||
ArrayList<MetaElement> metaElements = new ArrayList<MetaElement>();
|
||||
Element rootElement = dom.getDocumentElement();
|
||||
float version = Float.parseFloat(rootElement.getAttribute("version"));
|
||||
|
||||
|
||||
NodeList children = rootElement.getChildNodes();
|
||||
|
||||
|
@ -179,10 +165,6 @@ public class MetaConfiguration {
|
|||
if(childElement instanceof Element){
|
||||
if("rootElement".equals(childName)){
|
||||
rootMetaElement = parseElement((Element)childElement, true);
|
||||
if (rootMetaElement.getName().equals("Lite")
|
||||
|| rootMetaElement.getName().equals("CycloneDDS")){
|
||||
ConfigModeIntializer.setMode(ConfigModeIntializer.LITE_MODE);
|
||||
}
|
||||
} else if("element".equals(childName)){
|
||||
metaElement = parseElement((Element)childElement, false);
|
||||
if(metaElement != null){
|
||||
|
@ -192,19 +174,12 @@ public class MetaConfiguration {
|
|||
rootMetaElement.addChild(metaElement);
|
||||
metaElements.add(metaElement);
|
||||
}
|
||||
} else if ("serviceMapping".equals(childName)
|
||||
&& ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE) {
|
||||
// Service mapping only for configuring OSPL systems.
|
||||
res = parseServiceMapping((Element) childElement, false);
|
||||
if (!res) {
|
||||
throw new MetaException("Could not resolve meta configuration for service mapping.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((rootMetaElement != null) && (version != 0.0)){
|
||||
configuration = new MetaConfiguration(version, rootMetaElement, metaElements);
|
||||
if((rootMetaElement != null)){
|
||||
configuration = new MetaConfiguration(rootMetaElement, metaElements);
|
||||
|
||||
}
|
||||
} catch(Exception exc){
|
||||
|
@ -306,12 +281,10 @@ public class MetaConfiguration {
|
|||
String nodeName, name;
|
||||
int minOccurrences, maxOccurrences;
|
||||
String comment = null;
|
||||
String version = null;
|
||||
String dimension = null;
|
||||
|
||||
try{
|
||||
name = element.getAttribute("name");
|
||||
version = element.getAttribute("version");
|
||||
|
||||
//if(!isRootElement){
|
||||
minOccurrences = Integer.parseInt(element.getAttribute("minOccurrences"));
|
||||
|
@ -372,7 +345,7 @@ public class MetaConfiguration {
|
|||
}
|
||||
if(name != null){
|
||||
result = new MetaElement(comment, name, minOccurrences,
|
||||
maxOccurrences, metaChildren, version, dimension);
|
||||
maxOccurrences, metaChildren, dimension);
|
||||
} else {
|
||||
throw getException(element, "No name found");
|
||||
}
|
||||
|
@ -421,7 +394,7 @@ public class MetaConfiguration {
|
|||
MetaValue data;
|
||||
ArrayList<MetaNode> metaChildren;
|
||||
NodeList children;
|
||||
String name, comment, nodeName, version, dimension;
|
||||
String name, comment, nodeName, dimension;
|
||||
int minOccurrences, maxOccurrences;
|
||||
Node node;
|
||||
NodeList nodes;
|
||||
|
@ -430,7 +403,6 @@ public class MetaConfiguration {
|
|||
dimension = null;
|
||||
comment = parseComment(element);
|
||||
name = element.getAttribute("name");
|
||||
version = element.getAttribute("version");
|
||||
minOccurrences = Integer.parseInt(element.getAttribute("minOccurrences"));
|
||||
maxOccurrences = Integer.parseInt(element.getAttribute("maxOccurrences"));
|
||||
|
||||
|
@ -478,7 +450,7 @@ public class MetaConfiguration {
|
|||
}
|
||||
}
|
||||
result = new MetaElement(comment, name, minOccurrences,
|
||||
maxOccurrences, metaChildren, version, dimension);
|
||||
maxOccurrences, metaChildren, dimension);
|
||||
} else {
|
||||
throw getException(element, "No data found");
|
||||
}
|
||||
|
@ -494,7 +466,7 @@ public class MetaConfiguration {
|
|||
private static MetaAttribute parseAttribute(Element element) throws MetaException{
|
||||
MetaAttribute result;
|
||||
MetaValue data;
|
||||
String name, comment, version;
|
||||
String name, comment;
|
||||
boolean required;
|
||||
String dimension;
|
||||
|
||||
|
@ -502,15 +474,13 @@ public class MetaConfiguration {
|
|||
comment = parseComment(element);
|
||||
name = element.getAttribute("name");
|
||||
required = Boolean.parseBoolean(element.getAttribute("required"));
|
||||
version = element.getAttribute("version");
|
||||
|
||||
if(name != null){
|
||||
data = parseValue(element, element.getNodeName().substring(9));
|
||||
|
||||
if(data != null){
|
||||
dimension = getDimensionChild(element);
|
||||
result = new MetaAttribute(comment, name, required, data,
|
||||
version, dimension);
|
||||
result = new MetaAttribute(comment, name, required, data, dimension);
|
||||
} else {
|
||||
throw getException(element, "No data found");
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ public class MetaElement extends MetaNode {
|
|||
private ArrayList<MetaNode> children;
|
||||
|
||||
public MetaElement(String doc, String name, int minOccurrences,
|
||||
int maxOccurrences, ArrayList<MetaNode> children, String version,
|
||||
int maxOccurrences, ArrayList<MetaNode> children,
|
||||
String dimension) {
|
||||
super(doc, version, dimension);
|
||||
super(doc, dimension);
|
||||
this.name = name;
|
||||
this.minOccurrences = minOccurrences;
|
||||
this.maxOccurrences = maxOccurrences;
|
||||
|
@ -106,7 +106,6 @@ public class MetaElement extends MetaNode {
|
|||
StringBuffer buf = new StringBuffer();
|
||||
buf.append("\nElement\n");
|
||||
buf.append("-Name: " + this.name + "\n");
|
||||
buf.append("-Version: " + this.version + "\n");
|
||||
buf.append("-MinOcccurrences: " + this.minOccurrences + "\n");
|
||||
buf.append("-MaxOcccurrences: " + this.maxOccurrences + "\n");
|
||||
if(this.children.size() > 0){
|
||||
|
|
|
@ -13,12 +13,10 @@ package org.eclipse.cyclonedds.config.meta;
|
|||
|
||||
public abstract class MetaNode {
|
||||
String doc;
|
||||
String version;
|
||||
String dimension;
|
||||
|
||||
public MetaNode(String doc, String version, String dimension) {
|
||||
public MetaNode(String doc, String dimension) {
|
||||
this.doc = doc;
|
||||
this.version = version;
|
||||
this.dimension = dimension;
|
||||
}
|
||||
|
||||
|
@ -30,10 +28,6 @@ public abstract class MetaNode {
|
|||
this.doc = doc;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public String getDimension() {
|
||||
return this.dimension;
|
||||
}
|
||||
|
|
|
@ -11,13 +11,11 @@
|
|||
*/
|
||||
package org.eclipse.cyclonedds.config.meta;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
|
||||
public abstract class MetaValue extends MetaNode {
|
||||
Object defaultValue;
|
||||
|
||||
public MetaValue(String doc, Object defaultValue, String dimension) {
|
||||
super(doc, ConfigModeIntializer.COMMUNITY, dimension);
|
||||
super(doc, dimension);
|
||||
this.defaultValue = defaultValue;
|
||||
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ import javax.swing.JTabbedPane;
|
|||
import javax.swing.KeyStroke;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
import org.eclipse.cyclonedds.common.view.MainWindow;
|
||||
import org.eclipse.cyclonedds.common.view.StatusPanel;
|
||||
import org.eclipse.cyclonedds.config.data.DataConfiguration;
|
||||
|
@ -71,15 +70,10 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
private DataNodePopup popupSupport = null;
|
||||
private ConfigTransferHandler transferHandler = null;
|
||||
|
||||
private String windowTitle = "Configurator";
|
||||
public static final String OSPL_WINDOW_TITLE = "Vortex OpenSplice Configurator";
|
||||
public static final String LITE_WINDOW_TITLE = "Vortex DDS Configurator";
|
||||
private String windowTitle = "Eclipse Cyclone DDS Configurator";
|
||||
|
||||
public static final String OSPL_SERVICE_LABEL = "Service";
|
||||
public static final String LITE_SERVICE_LABEL = "Component";
|
||||
|
||||
public static String SERVICE_LABEL;
|
||||
public static String SERVICE_TEXT;
|
||||
public static String SERVICE_LABEL = "Component";
|
||||
public static String SERVICE_TEXT = "component";
|
||||
|
||||
/**
|
||||
* This is the default constructor
|
||||
|
@ -237,12 +231,7 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
return this.controller;
|
||||
}
|
||||
|
||||
public void setWindowTitle (int configMode) {
|
||||
if (configMode == ConfigModeIntializer.LITE_MODE) {
|
||||
this.windowTitle = LITE_WINDOW_TITLE;
|
||||
} else {
|
||||
this.windowTitle = OSPL_WINDOW_TITLE;
|
||||
}
|
||||
public void setWindowTitle () {
|
||||
super.setTitle(this.windowTitle);
|
||||
}
|
||||
|
||||
|
@ -351,10 +340,6 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
private void initialize() {
|
||||
this.setSize(800, 600);
|
||||
this.controller = new ConfigWindowController(this);
|
||||
// setServiceLabel relies on the
|
||||
// ConfigModeIntializer.CONFIGURATOR_MODE variable which
|
||||
// has been set during construction of ConfigWndowController
|
||||
this.setServiceLabel();
|
||||
this.popupSupport = new DataNodePopup();
|
||||
this.transferHandler = new ConfigTransferHandler(this);
|
||||
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
|
@ -373,22 +358,6 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
this.setAppLogo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the proper service label to be used throughout the configurator UI.
|
||||
* Ospl uses the label "Service" while Lite uses the label "Component"
|
||||
* (since the concept of service does not really exist)
|
||||
*
|
||||
*/
|
||||
private void setServiceLabel(){
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE){
|
||||
SERVICE_LABEL = OSPL_SERVICE_LABEL;
|
||||
SERVICE_TEXT = OSPL_SERVICE_LABEL.toLowerCase();
|
||||
} else {
|
||||
SERVICE_LABEL = LITE_SERVICE_LABEL;
|
||||
SERVICE_TEXT = LITE_SERVICE_LABEL.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes jContentPane
|
||||
*
|
||||
|
@ -497,7 +466,7 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
helpContentsItem.setMnemonic(KeyEvent.VK_C);
|
||||
helpContentsItem.setActionCommand("help");
|
||||
helpContentsItem.addActionListener(getController());
|
||||
helpContentsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, Event.CTRL_MASK, false));
|
||||
helpContentsItem.setAccelerator(KeyStroke.getKeyStroke("control H"));
|
||||
}
|
||||
return helpContentsItem;
|
||||
}
|
||||
|
@ -530,7 +499,7 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
newItem = new JMenuItem();
|
||||
newItem.setText("New...");
|
||||
newItem.setMnemonic(KeyEvent.VK_N);
|
||||
newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK, false));
|
||||
newItem.setAccelerator(KeyStroke.getKeyStroke("control N"));
|
||||
newItem.setActionCommand("new");
|
||||
newItem.addActionListener(controller);
|
||||
}
|
||||
|
@ -547,7 +516,7 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
openItem = new JMenuItem();
|
||||
openItem.setText("Open...");
|
||||
openItem.setMnemonic(KeyEvent.VK_O);
|
||||
openItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Event.CTRL_MASK, false));
|
||||
openItem.setAccelerator(KeyStroke.getKeyStroke("control O"));
|
||||
openItem.setActionCommand("open");
|
||||
openItem.addActionListener(controller);
|
||||
}
|
||||
|
@ -564,7 +533,7 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
saveItem = new JMenuItem();
|
||||
saveItem.setText("Save");
|
||||
saveItem.setMnemonic(KeyEvent.VK_S);
|
||||
saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK, false));
|
||||
saveItem.setAccelerator(KeyStroke.getKeyStroke("control S"));
|
||||
saveItem.setActionCommand("save");
|
||||
saveItem.addActionListener(controller);
|
||||
}
|
||||
|
@ -613,7 +582,7 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
exitItem = new JMenuItem();
|
||||
exitItem.setText("Exit");
|
||||
exitItem.setMnemonic(KeyEvent.VK_X);
|
||||
exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, Event.ALT_MASK, false));
|
||||
exitItem.setAccelerator(KeyStroke.getKeyStroke("alt F4"));
|
||||
exitItem.setActionCommand("exit");
|
||||
exitItem.addActionListener(controller);
|
||||
}
|
||||
|
@ -630,7 +599,7 @@ public class ConfigWindow extends MainWindow implements DataConfigurationListene
|
|||
printItem = new JMenuItem();
|
||||
printItem.setText("Print...");
|
||||
printItem.setMnemonic(KeyEvent.VK_P);
|
||||
printItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, Event.CTRL_MASK, false));
|
||||
printItem.setAccelerator(KeyStroke.getKeyStroke("control P"));
|
||||
printItem.setActionCommand("print");
|
||||
printItem.addActionListener(controller);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ import javax.swing.JOptionPane;
|
|||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
import org.eclipse.cyclonedds.common.util.Report;
|
||||
import org.eclipse.cyclonedds.config.data.DataConfiguration;
|
||||
import org.eclipse.cyclonedds.config.data.DataException;
|
||||
|
@ -60,25 +59,12 @@ public class ConfigWindowController implements ActionListener {
|
|||
// Initialize the MetaConfiguration. This is done so the Configurator can know for
|
||||
// which product its meant for, according to the meta config file.
|
||||
MetaConfiguration.getInstance();
|
||||
view.setWindowTitle(ConfigModeIntializer.CONFIGURATOR_MODE);
|
||||
view.setWindowTitle();
|
||||
|
||||
String osplHome = System.getenv("OSPL_HOME");
|
||||
File f = null;
|
||||
String fileSep = System.getProperty("file.separator");
|
||||
|
||||
if(osplHome == null){
|
||||
f = new File(System.getProperty("user.dir") + fileSep);
|
||||
} else {
|
||||
f = new File(osplHome + fileSep + "etc" + fileSep + "config" + fileSep);
|
||||
|
||||
if((!f.exists()) || (!f.isDirectory())){
|
||||
f = new File(osplHome + fileSep + "etc" + fileSep);
|
||||
|
||||
if((!f.exists()) || (!f.isDirectory())){
|
||||
f = new File(System.getProperty("user.dir") + fileSep);
|
||||
}
|
||||
}
|
||||
}
|
||||
f = new File(System.getProperty("user.dir") + fileSep);
|
||||
this.openFileChooser.setCurrentDirectory(f);
|
||||
this.openFileChooser.setDialogTitle("Open configuration");
|
||||
this.openFileChooser.setMultiSelectionEnabled(false);
|
||||
|
@ -242,52 +228,9 @@ public class ConfigWindowController implements ActionListener {
|
|||
DataConfiguration config = null;
|
||||
|
||||
try {
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMERCIAL_MODE &&
|
||||
ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE) {
|
||||
ConfigModeIntializer.setMode(ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN);
|
||||
}
|
||||
|
||||
config = new DataConfiguration(f, false);
|
||||
} catch (DataException e) {
|
||||
Report.getInstance().writeInfoLog("ConfigWindowController handleOpen\n" + e.getMessage());
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE) {
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMERCIAL_MODE) {
|
||||
ConfigModeIntializer.setMode(ConfigModeIntializer.COMMUNITY_MODE);
|
||||
}
|
||||
|
||||
int answer = JOptionPane.showConfirmDialog(
|
||||
view,
|
||||
"The configuration is not valid.\nReason: " +
|
||||
e.getMessage() +
|
||||
"\nTry automatic repairing?",
|
||||
"Invalid configuration",
|
||||
JOptionPane.YES_NO_OPTION);
|
||||
|
||||
if(answer == JOptionPane.YES_OPTION){
|
||||
try {
|
||||
config = new DataConfiguration(f, true);
|
||||
|
||||
view.setStatus("Configuration repaired successfully.", false);
|
||||
} catch (DataException e1) {
|
||||
JOptionPane.showMessageDialog(view,
|
||||
"Configuration could not be repaired.\nReason: '" +
|
||||
e.getMessage() + "'"
|
||||
, "Error", JOptionPane.ERROR_MESSAGE);
|
||||
handleSetStatus("Configuration could not be repaired.", false);
|
||||
handleNextAction();
|
||||
}
|
||||
} else if(answer == JOptionPane.NO_OPTION){
|
||||
handleSetStatus("Configuration not opened.", false);
|
||||
handleNextAction();
|
||||
}
|
||||
} else {
|
||||
JOptionPane.showConfirmDialog(
|
||||
view,
|
||||
"The configuration is not valid.\nReason: " +
|
||||
e.getMessage(),
|
||||
"Invalid configuration",
|
||||
JOptionPane.PLAIN_MESSAGE);
|
||||
}
|
||||
}
|
||||
if(config != null){
|
||||
view.setDataConfiguration(config);
|
||||
|
@ -326,23 +269,11 @@ public class ConfigWindowController implements ActionListener {
|
|||
DataConfiguration config = null;
|
||||
|
||||
try {
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMERCIAL_MODE &&
|
||||
ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE) {
|
||||
ConfigModeIntializer
|
||||
.setMode(ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN);
|
||||
}
|
||||
|
||||
config = new DataConfiguration(f, false);
|
||||
} catch (DataException e) {
|
||||
Report.getInstance().writeInfoLog(
|
||||
"ConfigWindowController handleOpen\n"
|
||||
+ e.getMessage());
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMERCIAL_MODE &&
|
||||
ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE) {
|
||||
ConfigModeIntializer
|
||||
.setMode(ConfigModeIntializer.COMMUNITY_MODE);
|
||||
}
|
||||
|
||||
int answer = JOptionPane.showConfirmDialog(
|
||||
view,
|
||||
"The configuration is not valid.\nReason: "
|
||||
|
@ -533,9 +464,6 @@ public class ConfigWindowController implements ActionListener {
|
|||
public void run(){
|
||||
view.setDataConfiguration(null);
|
||||
newInProgress = false;
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN) {
|
||||
ConfigModeIntializer.setMode(ConfigModeIntializer.COMMUNITY_MODE);
|
||||
}
|
||||
try {
|
||||
DataConfiguration config = new DataConfiguration();
|
||||
view.setDataConfiguration(config);
|
||||
|
@ -628,13 +556,8 @@ public class ConfigWindowController implements ActionListener {
|
|||
public static final String CONFIG_SUFFIX = ".xml";
|
||||
|
||||
public ConfigChooseFilter(){
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.LITE_MODE) {
|
||||
ConfigChooseFilter.description = "Cyclone DDS config files (*" +
|
||||
ConfigChooseFilter.CONFIG_SUFFIX + ")";
|
||||
} else {
|
||||
ConfigChooseFilter.description = "OpenSplice config files (*" +
|
||||
ConfigChooseFilter.CONFIG_SUFFIX + ")";
|
||||
}
|
||||
ConfigChooseFilter.description = "Eclipse Cyclone DDS config files (*" +
|
||||
ConfigChooseFilter.CONFIG_SUFFIX + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.util.logging.Logger;
|
|||
import javax.swing.JTable;
|
||||
import javax.swing.table.DefaultTableCellRenderer;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
import org.eclipse.cyclonedds.config.data.DataNode;
|
||||
|
||||
public class DataElementTableCellRenderer extends DefaultTableCellRenderer {
|
||||
|
@ -43,27 +42,9 @@ public class DataElementTableCellRenderer extends DefaultTableCellRenderer {
|
|||
node = node.getParent();
|
||||
table.setToolTipText(null);
|
||||
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMERCIAL_MODE) {
|
||||
if (node.getMetadata().getVersion().equals(ConfigModeIntializer.COMMERCIAL)) {
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMUNITY_MODE_FILE_OPEN) {
|
||||
comp.setBackground (Color.LIGHT_GRAY);
|
||||
comp.setForeground (Color.GRAY);
|
||||
table.setToolTipText("This element is not part of the community edition");
|
||||
} else {
|
||||
comp.setBackground (Color.RED);
|
||||
comp.setForeground (Color.BLACK);
|
||||
table.setToolTipText("This element is found in the configuration file but not part of the community edition");
|
||||
}
|
||||
} else {
|
||||
comp.setBackground (Color.WHITE);
|
||||
comp.setForeground (Color.BLACK);
|
||||
table.setToolTipText(null);
|
||||
}
|
||||
} else {
|
||||
comp.setBackground (Color.WHITE);
|
||||
comp.setForeground (Color.BLACK);
|
||||
table.setToolTipText(null);
|
||||
}
|
||||
comp.setBackground (Color.WHITE);
|
||||
comp.setForeground (Color.BLACK);
|
||||
table.setToolTipText(null);
|
||||
return comp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import java.util.ArrayList;
|
|||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
import org.eclipse.cyclonedds.config.data.DataAttribute;
|
||||
import org.eclipse.cyclonedds.config.data.DataConfiguration;
|
||||
import org.eclipse.cyclonedds.config.data.DataConfigurationListener;
|
||||
|
@ -131,9 +130,7 @@ public class DataElementTableModel extends DefaultTableModel implements DataConf
|
|||
public boolean isCellEditable(int row, int column) {
|
||||
boolean result;
|
||||
|
||||
if(column == 1 && ConfigModeIntializer.CONFIGURATOR_MODE == ConfigModeIntializer.COMMERCIAL_MODE) {
|
||||
result = true;
|
||||
} else if (column == 1 && !element.getMetadata().getVersion().equals(ConfigModeIntializer.COMMERCIAL)) {
|
||||
if(column == 1) {
|
||||
result = true;
|
||||
} else {
|
||||
result = false;
|
||||
|
|
|
@ -34,7 +34,6 @@ import org.eclipse.cyclonedds.config.meta.MetaAttribute;
|
|||
import org.eclipse.cyclonedds.config.meta.MetaElement;
|
||||
import org.eclipse.cyclonedds.config.meta.MetaNode;
|
||||
import org.eclipse.cyclonedds.config.meta.MetaValue;
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
|
||||
public class DataNodePopup implements MouseListener, ActionListener {
|
||||
|
||||
|
@ -137,10 +136,6 @@ public class DataNodePopup implements MouseListener, ActionListener {
|
|||
if(parentParent != null){
|
||||
current = this.countOccurrences((DataElement)parent.getParent(), parent.getMetadata());
|
||||
min = ((MetaElement)metaParent).getMinOccurrences();
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMERCIAL_MODE && metaParent.getVersion().equals(ConfigModeIntializer.COMMERCIAL)) {
|
||||
reset.setEnabled(false);
|
||||
}
|
||||
|
||||
if(min == 0){
|
||||
remove.setEnabled(true);
|
||||
} else if(current > min){
|
||||
|
@ -151,10 +146,6 @@ public class DataNodePopup implements MouseListener, ActionListener {
|
|||
}
|
||||
} else if(parent instanceof DataAttribute){
|
||||
metaParent = parent.getMetadata();
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.COMMERCIAL_MODE && metaParent.getVersion().equals(ConfigModeIntializer.COMMERCIAL)) {
|
||||
reset.setEnabled(false);
|
||||
}
|
||||
|
||||
if(((MetaAttribute)metaParent).isRequired()){
|
||||
remove.setEnabled(false);
|
||||
}
|
||||
|
@ -387,40 +378,8 @@ public class DataNodePopup implements MouseListener, ActionListener {
|
|||
|
||||
public void addService(DataNode dataNode, MetaNode metaNode) throws DataException {
|
||||
if (dataNode instanceof DataElement) {
|
||||
if (ConfigModeIntializer.CONFIGURATOR_MODE != ConfigModeIntializer.LITE_MODE){
|
||||
String serviceName = null;
|
||||
|
||||
String suggestedName = dataNode.getOwner().getMetaAttributeValue((MetaElement) metaNode, "name");
|
||||
/*
|
||||
* generate a new name if there is already a service with the
|
||||
* default name
|
||||
*/
|
||||
if (dataNode.getOwner().containsServiceName(suggestedName)) {
|
||||
String tmp = suggestedName + "_1";
|
||||
for (int i = 1; dataNode.getOwner().containsServiceName(tmp); i++) {
|
||||
tmp = suggestedName + "_" + i;
|
||||
}
|
||||
suggestedName = tmp;
|
||||
}
|
||||
|
||||
serviceName = (String) JOptionPane.showInputDialog(null, "Please enter a service name:",
|
||||
"Set the service name", JOptionPane.QUESTION_MESSAGE, null, null, suggestedName);
|
||||
|
||||
if (serviceName != null) {
|
||||
if (!dataNode.getOwner().containsServiceName(serviceName)) {
|
||||
/* get the newly created service element */
|
||||
dataNode = dataNode.getOwner().addNodeWithDependency((DataElement) dataNode, metaNode);
|
||||
dataNode.getOwner().createDomainServiceForSerivce(dataNode, metaNode, serviceName);
|
||||
} else {
|
||||
this.notifyStatus("Error: Servicename is already in use", false, false);
|
||||
}
|
||||
} else {
|
||||
this.notifyStatus("Error: Please fill in a servicename", false, false);
|
||||
}
|
||||
} else {
|
||||
/* get the newly created service element */
|
||||
dataNode.getOwner().addNode((DataElement) dataNode, metaNode);
|
||||
}
|
||||
/* get the newly created service element */
|
||||
dataNode.getOwner().addNode((DataElement) dataNode, metaNode);
|
||||
} else {
|
||||
this.notifyStatus("Error: Unexpected type of parent found: '" + dataNode.getClass() + "'.", false, false);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import javax.swing.JFrame;
|
|||
import javax.swing.WindowConstants;
|
||||
import javax.swing.JSplitPane;
|
||||
|
||||
import org.eclipse.cyclonedds.common.util.ConfigModeIntializer;
|
||||
import org.eclipse.cyclonedds.common.view.StatusPanel;
|
||||
import org.eclipse.cyclonedds.config.meta.MetaConfiguration;
|
||||
|
||||
|
@ -37,8 +36,7 @@ public class HelpWindow extends JFrame implements TreeSelectionListener {
|
|||
private JScrollPane docScrollPane = null;
|
||||
private MetaNodeDocPane docPane = null;
|
||||
|
||||
public static final String OSPL_HELP_WINDOW_TITLE = "Vortex OpenSplice Configurator | Help";
|
||||
public static final String LITE_HELP_WINDOW_TITLE = "Vortex DDS Configurator | Help";
|
||||
public static final String HELP_WINDOW_TITLE = "Eclipse Cyclone DDS Configurator | Help";
|
||||
|
||||
/**
|
||||
* This is the default constructor
|
||||
|
@ -58,18 +56,13 @@ public class HelpWindow extends JFrame implements TreeSelectionListener {
|
|||
this.setSize(640, 480);
|
||||
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
this.setContentPane(getJContentPane());
|
||||
setWindowTitle(ConfigModeIntializer.CONFIGURATOR_MODE);
|
||||
setWindowTitle();
|
||||
getElementTree().getSelectionModel().addTreeSelectionListener(this);
|
||||
getDocPane().setNode(getElementTree().getSelectedMetaElement());
|
||||
}
|
||||
|
||||
public void setWindowTitle (int configMode) {
|
||||
String windowTitle = "Configurator | Help";
|
||||
if (configMode == ConfigModeIntializer.LITE_MODE) {
|
||||
windowTitle = LITE_HELP_WINDOW_TITLE;
|
||||
} else {
|
||||
windowTitle = OSPL_HELP_WINDOW_TITLE;
|
||||
}
|
||||
public void setWindowTitle () {
|
||||
String windowTitle = HELP_WINDOW_TITLE;
|
||||
this.setTitle(windowTitle);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue