Commit e8de898d authored by afreyssin's avatar afreyssin

First release of C++ client.

parent 79580267
# Doxyfile 1.4.7
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = Xoram2
PROJECT_NUMBER = beta
OUTPUT_DIRECTORY = "C:/Documents and Settings/freyssin.SCALAGENT/Bureau/html2"
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = YES
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "C:/Documents and Settings/freyssin.SCALAGENT/"
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
BUILTIN_STL_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = C:/cygwin/home/freyssin/owjoram2/xoram
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.d \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.py
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
This diff is collapsed.
This diff is collapsed.
/*
* XORAM: Open Reliable Asynchronous Messaging
* Copyright (C) 2006 CNES
* Copyright (C) 2006 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
#include <stdio.h>
#include <pthread.h>
#include "Daemon.H"
Daemon::Daemon() {
running = FALSE;
}
Daemon::~Daemon() {}
boolean Daemon::isRunning() {
return running;
}
void Daemon::finish() {
running = false;
close();
pthread_exit(0);
}
void* Daemon::main(void* par) {
Daemon* daemon = (Daemon*) par;
daemon->run();
pthread_exit(0);
}
void Daemon::start() {
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
running = TRUE;
pthread_create(&thread, &attr, Daemon::main, (void *)this);
pthread_attr_destroy(&attr);
}
void Daemon::stop() {
running = false;
close();
}
void Daemon::join() {
pthread_join(thread, (void **)&status);
}
/*
* XORAM: Open Reliable Asynchronous Messaging
* Copyright (C) 2006 CNES
* Copyright (C) 2006 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
#ifndef DAEMON_H
#define DAEMON_H
#include "Types.H"
class Daemon {
private:
pthread_t thread;
static void* main(void* par);
protected:
volatile boolean running;
volatile boolean canStop;
volatile int status;
virtual void run() =0;
virtual void close() =0;
void finish();
public:
Daemon();
~Daemon();
boolean isRunning();
void start();
void stop();
void join();
};
#endif /* DAEMON_H */
/*
* XORAM: Open Reliable Asynchronous Messaging
* Copyright (C) 2006 CNES
* Copyright (C) 2006 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
#ifndef DESTINATION_H
#define DESTINATION_H
#include <string.h>
/**
* A Destination object encapsulates a Joram's specific address.
*/
class Destination {
private:
char* uid;
char type;
char* name;
public:
enum {QUEUE, TOPIC};
Destination(char* uid, char type, char* name);
/**
* Returns the unique internal name of the destination.
*/
char* getUID();
/**
* Returns the administrative name of the destination.
*/
char* getName();
/**
* Returns true if the destinatination is a queue.
*/
boolean isQueue();
/**
* Returns true if the destinatination is a topic.
*/
boolean isTopic();
/**
* Non API method, should be hidden.
*/
char getType();
/**
* Non API method, should be hidden.
*/
static char* typeToString(char type) {
if (type == QUEUE)
return "queue";
else if (type == TOPIC)
return "topic";
return (char*) NULL;
}
/**
* Non API method, should be hidden.
*/
static char stringToType(char *type) {
if (strcasecmp(type, "queue"))
return QUEUE;
else if (strcasecmp(type, "topic"))
return TOPIC;
return 0;
}
/**
* Non API method, should be hidden.
*/
Destination* newInstance(char* uid, char type, char* name);
};
/**
* A Queue object encapsulates information to handle a Joram's queue.
*/
class Queue : public Destination {
public:
/**
* Creates a Queue object.
*/
Queue(char* uid, char* name) : Destination(uid, QUEUE, name) { }
};
/**
* A Topic object encapsulates information to handle a Joram's topic.
*/
class Topic : public Destination {
public:
/**
* Creates a Topic object.
*/
Topic(char* uid, char* name) : Destination(uid, TOPIC, name) { }
};
#endif /* DESTINATION_H */
###############################
# i86-cygwin
# CCOPT = -g
# LDFLAGS = -fPIC -shared
###############################
# i86-linux
CCOPT = -g -fPIC
LDFLAGS = -fPIC -shared
###############################
CC = g++ $(CCOPT)
LD = g++ $(CCOPT) $(LDFLAGS)
LIBXORAMOBJS = \
Synchronized.o \
Daemon.o \
Properties.o \
XStream.o \
AbstractMessage.o \
Message.o \
Xoram.o
TESTS = \
tests/base
clean:
rm -f *.o *~ libxoram.so
for TD in $(TESTS);\
do cd $$TD; make clean ; cd - ; done
xoram: libxoram.so
libxoram.so: $(LIBXORAMOBJS)
$(LD) -o libxoram.so $(LIBXORAMOBJS)
tests: libxoram.so
for TD in $(TESTS);\
do cd $$TD; make tests ; cd - ; done
.C.o:
$(CC) -o $*.o -c $*.C
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* XORAM: Open Reliable Asynchronous Messaging
* Copyright (C) 2006 CNES
* Copyright (C) 2006 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
#ifndef PROPERTIES_H
#define PROPERTIES_H
#include "Types.H"
class OutputStream;
class InputStream;
// ######################################################################
// Properties Class
// ######################################################################
/**
* Built-in facility for supporting application-defined property values.<br>
* Property names must not be null, and must not be empty strings. If a
* property name is set and it is either null or an empty string, an
* IllegalArgumentException must be thrown.<br>
* Property values can be boolean, byte, short, int, long, float, double,
* and String. At this time, properties does nor support conversion between
* types.
*/
class Properties {
private:
class Entry {
public:
int hash;
char* key;
byte type;
union {
boolean b;
byte c;
double d;
float f;
int i;
long long l;
short s;
char* str;
};
Entry* next;
Entry(int hash, char* key, Entry* next) {
this->hash = hash;
this->key = key;
this->next = next;
}
};
int count;
int length;
Entry** table;
float loadFactor;
int threshold;
void rehash();
int hashCode(char* key);
Entry* get(char* key);
Entry* put(char* key);
public:
Properties(int capacity, float loadFactor);
Properties(int capacity);
Properties();
~Properties();
int size();
boolean isEmpty();
void clear();
boolean getBooleanProperty(char* name);
byte getByteProperty(char* name);
double getDoubleProperty(char* name);
float getFloatProperty(char* name);
int getIntProperty(char* name);
long long getLongProperty(char* name);
short getShortProperty(char* name);
char* getStringProperty(char* name);
void setBooleanProperty(char* name, boolean value);
void setByteProperty(char* name, byte value);
void setDoubleProperty(char* name, double value);
void setFloatProperty(char* name, float value);
void setIntProperty(char* name, int value);
void setLongProperty(char* name, long long value);
void setShortProperty(char* name, short value);
void setStringProperty(char* name, char* value);
// ==================================================
// Cloneable interface
// ==================================================
Properties* clone();
// ==================================================
// Streamable interface
// ==================================================
void writePropertiesTo(OutputStream* os) throw (IOException);
void readPropertiesFrom(InputStream* is, int count) throw (IOException);
};
#endif /* PROPERTIES_H */
I - Compilation de Joram
========================
2) Creation d'une livraison binaire de Joram
--------------------------------------------
cd <JORAM_DIR>/joram/src
ant clean ship
II - Compilation de Xoram
=========================
cd <JORAM_DIR>/xoram
make clean xoram
III - Test de Xoram
===================
1) Compilation des tests
------------------------
Window#1: cd <JORAM_DIR>/xoram
Window#1: make clean tests
2) Lancement de Joram
---------------------
Window#2: cd <JORAM_DIR>/joram/samples/src/joram
Window#2: ant clean compile
Window#2: ant reset single_server
--> AgentServer#0 started: OK
3) Administration de Joram
--------------------------
Les exemples fournis dans le rpertoire tests/base de xoram utilisent
les objets administrs du sample 'classic' de Joram. Nous rutilisons donc
la classe d'administration de cet exemple.
Window#3: cd <JORAM_DIR>/joram/samples/src/joram
Window#3: ant classic_admin
4) Lancement des exemples
-------------------------
Window#1: cd <JORAM_DIR>/xoram/tests/base
Window#1: ./test1.exe
connected -> 0
##### Cnx state(1): 1
##### Cnx state(0): 0
##### Cnx state(1): 1
##### Cnx state(0): 0
##### bye
Window#1: ./test2.exe
connected -> 1
##### Message sent on queue: ID:0.0.1028c1m1
##### Message received: ID:0.0.1028c1m1
Window#1: ./test3.exe
connected -> 2
##### Message sent on topic: ID:0.0.1028c2m1
##### Message received: ID:0.0.1028c2m1
Window#1: ./test5.exe
connected -> 4
##### Message sent on queue: ID:0.0.1028c4m1
##### Message sent on topic: ID:0.0.1028c4m2
##### Message received: ID:0.0.1028c4m1
##### Message received: ID:0.0.1028c4m2