[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/geas/src collectiondata.c connection.c fac...
From: |
Reinhard Mueller |
Subject: |
gnue/geas/src collectiondata.c connection.c fac... |
Date: |
Fri, 25 May 2001 13:04:58 -0700 |
CVSROOT: /cvs
Module name: gnue
Changes by: Reinhard Mueller <address@hidden> 01/05/25 13:04:55
Modified files:
geas/src : collectiondata.c connection.c factory.c
geas-server.c geas-server.h geas-skeleton.c
objectlist.c schema.c security.c
servantlocator.h transaction.c
geas/src/objectcache: objectcache.c objectcache.h
geas/src/objectstore: objectstore.c
Log message:
more code cleanups
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/collectiondata.c.diff?cvsroot=OldCVS&tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/connection.c.diff?cvsroot=OldCVS&tr1=1.52&tr2=1.53&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/factory.c.diff?cvsroot=OldCVS&tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/geas-server.c.diff?cvsroot=OldCVS&tr1=1.83&tr2=1.84&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/geas-server.h.diff?cvsroot=OldCVS&tr1=1.40&tr2=1.41&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/geas-skeleton.c.diff?cvsroot=OldCVS&tr1=1.56&tr2=1.57&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/objectlist.c.diff?cvsroot=OldCVS&tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/schema.c.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/security.c.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/servantlocator.h.diff?cvsroot=OldCVS&tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/transaction.c.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/objectcache/objectcache.c.diff?cvsroot=OldCVS&tr1=1.42&tr2=1.43&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/objectcache/objectcache.h.diff?cvsroot=OldCVS&tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/objectstore/objectstore.c.diff?cvsroot=OldCVS&tr1=1.56&tr2=1.57&r1=text&r2=text
Patches:
Index: gnue/geas/src/collectiondata.c
diff -u gnue/geas/src/collectiondata.c:1.16 gnue/geas/src/collectiondata.c:1.17
--- gnue/geas/src/collectiondata.c:1.16 Fri May 25 08:46:50 2001
+++ gnue/geas/src/collectiondata.c Fri May 25 13:04:54 2001
@@ -26,6 +26,7 @@
#include "geas-server.h"
#include "geas-skeleton.h"
#include "oql/oql.h"
+#include "objectcache/objectcache.h"
#include "objectstore/objectstore.h"
#include "collectiondata.h"
Index: gnue/geas/src/connection.c
diff -u gnue/geas/src/connection.c:1.52 gnue/geas/src/connection.c:1.53
--- gnue/geas/src/connection.c:1.52 Fri May 25 08:46:50 2001
+++ gnue/geas/src/connection.c Fri May 25 13:04:54 2001
@@ -32,6 +32,7 @@
#include "exceptions.h"
#include "collectiondata.h"
#include "oql/oql.h"
+#include "objectcache/objectcache.h"
#include "datamonitor/datamonitor.h"
#include "transaction.h"
#include "schema.h"
Index: gnue/geas/src/factory.c
diff -u gnue/geas/src/factory.c:1.13 gnue/geas/src/factory.c:1.14
--- gnue/geas/src/factory.c:1.13 Fri May 25 08:46:50 2001
+++ gnue/geas/src/factory.c Fri May 25 13:04:54 2001
@@ -28,6 +28,7 @@
#include "config.h"
#include "geas-server.h"
+#include "globals.h"
#include "geas-skeleton.h"
#include "factory.h"
#include "exceptions.h"
Index: gnue/geas/src/geas-server.c
diff -u gnue/geas/src/geas-server.c:1.83 gnue/geas/src/geas-server.c:1.84
--- gnue/geas/src/geas-server.c:1.83 Fri May 25 09:04:28 2001
+++ gnue/geas/src/geas-server.c Fri May 25 13:04:54 2001
@@ -40,9 +40,11 @@
#include "geas.h"
#include "geas-server.h"
+#include "globals.h"
#include "geas-skeleton.h"
#include "config/configuration.h"
+#include "objectcache/objectcache.h"
#include "objectstore/objectstore.h"
#include "oql/oql.h"
#include "classdata.h"
@@ -79,7 +81,6 @@
/* global variables */
int debuglevel;
CORBA_ORB the_orb;
-struct poa_data_s poa_data;
struct ServerSettings settings;
configuration configdata = NO_CONFIGURATION;
odl_tree *all_classes = NULL;
@@ -251,7 +252,7 @@
initialise_objectstore(configdata);
message("Initialising object cache.");
- create_object_cache();
+ create_object_cache(settings.cache_maximum_size);
/* note: requires objectstore and classes to be loaded */
message("Validating/updating database table definitions.");
@@ -562,6 +563,44 @@
fprintf(stderr, "\n");
}
+/** \brief Display the program version
+ */
+void
+show_version(FILE * fp)
+ {
+ fprintf(fp, "\nGNU Enterprise Application Server\nVersion " VERSION);
+
+ fprintf(fp, "" /* blank bit so that in the worst
+ case, the function still
+ compiles */
+#ifdef DEBUG
+ " DEBUG"
+#endif
+#ifdef DEBUG_SECURITY
+ " (Security debugging)"
+#endif
+#ifdef SELF_TEST
+ " SELF TEST"
+#endif
+ "\nDatabase support compiled for:"
+#ifdef USE_MYSQL
+ " MySQL"
+#endif
+#ifdef USE_POSTGRESQL
+ " PostgreSQL"
+#endif
+#ifdef USE_LIBGDA
+ " All libgda supported databases"
+#endif
+ );
+
+ fprintf(fp,
+ "\nCopyright 2001 Free Software Foundation\n"
+ "\nSee the file 'COPYING' for details of"
+ " the Gnu Public License\nthat covers this program\n\n"
+ "http://www.gnue.org/\n\n");
+ }
+
/** \brief Long command line options options
*/
#ifdef USE_GNU_GETOPT
@@ -1091,44 +1130,6 @@
"\nDebug level must be either off, low, medium, or high. Numeric
values must be\n"
"between %d and %d (inclusive).\n\n",
DEBUGLEVEL_LOW, DEBUGLEVEL_HIGH);
- }
-
-/** \brief Display the program version
- */
-void
-show_version(FILE * fp)
- {
- fprintf(fp, "\nGNU Enterprise Application Server\nVersion " VERSION);
-
- fprintf(fp, "" /* blank bit so that in the worst
- case, the function still
- compiles */
-#ifdef DEBUG
- " DEBUG"
-#endif
-#ifdef DEBUG_SECURITY
- " (Security debugging)"
-#endif
-#ifdef SELF_TEST
- " SELF TEST"
-#endif
- "\nDatabase support compiled for:"
-#ifdef USE_MYSQL
- " MySQL"
-#endif
-#ifdef USE_POSTGRESQL
- " PostgreSQL"
-#endif
-#ifdef USE_LIBGDA
- " All libgda supported databases"
-#endif
- );
-
- fprintf(fp,
- "\nCopyright 2001 Free Software Foundation\n"
- "\nSee the file 'COPYING' for details of"
- " the Gnu Public License\nthat covers this program\n\n"
- "http://www.gnue.org/\n\n");
}
/** \brief Load the configuration file
Index: gnue/geas/src/geas-server.h
diff -u gnue/geas/src/geas-server.h:1.40 gnue/geas/src/geas-server.h:1.41
--- gnue/geas/src/geas-server.h:1.40 Fri May 25 09:04:28 2001
+++ gnue/geas/src/geas-server.h Fri May 25 13:04:54 2001
@@ -29,18 +29,11 @@
#ifndef GEAS_SERVER_H
#define GEAS_SERVER_H
-#include "geas.h"
-
#include "classdata.h"
-#include "objectcache/objectcache.h"
-#include "geas-skeleton.h"
/** \brief username reserved for the server */
#define SERVER_PRIVATE_USERNAME "server_private_user"
-GEAS_Connection get_server_connection_object();
-GEAS_object_reference *get_server_connection_id();
-
/* utility function prototypes */
gboolean is_extension(char *filename, char *ext);
@@ -90,29 +83,17 @@
*/
struct ServerSettings
{
- CORBA_boolean verbose,quiet,showconfig,loggeasclasses,showclasses;
- CORBA_char *configfile;
- CORBA_unsigned_long cache_maximum_size;
+ gboolean verbose,quiet,showconfig,loggeasclasses,showclasses;
+ gchar *configfile;
+ guint64 cache_maximum_size;
};
-/** \brief Data used by ORBit to manage object references */
-struct poa_data_s
- {
- PortableServer_POA transaction_poa;
- PortableServer_POA connection_poa;
- PortableServer_POA dataobject_poa;
- PortableServer_POA objectlist_poa;
- PortableServer_POA admin_poa;
- PortableServer_POA query_poa;
- PortableServer_POA constraint_poa;
- };
-
/* global variables */
-extern int debuglevel; /* configurable debugging
output detail :
-
-
1-10, 1 = low detail, 10 = high detail */
-extern struct poa_data_s poa_data;
extern struct ServerSettings settings;
+
+extern int debuglevel; /* configurable debugging output detail :
+ 1-10, 1 = low detail, 10 = high detail */
+
extern configuration configdata;
extern odl_tree *all_classes;
Index: gnue/geas/src/geas-skeleton.c
diff -u gnue/geas/src/geas-skeleton.c:1.56 gnue/geas/src/geas-skeleton.c:1.57
--- gnue/geas/src/geas-skeleton.c:1.56 Fri May 25 08:46:50 2001
+++ gnue/geas/src/geas-skeleton.c Fri May 25 13:04:54 2001
@@ -37,6 +37,7 @@
#include <sys/times.h>
#include "geas-server.h"
+#include "objectcache/objectcache.h"
#include "geas.h"
#include "geas-skeleton.h"
#include "geas-skelimpl.h"
@@ -53,6 +54,20 @@
#ifdef USE_SERVANT_MANAGER
#include "servantlocator.h"
#endif
+
+/** \brief Data used by ORBit to manage object references */
+struct poa_data_s
+ {
+ PortableServer_POA transaction_poa;
+ PortableServer_POA connection_poa;
+ PortableServer_POA dataobject_poa;
+ PortableServer_POA objectlist_poa;
+ PortableServer_POA admin_poa;
+ PortableServer_POA query_poa;
+ PortableServer_POA constraint_poa;
+ };
+
+struct poa_data_s poa_data;
static GEAS_object_reference *alloc_geas_object_reference();
static GEAS_object_reference *parse_object_id(const char *id);
Index: gnue/geas/src/objectcache/objectcache.c
diff -u gnue/geas/src/objectcache/objectcache.c:1.42
gnue/geas/src/objectcache/objectcache.c:1.43
--- gnue/geas/src/objectcache/objectcache.c:1.42 Fri May 25 09:04:29 2001
+++ gnue/geas/src/objectcache/objectcache.c Fri May 25 13:04:54 2001
@@ -50,7 +50,7 @@
static GHashTable *cachedata = NULL;
static GHashTable *indexes = NULL;
static int objectcache_count = 0;
-static CORBA_long cache_max_size = 0;
+static guint32 cache_max_size = 0;
static GList *flushable = NULL;
static void oc_squeeze_cache( int spaces_to_make );
@@ -139,12 +139,6 @@
if( spaces_to_make > cache_max_size )
spaces_to_make = cache_max_size;
-/* if( (spaces_to_make+objectcache_count) > cache_max_size && flushable ) {
-* printf( "make %d spaces\n" , spaces_to_make );
-* message("Cache full (%d of %d entries)",
objectcache_count+spaces_to_make,
-* settings.cache_maximum_size);
-* }
-*/
while( (spaces_to_make+objectcache_count) > cache_max_size && flushable )
{
squeezed = TRUE;
@@ -180,14 +174,14 @@
/* allocate/free cache */
void
-create_object_cache()
+create_object_cache(guint32 max_length)
{
trace_functioncall();
if (cachedata)
free_object_cache();
- cache_max_size = settings.cache_maximum_size;
+ cache_max_size = max_length;
cachedata = g_hash_table_new(g_str_hash, g_str_equal);
indexes = g_hash_table_new(g_str_hash, g_str_equal);
@@ -499,7 +493,6 @@
char *loadclass = (char *)odl_field_get_sourceclass(ft);
ObjectData *o;
int idfield;
- GEAS_DataObject retval = CORBA_OBJECT_NIL;
struct query_result *result;
q = create_base_query(configdata, loadclass);
@@ -542,7 +535,7 @@
criticalerror("%s.%s has unbalanced field lists",
odl_class_get_full_name(cl), fieldname);
oql_free_query(q);
- return (CORBA_OBJECT_NIL);
+ return (NULL);
}
if (q)
{
Index: gnue/geas/src/objectcache/objectcache.h
diff -u gnue/geas/src/objectcache/objectcache.h:1.13
gnue/geas/src/objectcache/objectcache.h:1.14
--- gnue/geas/src/objectcache/objectcache.h:1.13 Sun Apr 8 16:20:04 2001
+++ gnue/geas/src/objectcache/objectcache.h Fri May 25 13:04:54 2001
@@ -41,7 +41,7 @@
/* allocate/free cache */
-void create_object_cache();
+void create_object_cache(guint32 max_lenght);
void free_object_cache();
void oc_shrink_cache( int new_max_length );
Index: gnue/geas/src/objectlist.c
diff -u gnue/geas/src/objectlist.c:1.17 gnue/geas/src/objectlist.c:1.18
--- gnue/geas/src/objectlist.c:1.17 Fri May 25 08:46:50 2001
+++ gnue/geas/src/objectlist.c Fri May 25 13:04:54 2001
@@ -28,6 +28,7 @@
#include "geas.h"
#include "objectlist.h"
+#include "objectcache/objectcache.h"
#include "exceptions.h"
#include "collectiondata.h"
Index: gnue/geas/src/objectstore/objectstore.c
diff -u gnue/geas/src/objectstore/objectstore.c:1.56
gnue/geas/src/objectstore/objectstore.c:1.57
--- gnue/geas/src/objectstore/objectstore.c:1.56 Thu May 24 14:41:14 2001
+++ gnue/geas/src/objectstore/objectstore.c Fri May 25 13:04:55 2001
@@ -19,7 +19,7 @@
along with GEAS; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: objectstore.c,v 1.56 2001/05/24 21:41:14 reinhard Exp $
+ $Id: objectstore.c,v 1.57 2001/05/25 20:04:55 reinhard Exp $
*/
#include "config.h"
@@ -30,7 +30,7 @@
#include "geas-server.h"
#include "classdata.h"
-#include "objectcache.h"
+#include "objectcache/objectcache.h"
#include "oql.h"
#include "objectstore.h"
#include "datamonitor/datamonitor.h"
Index: gnue/geas/src/schema.c
diff -u gnue/geas/src/schema.c:1.8 gnue/geas/src/schema.c:1.9
--- gnue/geas/src/schema.c:1.8 Fri May 25 08:46:50 2001
+++ gnue/geas/src/schema.c Fri May 25 13:04:54 2001
@@ -23,6 +23,7 @@
#include "config.h"
#include "geas-server.h"
+#include "geas-skeleton.h"
#include "geas.h"
#include "classdata.h"
Index: gnue/geas/src/security.c
diff -u gnue/geas/src/security.c:1.9 gnue/geas/src/security.c:1.10
--- gnue/geas/src/security.c:1.9 Fri May 25 08:46:50 2001
+++ gnue/geas/src/security.c Fri May 25 13:04:54 2001
@@ -27,6 +27,7 @@
#include "geas.h"
#include "geas-server.h"
+#include "globals.h"
/** \brief Set up the security system
* Called by the main function, when initialising the server. Currently
Index: gnue/geas/src/servantlocator.h
diff -u gnue/geas/src/servantlocator.h:1.12 gnue/geas/src/servantlocator.h:1.13
--- gnue/geas/src/servantlocator.h:1.12 Mon May 14 14:57:57 2001
+++ gnue/geas/src/servantlocator.h Fri May 25 13:04:54 2001
@@ -22,6 +22,8 @@
#include <orb/corba_portableserver_type.h>
#include <orb/corba_portableserver.h>
+#include "objectcache/objectcache.h"
+
extern POA_GEAS_Transaction poa_geas_transaction_servant;
extern POA_GEAS_Connection poa_geas_connection_servant;
extern POA_GEAS_DataObject poa_geas_dataobject_servant;
Index: gnue/geas/src/transaction.c
diff -u gnue/geas/src/transaction.c:1.9 gnue/geas/src/transaction.c:1.10
--- gnue/geas/src/transaction.c:1.9 Fri May 25 08:46:50 2001
+++ gnue/geas/src/transaction.c Fri May 25 13:04:54 2001
@@ -23,6 +23,8 @@
#include "geas.h"
#include "geas-server.h"
+#include "globals.h"
+#include "geas-skeleton.h"
#include "transaction.h"
#include "exceptions.h"
#include "datamonitor/datamonitor.h"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/geas/src collectiondata.c connection.c fac...,
Reinhard Mueller <=