You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by fi...@apache.org on 2010/07/21 18:58:33 UTC

svn commit: r966314 [40/41] - in /incubator/etch/branches/etch-c: ./ binding-c/ binding-c/compiler/ binding-c/compiler/src/ binding-c/compiler/src/main/ binding-c/compiler/src/main/java/ binding-c/compiler/src/main/java/org/ binding-c/compiler/src/main...

Added: incubator/etch/branches/etch-c/examples/helloworld/c/helloworld_valufact.c
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/c/helloworld_valufact.c?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/c/helloworld_valufact.c (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/c/helloworld_valufact.c Wed Jul 21 16:58:23 2010
@@ -0,0 +1,518 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / c 1.1.0-incubating (LOCAL-0)
+//   Fri Aug 28 15:58:20 CEST 2009
+// This file is automatically created and should not be edited!
+
+/*
+ * helloworld_valufact.c 
+ * helloworld service value factory
+ */
+ 
+#include "helloworld_valufact.h"
+#include "helloworld_interface.h"
+#include "etch_serializer.h"
+#include "etch_exception.h"
+#include "etch_objecttypes.h"
+#include "etch_general.h"
+#include "etch_map.h"
+#include "etch_runtime.h"
+
+unsigned short CLASSID_HELLOWORLD_VALUFACT_IMPL;
+
+static helloworld_valufact_statics* _g_helloworld_valufact_statics = NULL;
+
+/* constructors */
+etch_arraylist* helloworld_valufact_get_types(helloworld_valufact*);
+
+void helloworld_valufact_free_statics();
+
+/* initializers */
+static int helloworld_valufact_init_static_fields();
+static int helloworld_valufact_init_static_types();
+static int helloworld_valufact_init_static_parameters();
+static int  helloworld_valufact_init_static_serializers();
+
+/* user serializer */
+etch_serializer* new_helloworld_user_serializer(etch_type*, etch_field*); 
+etch_object* etchserializer_helloworld_user_export_value(etch_serializer*, etch_object*);
+etch_object* etchserializer_helloworld_user_import_value(etch_serializer*, etch_object*);
+/* UserUnknownException serializer */
+etch_serializer* new_helloworld_UserUnknownException_serializer(etch_type*, etch_field*); 
+etch_object* etchserializer_helloworld_UserUnknownException_export_value(etch_serializer*, etch_object*);
+etch_object* etchserializer_helloworld_UserUnknownException_import_value(etch_serializer*, etch_object*);
+
+
+/* - - - - - - - - - - - - - - - - - - - -
+ * static constructors/destructors
+ * - - - - - - - - - - - - - - - - - - - -
+ */
+
+etch_status_t helloworld_etch_runtime_shutdown_hook_func()
+{
+    if(_g_helloworld_valufact_statics) {
+        helloworld_valufact_free_statics();
+    }
+	return ETCH_SUCCESS;
+}
+ 
+helloworld_valufact_statics* helloworld_valufact_get_static(){
+    if(_g_helloworld_valufact_statics == NULL){
+        _g_helloworld_valufact_statics  = malloc(sizeof(helloworld_valufact_statics));
+        memset(_g_helloworld_valufact_statics ,0 ,sizeof(helloworld_valufact_statics)); 
+
+        _g_helloworld_valufact_statics->_etch_helloworld_valufact_typemap = new_vf_types_collection(ETCH_DEFVF_IDNMAP_DEFINITSIZE);
+        _g_helloworld_valufact_statics->_etch_helloworld_valufact_c2tmap = new_class_to_type_map(ETCH_DEVVF_C2TMAP_DEFINITSIZE);
+
+        defvf_initialize_static(_g_helloworld_valufact_statics->_etch_helloworld_valufact_typemap, _g_helloworld_valufact_statics->_etch_helloworld_valufact_c2tmap);
+        helloworld_valufact_init_static_types();
+        helloworld_valufact_init_static_fields();
+        helloworld_valufact_init_static_parameters();
+        helloworld_valufact_init_static_serializers();
+		etch_runtime_shutdown_hook_add(helloworld_etch_runtime_shutdown_hook_func);
+    }
+
+    return _g_helloworld_valufact_statics;
+}
+
+
+/**
+ * helloworld_valufact_init_types()
+ * instantiate type objects
+ */
+static int helloworld_valufact_init_static_types ()
+{
+    int restype = NULL;
+    struct i_hashtable* vtab = NULL; 
+	helloworld_valufact_statics* p =  helloworld_valufact_get_static();
+
+    /* instantiate type name strings */
+    
+	p->str_helloworld_say_hello = new_wchar(L"etch.cbinding.test.helloworld.say_hello");
+	p->str_helloworld__result_say_hello = new_wchar(L"etch.cbinding.test.helloworld._result_say_hello");
+
+    p->str_helloworld_user = new_wchar(L"etch.cbinding.test.helloworld.user");
+    p->str_helloworld_UserUnknownException = new_wchar(L"etch.cbinding.test.helloworld.UserUnknownException");
+
+    /* instantiate type objects */
+    p->_mt_helloworld_say_hello = new_static_type(p->str_helloworld_say_hello);
+    ETCH_ASSERT(p->_mt_helloworld_say_hello);
+    p->_mt_helloworld__result_say_hello = new_static_type(p->str_helloworld__result_say_hello);
+    ETCH_ASSERT(p->_mt_helloworld__result_say_hello);
+
+    p->_mt_helloworld_user = new_static_type(p->str_helloworld_user);
+    ETCH_ASSERT(p->_mt_helloworld_user);
+    p->_mt_helloworld_UserUnknownException = new_static_type(p->str_helloworld_UserUnknownException);
+    ETCH_ASSERT(p->_mt_helloworld_UserUnknownException);
+	vtab = (struct i_hashtable*)((etch_object*)p->_etch_helloworld_valufact_typemap)->vtab;
+    /* add types to vf */
+   restype =  vtab->inserth(p->_etch_helloworld_valufact_typemap->realtable, p->_mt_helloworld_say_hello, NULL, p->_etch_helloworld_valufact_typemap, 0); 
+   ETCH_ASSERT(! restype);
+   restype =  vtab->inserth(p->_etch_helloworld_valufact_typemap->realtable, p->_mt_helloworld__result_say_hello, NULL, p->_etch_helloworld_valufact_typemap, 0); 
+   ETCH_ASSERT(! restype);
+
+	restype =  vtab->inserth(p->_etch_helloworld_valufact_typemap->realtable, p->_mt_helloworld_user, NULL, p->_etch_helloworld_valufact_typemap, 0); 
+    ETCH_ASSERT(! restype);
+	restype =  vtab->inserth(p->_etch_helloworld_valufact_typemap->realtable, p->_mt_helloworld_UserUnknownException, NULL, p->_etch_helloworld_valufact_typemap, 0); 
+    ETCH_ASSERT(! restype);
+
+    /* set type response fields */
+    etchtype_set_response_field(p->_mt_helloworld__result_say_hello,  builtins._mf_result);
+
+    /* set message result types */
+    etchtype_set_result_type (p->_mt_helloworld_say_hello,  p->_mt_helloworld__result_say_hello);
+
+    /* set timeouts */
+    etchtype_set_timeout (p->_mt_helloworld__result_say_hello,  0);
+
+	/* set async modes */
+    etchtype_set_async_mode(p->_mt_helloworld_say_hello, ETCH_ASYNCMODE_NONE);
+
+	return 0;
+}
+
+
+/**
+ * helloworld_valufact_init_fields()
+ * instantiate field objects
+ */
+static int helloworld_valufact_init_static_fields ()
+{
+    helloworld_valufact_get_static()->str_helloworld_id = new_wchar(L"id");
+    helloworld_valufact_get_static()->str_helloworld_name = new_wchar(L"name");
+    helloworld_valufact_get_static()->str_helloworld_mes = new_wchar(L"mes");
+    helloworld_valufact_get_static()->str_helloworld_to_whom = new_wchar(L"to_whom");
+
+    helloworld_valufact_get_static()->_mf_helloworld_id = new_static_field(helloworld_valufact_get_static()->str_helloworld_id);
+    helloworld_valufact_get_static()->_mf_helloworld_name = new_static_field(helloworld_valufact_get_static()->str_helloworld_name);
+    helloworld_valufact_get_static()->_mf_helloworld_mes = new_static_field(helloworld_valufact_get_static()->str_helloworld_mes);
+    helloworld_valufact_get_static()->_mf_helloworld_to_whom = new_static_field(helloworld_valufact_get_static()->str_helloworld_to_whom);
+	return 0;
+
+}
+
+/**
+ * helloworld_valufact_init_parameters()
+ * initialize service method parameters
+ */
+static int helloworld_valufact_init_static_parameters ()
+{
+	helloworld_valufact_statics* p = helloworld_valufact_get_static();
+	
+	
+//params for built-in List( etch_arraylist )
+//params for built-in Map( etch_hashtable )
+//params for built-in Set( etch_set )
+//params for built-in Datetime( etch_date )
+//params for struct user ([int id, string name])
+	etchtype_put_validator(p->_mt_helloworld_user,
+	                       clone_field(p->_mf_helloworld_id), 
+		                   (etch_object*)etchvtor_int32_get( 0 ));
+	etchtype_put_validator(p->_mt_helloworld_user,
+	                       clone_field(p->_mf_helloworld_name), 
+		                   (etch_object*)etchvtor_string_get( 0 ));
+//params for except UserUnknownException ([string mes])
+	etchtype_put_validator(p->_mt_helloworld_UserUnknownException,
+	                       clone_field(p->_mf_helloworld_mes), 
+		                   (etch_object*)etchvtor_string_get( 0 ));
+//params for message SERVER string say_hello ([user to_whom]) throws [UserUnknownException]
+	etchtype_put_validator(p->_mt_helloworld_say_hello,
+	                       clone_field(p->_mf_helloworld_to_whom), 
+						   (etch_object*)etchvtor_custom_get(ETCHTYPEB_USER, get_dynamic_classid_unique(&CLASSID_HELLOWORLD_USER), helloworld_valufact_get_static()->_mt_helloworld_user, 0));
+    etchtype_put_validator(p->_mt_helloworld_say_hello, 
+        clone_field(builtins._mf__message_id), (etch_object*) etchvtor_int64_get(0));
+//params for message CLIENT void _result_say_hello ([string result]) throws []
+	etchtype_put_validator(p->_mt_helloworld__result_say_hello,
+	                       builtins._mf_result, 
+						   (etch_object*)etchvtor_string_get( 0 ));
+    etchtype_put_validator(p->_mt_helloworld__result_say_hello, 
+        clone_field(builtins._mf__message_id), (etch_object*) etchvtor_int64_get(0));
+	etchtype_put_validator(p->_mt_helloworld__result_say_hello, 
+        clone_field(builtins._mf_result), (etch_object*) etchvtor_exception_get(0));
+	etchtype_put_validator(p->_mt_helloworld__result_say_hello, 
+        clone_field(builtins._mf__in_reply_to), (etch_object*) etchvtor_int64_get(0));
+	etchtype_put_validator(p->_mt_helloworld__result_say_hello,
+	                       builtins._mf_result, 
+		                   (etch_object*)etchvtor_custom_get( ETCHTYPEB_USER,get_dynamic_classid_unique(&CLASSID_HELLOWORLD_USERUNKNOWNEXCEPTION), helloworld_valufact_get_static()->_mt_helloworld_UserUnknownException,0));
+	etchtype_put_validator(p->_mt_helloworld__result_say_hello,
+	                       builtins._mf_result, 
+		                   (etch_object*)etchvtor_string_get( 0 ));
+	
+
+//OLD
+//structs	
+	return 0;
+}
+
+/**
+ * helloworld_valufact_init_serializers()
+ */
+static int helloworld_valufact_init_static_serializers ()
+{
+    int  result = 0;
+    helloworld_valufact_statics* p = helloworld_valufact_get_static();
+    class_to_type_map* c2tmap = p->_etch_helloworld_valufact_c2tmap;
+
+    const unsigned short classid_helloworld_user = get_dynamic_classid_unique(&CLASSID_HELLOWORLD_USER);
+    const unsigned short classid_helloworld_UserUnknownException = get_dynamic_classid_unique(&CLASSID_HELLOWORLD_USERUNKNOWNEXCEPTION);
+
+    /* note that etch_serializer_init takes care of the class to type, setting
+     * of component type, instantiation of import export helper and installing
+     * it to the type. 
+     */
+
+    /* serializer for helloworld_user */
+    result = etch_serializer_init (p->_mt_helloworld_user, p->str_helloworld_user, 
+        ETCHMAKECLASS(ETCHTYPEB_USER, classid_helloworld_user), 
+            c2tmap, NULL, new_helloworld_user_serializer);
+
+	  /* serializer for helloworld_UserUnknownException */
+    result = etch_serializer_init (p->_mt_helloworld_UserUnknownException, p->str_helloworld_UserUnknownException, 
+        ETCHMAKECLASS(ETCHTYPEB_EXCEPTION, classid_helloworld_UserUnknownException), 
+            c2tmap, NULL, new_helloworld_UserUnknownException_serializer);
+
+    return result;
+}
+
+
+
+/**
+ * destroy_helloworld_valufact_impl()
+ * destructor for the helloworld value factory extension
+ */
+int destroy_helloworld_valufact_impl(void* data)
+{
+    helloworld_valufact_impl* impl = (helloworld_valufact_impl*)data;
+    if (NULL == impl) return -1;
+
+    if (!is_etchobj_static_content(impl))
+    {
+        // add if neccessary
+    }
+
+   return destroy_objectex((etch_object*) impl);
+}
+
+
+/* - - - - - - - - - - - - - - - - - - - -
+ * constructors/destructors
+ * - - - - - - - - - - - - - - - - - - - -
+ */
+ 
+helloworld_valufact* new_helloworld_valufact()
+{
+    helloworld_valufact_impl* impl = NULL;
+	default_value_factory* pvf = new_default_value_factory (
+		helloworld_valufact_get_static()->_etch_helloworld_valufact_typemap, 
+		helloworld_valufact_get_static()->_etch_helloworld_valufact_c2tmap);
+    ETCH_ASSERT(pvf);
+
+    /* note that the vf destructor is the default value factory destructor,
+     * which in turn invokes the destructor on its impl object 
+     */
+    impl = (helloworld_valufact_impl*) new_object (sizeof(helloworld_valufact_impl), 
+       ETCHTYPEB_VALUEFACTIMP, get_dynamic_classid_unique(&CLASSID_HELLOWORLD_VALUFACT_IMPL));
+
+    ((etch_object*)impl)->destroy = destroy_helloworld_valufact_impl; 
+    pvf->impl = (etch_object*) impl;	
+    return pvf; 
+}
+
+
+/* - - - - - - - - - - - - - - - - - - - -
+ * vf class methods
+ * - - - - - - - - - - - - - - - - - - - -
+ */
+ 
+void helloworld_valufact_free_statics ()
+{
+    
+	helloworld_valufact_statics* data = helloworld_valufact_get_static();
+    ETCH_ASSERT(data); 
+
+    destroy_static_type (data->_mt_helloworld_say_hello);
+    destroy_static_type (data->_mt_helloworld__result_say_hello);
+	
+    destroy_static_type (data->_mt_helloworld_user);
+    destroy_static_type (data->_mt_helloworld_UserUnknownException);
+
+    destroy_static_field(data->_mf_helloworld_id);
+    destroy_static_field(data->_mf_helloworld_name);
+    destroy_static_field(data->_mf_helloworld_mes);
+    destroy_static_field(data->_mf_helloworld_to_whom);
+
+    etch_free (data->str_helloworld_id);
+    etch_free (data->str_helloworld_name);
+    etch_free (data->str_helloworld_mes);
+    etch_free (data->str_helloworld_to_whom);
+
+    etch_free (data->str_helloworld_say_hello);
+    etch_free (data->str_helloworld__result_say_hello);
+
+    etch_free (data->str_helloworld_user);
+    etch_free (data->str_helloworld_UserUnknownException);
+
+
+    //set_etchobj_static_content(data->_etch_helloworld_valufact_typemap);
+    //set_etchobj_static_content(data->_etch_helloworld_valufact_c2tmap);
+	
+	data->_etch_helloworld_valufact_typemap->is_readonly_keys = 0;
+    data->_etch_helloworld_valufact_c2tmap->is_readonly_keys = 0;
+    etch_object_destroy(data->_etch_helloworld_valufact_typemap);
+    etch_object_destroy(data->_etch_helloworld_valufact_c2tmap);
+
+	etch_free(data);
+	_g_helloworld_valufact_statics = NULL;
+}
+
+
+/* - - - - - - - - - - - - - - - - - - - -
+ * serializers
+ * - - - - - - - - - - - - - - - - - - - -
+ */
+ 
+/**
+ * etchserializer_helloworld_user_export_value() 
+ * export valueof a helloworld_user
+ * @param objval a helloworld_user, caller owns it and presumably will
+ * destroy it upon return from this method.
+ * @return the exported disposable structvalue object. caller must cast it.
+ */
+etch_object* etchserializer_helloworld_user_export_value(etch_serializer* thisx, etch_object* objval)
+{
+    const int THISINITSIZE = 2;
+    etch_structvalue* expstruct = NULL;
+    const unsigned short classid_helloworld_user = get_dynamic_classid_unique(&CLASSID_HELLOWORLD_USER);
+	if (!is_etch_objparams(objval, ETCHTYPEB_USER, classid_helloworld_user)) return NULL;
+
+    expstruct = new_structvalue((etch_type*) thisx->type, THISINITSIZE);
+
+
+    structvalue_put(expstruct, _g_helloworld_valufact_statics->_mf_helloworld_id,
+	   (etch_object*) new_int32(((helloworld_user*)objval)->id));
+	if(((helloworld_user*)objval)->name) {
+		structvalue_put(expstruct, _g_helloworld_valufact_statics->_mf_helloworld_name, 
+			etch_object_clone_func((void*)((helloworld_user*)objval)->name));
+	}
+    return (etch_object*) expstruct; /* caller owns this structvalue */
+}
+
+/**
+ * etchserializer_helloworld_user_import_value() 
+ * import value for a helloworld_user.
+ * @param objval an etch_structvalue of appropriate type for the helloworld_user.
+ * caller retains ownership of this object as with all imports.
+ * @return an opaque etch object containing the imported helloworld_user. 
+ * caller owns and must destroy the returned object.  
+ */
+etch_object* etchserializer_helloworld_user_import_value (etch_serializer* thisx, etch_object* objval) 
+{
+    helloworld_user* outobj = NULL;
+	
+    etch_int32* valobj_id = NULL;
+    etch_string* valobj_name = NULL;
+
+
+    etch_structvalue* instruct = NULL;
+    if (!is_etch_struct(objval)) return NULL;
+
+    instruct = (etch_structvalue*) objval;
+    if (!structvalue_is_type(instruct, thisx->type)) return NULL;
+
+
+    /* fetch the id value wrapper out of the struct. struct owns it */
+    valobj_id = (etch_int32*) structvalue_get(instruct, _g_helloworld_valufact_statics->_mf_helloworld_id);
+    if (valobj_id && !is_etch_int32(valobj_id)) return NULL;
+    /* fetch the name value wrapper out of the struct. struct owns it */
+    valobj_name = (etch_string*) structvalue_get(instruct, _g_helloworld_valufact_statics->_mf_helloworld_name);
+    if (valobj_name && !is_etch_string(valobj_name)) return NULL;
+
+    outobj = new_helloworld_user();
+	
+	
+    if(valobj_id)
+        outobj->id = valobj_id->value;
+    if(valobj_name)
+        outobj->name = (etch_string*) etch_object_clone_func((void*)valobj_name);
+    return (etch_object*) outobj;  /* caller owns this object */
+}
+
+/**
+ * new_helloworld_user_serializer() 
+ * etch_serializer_excp constructor - conforms to typedef etch_serializer_ctor
+ * @param type  - not owned
+ * @param field - not owned
+ */
+etch_serializer* new_helloworld_user_serializer(etch_type* type, etch_field* field) 
+{
+    etch_serializer* newobj = new_etch_serializer(ETCH_DEFSIZE);
+
+    ((etch_object*)newobj)->class_id = get_dynamic_classid_unique(&CLASSID_HELLOWORLD_USER_SERIALIZER);
+    newobj->type  = type;  /* not owned */
+    newobj->field = field; /* not owned */
+
+    newobj->export_value = etchserializer_helloworld_user_export_value;
+    newobj->import_value = etchserializer_helloworld_user_import_value;
+
+    return newobj;
+}
+
+/**
+ * etchserializer_helloworld_UserUnknownException_export_value() 
+ * export valueof a helloworld_UserUnknownException
+ * @param objval a helloworld_UserUnknownException, caller owns it and presumably will
+ * destroy it upon return from this method.
+ * @return the exported disposable structvalue object. caller must cast it.
+ */
+etch_object* etchserializer_helloworld_UserUnknownException_export_value(etch_serializer* thisx, etch_object* objval)
+{
+    const int THISINITSIZE = 2;
+    etch_structvalue* expstruct = NULL;
+    const unsigned short classid_helloworld_UserUnknownException = get_dynamic_classid_unique(&CLASSID_HELLOWORLD_USERUNKNOWNEXCEPTION);
+	if (!is_etch_objparams(objval, ETCHTYPEB_EXCEPTION, classid_helloworld_UserUnknownException)) return NULL;
+
+    expstruct = new_structvalue((etch_type*) thisx->type, THISINITSIZE);
+
+
+	if(((helloworld_UserUnknownException*)objval)->mes) {
+		structvalue_put(expstruct, _g_helloworld_valufact_statics->_mf_helloworld_mes, 
+			etch_object_clone_func((void*)((helloworld_UserUnknownException*)objval)->mes));
+	}
+    return (etch_object*) expstruct; /* caller owns this structvalue */
+}
+
+/**
+ * etchserializer_helloworld_UserUnknownException_import_value() 
+ * import value for a helloworld_UserUnknownException.
+ * @param objval an etch_structvalue of appropriate type for the helloworld_UserUnknownException.
+ * caller retains ownership of this object as with all imports.
+ * @return an opaque etch object containing the imported helloworld_UserUnknownException. 
+ * caller owns and must destroy the returned object.  
+ */
+etch_object* etchserializer_helloworld_UserUnknownException_import_value (etch_serializer* thisx, etch_object* objval) 
+{
+    helloworld_UserUnknownException* outobj = NULL;
+	
+    etch_string* valobj_mes = NULL;
+
+
+    etch_structvalue* instruct = NULL;
+    if (!is_etch_struct(objval)) return NULL;
+
+    instruct = (etch_structvalue*) objval;
+    if (!structvalue_is_type(instruct, thisx->type)) return NULL;
+
+
+    /* fetch the mes value wrapper out of the struct. struct owns it */
+    valobj_mes = (etch_string*) structvalue_get(instruct, _g_helloworld_valufact_statics->_mf_helloworld_mes);
+    if (valobj_mes && !is_etch_string(valobj_mes)) return NULL;
+
+    outobj = new_helloworld_UserUnknownException();
+	
+	
+    if(valobj_mes)
+        outobj->mes = (etch_string*) etch_object_clone_func((void*)valobj_mes);
+    return (etch_object*) outobj;  /* caller owns this object */
+}
+
+/**
+ * new_helloworld_UserUnknownException_serializer() 
+ * etch_serializer_excp constructor - conforms to typedef etch_serializer_ctor
+ * @param type  - not owned
+ * @param field - not owned
+ */
+etch_serializer* new_helloworld_UserUnknownException_serializer(etch_type* type, etch_field* field) 
+{
+    etch_serializer* newobj = new_etch_serializer(ETCH_DEFSIZE);
+
+    ((etch_object*)newobj)->class_id = get_dynamic_classid_unique(&CLASSID_HELLOWORLD_USERUNKNOWNEXCEPTION_SERIALIZER);
+    newobj->type  = type;  /* not owned */
+    newobj->field = field; /* not owned */
+
+    newobj->export_value = etchserializer_helloworld_UserUnknownException_export_value;
+    newobj->import_value = etchserializer_helloworld_UserUnknownException_import_value;
+
+    return newobj;
+}
+

Added: incubator/etch/branches/etch-c/examples/helloworld/c/helloworld_valufact.h
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/c/helloworld_valufact.h?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/c/helloworld_valufact.h (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/c/helloworld_valufact.h Wed Jul 21 16:58:23 2010
@@ -0,0 +1,104 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / c 1.1.0-incubating (LOCAL-0)
+//   Fri Aug 28 15:58:20 CEST 2009
+// This file is automatically created and should not be edited!
+
+ 
+/*
+ * helloworld_valufact.h
+ * helloworld implementation of value factory
+ */
+
+#ifndef HELLOWORLD_VALUFACT_H
+#define HELLOWORLD_VALUFACT_H
+
+#include "etch_default_value_factory.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef default_value_factory helloworld_valufact;
+
+extern unsigned short CLASSID_HELLOWORLD_VALUFACT_IMPL;
+
+unsigned short CLASSID_HELLOWORLD_USER_SERIALIZER;
+unsigned short CLASSID_HELLOWORLD_USERUNKNOWNEXCEPTION_SERIALIZER;
+
+
+/**
+ * helloworld_valufact_statics
+ */
+typedef struct helloworld_valufact_statics
+{
+    class_to_type_map*  _etch_helloworld_valufact_c2tmap;
+    vf_idname_map*      _etch_helloworld_valufact_typemap;
+
+    etch_type* _mt_helloworld_say_hello;
+    etch_type* _mt_helloworld__result_say_hello;
+
+    etch_type* _mt_helloworld_user;
+    etch_type* _mt_helloworld_UserUnknownException;
+
+	
+    etch_field* _mf_helloworld_id;
+    etch_field* _mf_helloworld_name;
+    etch_field* _mf_helloworld_mes;
+    etch_field* _mf_helloworld_to_whom;
+
+    struct etch_serializer* serializer_user;
+    struct etch_serializer* serializer_UserUnknownException;
+
+    wchar_t* str_helloworld_id;
+    wchar_t* str_helloworld_name;
+    wchar_t* str_helloworld_mes;
+    wchar_t* str_helloworld_to_whom;
+
+    wchar_t* str_helloworld_say_hello;
+    wchar_t* str_helloworld__result_say_hello;
+    wchar_t* str_helloworld_user;
+    wchar_t* str_helloworld_UserUnknownException;
+
+} helloworld_valufact_statics;
+
+/**
+ * helloworld_valufact_impl
+ * helloworld extension of default value factory
+ */
+typedef struct helloworld_valufact_impl
+{
+    etch_object object;    
+    	
+} helloworld_valufact_impl;
+
+helloworld_valufact* new_helloworld_valufact();
+helloworld_valufact_statics* helloworld_valufact_get_static();
+
+#ifdef __cplusplus
+} //extern "C"
+#endif
+
+#endif 
+

Added: incubator/etch/branches/etch-c/examples/helloworld/c/readme-etch-c-files.txt
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/c/readme-etch-c-files.txt?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/c/readme-etch-c-files.txt (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/c/readme-etch-c-files.txt Wed Jul 21 16:58:23 2010
@@ -0,0 +1,10 @@
+
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / c 1.1.0-incubating (LOCAL-0)
+//   Fri Aug 28 15:58:20 CEST 2009
+// This file is automatically created and should not be edited!
+
+Generated C Binding files of Apache Etch.
+
+Add your specific implementations to xxx_client_impl.c/xxx_server_impl.c
+Startup is done via xxx_listener_main.c/xxx_client_main.c

Added: incubator/etch/branches/etch-c/examples/helloworld/etch/generate-c-and-java.bat
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/etch/generate-c-and-java.bat?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/etch/generate-c-and-java.bat (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/etch/generate-c-and-java.bat Wed Jul 21 16:58:23 2010
@@ -0,0 +1,23 @@
+rem
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements.  See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership.  The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License.  You may obtain a copy of the License at
+rem
+rem   http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied.  See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
+rem
+rem
+call ..\..\..\target\Installers\dist\bin\etch.bat -b java -w BOTH,IMPL,INTF,MAIN -d ..\java helloworld.etch
+call ..\..\..\target\Installers\dist\bin\etch.bat -b c -w BOTH,IMPL,INTF,MAIN -d ..\c helloworld.etch
+

Added: incubator/etch/branches/etch-c/examples/helloworld/etch/helloworld.etch
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/etch/helloworld.etch?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/etch/helloworld.etch (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/etch/helloworld.etch Wed Jul 21 16:58:23 2010
@@ -0,0 +1,16 @@
+module etch.cbinding.test
+
+service helloworld {
+	struct user (
+		int id,
+		string name
+	)
+
+	exception UserUnknownException (
+		string mes
+	)
+
+	@Direction(Server)
+	string say_hello(user to_whom) throws UserUnknownException
+
+}
\ No newline at end of file

Added: incubator/etch/branches/etch-c/examples/helloworld/java/.classpath
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/.classpath?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/.classpath (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/.classpath Wed Jul 21 16:58:23 2010
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path=""/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="lib" path="apache-etch-java-runtime-1.1.0-incubating.jar"/>
+	<classpathentry kind="output" path=""/>
+</classpath>

Added: incubator/etch/branches/etch-c/examples/helloworld/java/.project
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/.project?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/.project (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/.project Wed Jul 21 16:58:23 2010
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>helloworld</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: incubator/etch/branches/etch-c/examples/helloworld/java/apache-etch-java-runtime-1.1.0-incubating.jar
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/apache-etch-java-runtime-1.1.0-incubating.jar?rev=966314&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/etch/branches/etch-c/examples/helloworld/java/apache-etch-java-runtime-1.1.0-incubating.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Propchange: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jul 21 16:58:23 2010
@@ -0,0 +1 @@
+*.class

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/BasehelloworldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/BasehelloworldClient.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/BasehelloworldClient.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/BasehelloworldClient.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,57 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+// Re-implement these methods by overriding them in ImplhelloworldClient.
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import org.apache.etch.bindings.java.support.ObjSession;
+
+
+/**
+ * Base implementation of helloworldClient, with default method implementations
+ * which throw UnsupportedOperationException. Extend this class to provide
+ * implementations of messages from the server.
+ *
+ * @see ImplhelloworldClient
+ */
+public class BasehelloworldClient implements helloworldClient, ObjSession
+{
+	public Object _sessionQuery( Object query ) throws Exception
+	{
+		throw new UnsupportedOperationException( "unknown query: "+query );
+	}
+
+	public void _sessionControl( Object control, Object value ) throws Exception
+	{
+		throw new UnsupportedOperationException( "unknown control: "+control );
+	}
+
+	public void _sessionNotify( Object event ) throws Exception
+	{
+		if (event instanceof Throwable)
+			((Throwable) event).printStackTrace();
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/BasehelloworldServer.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/BasehelloworldServer.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/BasehelloworldServer.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/BasehelloworldServer.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,67 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+// Re-implement these methods by overriding them in ImplhelloworldServer.
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import org.apache.etch.bindings.java.support.ObjSession;
+
+
+/**
+ * Base implementation of helloworldServer, with default method implementations
+ * which throw UnsupportedOperationException. Extend this class to provide
+ * implementations of messages from the client.
+ *
+ * @see ImplhelloworldServer
+ */
+public class BasehelloworldServer implements helloworldServer, ObjSession
+{
+	public Object _sessionQuery( Object query ) throws Exception
+	{
+		throw new UnsupportedOperationException( "unknown query: "+query );
+	}
+
+	public void _sessionControl( Object control, Object value ) throws Exception
+	{
+		throw new UnsupportedOperationException( "unknown control: "+control );
+	}
+
+	public void _sessionNotify( Object event ) throws Exception
+	{
+		if (event instanceof Throwable)
+			((Throwable) event).printStackTrace();
+	}
+
+	public String say_hello
+	(
+		etch.cbinding.test.helloworld.user to_whom
+	)
+	throws
+		etch.cbinding.test.helloworld.UserUnknownException
+	{
+		throw new UnsupportedOperationException( "say_hello" );
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ImplhelloworldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ImplhelloworldClient.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ImplhelloworldClient.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ImplhelloworldClient.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,57 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Feb 05 15:40:43 CET 2010
+// This file is automatically created for your convenience and will not be
+// overwritten once it exists! Please edit this file as necessary to implement
+// your service logic.
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+/**
+ * Your custom implementation of BasehelloworldClient. Add methods here to provide
+ * implementations of messages from the server.
+ */
+public class ImplhelloworldClient extends BasehelloworldClient
+{
+	/**
+	 * Constructs the ImplhelloworldClient.
+	 *
+	 * @param server a connection to the server session. Use this to send a
+	 * message to the server.
+	 */
+	public ImplhelloworldClient( RemotehelloworldServer server )
+	{
+		this.server = server;
+	}
+	
+	/**
+	 * A connection to the server session. Use this to send a
+	 * message to the server.
+	 */
+	@SuppressWarnings( "unused" )
+	private final RemotehelloworldServer server;
+
+	// TODO insert methods here to provide implementations of helloworldClient
+	// messages from the server.
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ImplhelloworldServer.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ImplhelloworldServer.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ImplhelloworldServer.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ImplhelloworldServer.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,62 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Feb 05 15:40:43 CET 2010
+// This file is automatically created for your convenience and will not be
+// overwritten once it exists! Please edit this file as necessary to implement
+// your service logic.
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+/**
+ * Your custom implementation of BasehelloworldServer. Add methods here to provide
+ * implementations of messages from the client.
+ */
+public class ImplhelloworldServer extends BasehelloworldServer
+{
+	/**
+	 * Constructs the ImplhelloworldServer.
+	 *
+	 * @param client a connection to the client session. Use this to send a
+	 * message to the client.
+	 */
+	public ImplhelloworldServer( RemotehelloworldClient client )
+	{
+		this.client = client;
+	}
+	
+	/**
+	 * A connection to the client session. Use this to send a
+	 * message to the client.
+	 */
+	@SuppressWarnings( "unused" )
+	private final RemotehelloworldClient client;
+
+	// TODO insert methods here to provide implementations of helloworldServer
+	// messages from the client.
+	
+	@Override
+	public String say_hello(user toWhom) throws UserUnknownException {
+		return "Hello " + toWhom.name + ", nice to meet you!";
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/MainhelloworldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/MainhelloworldClient.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/MainhelloworldClient.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/MainhelloworldClient.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,65 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Feb 05 15:40:43 CET 2010
+// This file is automatically created for your convenience and will not be
+// overwritten once it exists! Please edit this file as necessary to implement
+// your service logic.
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+/**
+ * Main program for helloworldClient. This program makes a connection to the
+ * listener created by MainhelloworldListener.
+ */
+public class MainhelloworldClient implements helloworldHelper.helloworldClientFactory
+{
+	/**
+	 * Main program for helloworldClient.
+	 * 
+	 * @param args command line arguments.
+	 * @throws Exception
+	 */
+	public static void main( String[] args ) throws Exception
+	{
+		// TODO Change to correct URI
+		String uri = "tcp://localhost:4001";
+		
+		RemotehelloworldServer server = helloworldHelper.newServer( uri, null,
+			new MainhelloworldClient() );
+
+		// Connect to the service
+		server._startAndWaitUp( 4000 );
+
+		// TODO Insert Your Code Here
+
+		// Disconnect from the service
+		server._stopAndWaitDown( 4000 );
+	}
+
+	public helloworldClient newhelloworldClient( RemotehelloworldServer server )
+		throws Exception
+	{
+		return new ImplhelloworldClient( server );
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/MainhelloworldListener.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/MainhelloworldListener.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/MainhelloworldListener.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/MainhelloworldListener.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,63 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Feb 05 15:40:43 CET 2010
+// This file is automatically created for your convenience and will not be
+// overwritten once it exists! Please edit this file as necessary to implement
+// your service logic.
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import org.apache.etch.bindings.java.support.ServerFactory;
+import org.apache.etch.util.core.io.Transport;
+
+/**
+ * Main program for helloworldServer. This program makes a listener to accept
+ * connections from MainhelloworldClient.
+ */
+public class MainhelloworldListener implements helloworldHelper.helloworldServerFactory
+{
+	/**
+	 * Main program for helloworldServer.
+	 * 
+	 * @param args command line arguments.
+	 * @throws Exception
+	 */
+	public static void main( String[] args ) throws Exception
+	{
+		// TODO Change to correct URI
+		String uri = "tcp://0.0.0.0:4004";
+		
+		ServerFactory listener = helloworldHelper.newListener( uri, null,
+			new MainhelloworldListener() );
+		System.out.println("This is the hello server...");
+		// Start the Listener
+		listener.transportControl( Transport.START_AND_WAIT_UP, 9999999 );
+		
+	}
+
+	public helloworldServer newhelloworldServer( RemotehelloworldClient client )
+	{
+		return new ImplhelloworldServer( client );
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/Remotehelloworld.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/Remotehelloworld.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/Remotehelloworld.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/Remotehelloworld.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,71 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+
+/**
+ * Call to message translator for helloworld.
+ */
+@SuppressWarnings("unused")
+public class Remotehelloworld extends org.apache.etch.bindings.java.support.RemoteBase implements helloworld
+{
+	/**
+	 * Constructs the Remotehelloworld.
+	 *
+	 * @param svc
+	 * @param vf
+	 */
+	public Remotehelloworld( org.apache.etch.bindings.java.support.DeliveryService svc, org.apache.etch.bindings.java.msg.ValueFactory vf )
+	{
+		super( svc, vf );
+	}
+
+	/**
+	 * {@link _Async} class instance used to hide asynchronous message
+	 * implementation. Use this to invoke the asynchronous message
+	 * implementations.
+	 */
+	public final _Async _async = new _Async();
+
+	/**
+	 * {@link _Async} class instance used to hide asynchronous message
+	 * implementation. This is here for backwards compatibility only, use
+	 * {@link #_async} instead.
+	 * @deprecated
+	 */
+	@Deprecated
+	public final _Async _inner = _async;
+
+	/**
+	 * Asynchronous implementation of service methods.
+	 */
+	public class _Async
+	{
+
+		// Mixin Methods
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/RemotehelloworldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/RemotehelloworldClient.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/RemotehelloworldClient.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/RemotehelloworldClient.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,71 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+
+/**
+ * Call to message translator for helloworldClient.
+ */
+@SuppressWarnings("unused")
+public final class RemotehelloworldClient extends Remotehelloworld implements helloworldClient
+{
+	/**
+	 * Constructs the RemotehelloworldClient.
+	 *
+	 * @param svc
+	 * @param vf
+	 */
+	public RemotehelloworldClient( org.apache.etch.bindings.java.support.DeliveryService svc, org.apache.etch.bindings.java.msg.ValueFactory vf )
+	{
+		super( svc, vf );
+	}
+
+	/**
+	 * {@link _Async} class instance used to hide asynchronous message
+	 * implementation. Use this to invoke the asynchronous message
+	 * implementations.
+	 */
+	public final _Async _async = new _Async();
+
+	/**
+	 * {@link _Async} class instance used to hide asynchronous message
+	 * implementation. This is here for backwards compatibility only, use
+	 * {@link #_async} instead.
+	 * @deprecated
+	 */
+	@Deprecated
+	public final _Async _inner = _async;
+
+	/**
+	 * Asynchronous implementation of service methods.
+	 */
+	public final class _Async extends Remotehelloworld._Async
+	{
+
+		// Mixin Methods
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/RemotehelloworldServer.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/RemotehelloworldServer.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/RemotehelloworldServer.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/RemotehelloworldServer.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,127 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+
+/**
+ * Call to message translator for helloworldServer.
+ */
+@SuppressWarnings("unused")
+public final class RemotehelloworldServer extends Remotehelloworld implements helloworldServer
+{
+	/**
+	 * Constructs the RemotehelloworldServer.
+	 *
+	 * @param svc
+	 * @param vf
+	 */
+	public RemotehelloworldServer( org.apache.etch.bindings.java.support.DeliveryService svc, org.apache.etch.bindings.java.msg.ValueFactory vf )
+	{
+		super( svc, vf );
+	}
+
+	/**
+	 * {@link _Async} class instance used to hide asynchronous message
+	 * implementation. Use this to invoke the asynchronous message
+	 * implementations.
+	 */
+	public final _Async _async = new _Async();
+
+	/**
+	 * {@link _Async} class instance used to hide asynchronous message
+	 * implementation. This is here for backwards compatibility only, use
+	 * {@link #_async} instead.
+	 * @deprecated
+	 */
+	@Deprecated
+	public final _Async _inner = _async;
+
+	public final String say_hello(
+		etch.cbinding.test.helloworld.user to_whom
+	)
+	throws
+		etch.cbinding.test.helloworld.UserUnknownException
+	{
+		return
+		_async._end_say_hello( _async._begin_say_hello(
+			to_whom
+		) );
+	}
+
+	/**
+	 * Asynchronous implementation of service methods.
+	 */
+	public final class _Async extends Remotehelloworld._Async
+	{
+
+		/**
+		 * Begins a call to say_hello.
+		 *
+		 * @return mailbox used to retrieve the result using _end_say_hello.
+		 * @see RemotehelloworldServer#say_hello
+		 * @see #_end_say_hello
+		 */
+		public final org.apache.etch.bindings.java.support.Mailbox _begin_say_hello(
+			etch.cbinding.test.helloworld.user to_whom
+		)
+		{
+			org.apache.etch.bindings.java.msg.Message _msg = _newMessage( ValueFactoryhelloworld._mt_etch_cbinding_test_helloworld_say_hello );
+			_msg.put( ValueFactoryhelloworld._mf_to_whom, to_whom );
+			return _begincall( _msg );
+		}
+		
+		/**
+		 * Ends a call to say_hello.
+		 *
+		 * @param mb mailbox returned by _begin_say_hello.
+		 *
+		 * @see RemotehelloworldServer#say_hello
+		 * @see #_begin_say_hello
+		 */
+		public final String _end_say_hello( org.apache.etch.bindings.java.support.Mailbox mb )
+			throws
+				etch.cbinding.test.helloworld.UserUnknownException
+		{
+			try
+			{
+				return
+					(String)
+						_endcall( mb,
+							ValueFactoryhelloworld._mt_etch_cbinding_test_helloworld__result_say_hello );
+			}
+			catch ( Exception e )
+			{
+				if (e instanceof etch.cbinding.test.helloworld.UserUnknownException)
+					throw (etch.cbinding.test.helloworld.UserUnknownException) e;
+				if (e instanceof RuntimeException) throw (RuntimeException) e;
+				throw new RuntimeException( "unexpected exception from peer: "+e, e );
+			}
+		}
+
+		// Mixin Methods
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/Stubhelloworld.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/Stubhelloworld.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/Stubhelloworld.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/Stubhelloworld.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,72 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import org.apache.etch.util.core.Who;
+import org.apache.etch.bindings.java.msg.Message;
+import org.apache.etch.bindings.java.support.DeliveryService;
+import org.apache.etch.bindings.java.support.Pool;
+import org.apache.etch.bindings.java.support.StubHelper;
+import org.apache.etch.bindings.java.support._Etch_AuthException;
+import org.apache.etch.bindings.java.support.StubBase;
+import org.apache.etch.bindings.java.support.Pool.PoolRunnable;
+
+/**
+ * Message to call translator for helloworld.
+ * @param <T> helloworld or a subclass thereof.
+ */
+@SuppressWarnings("unused")
+public class Stubhelloworld<T extends helloworld> extends StubBase<T>
+{
+	/**
+	 * Stub for helloworld.
+	 * @param svc the delivery service.
+	 * @param obj the implementation of helloworld responsive to requests.
+	 * @param queued thread pool used to run AsyncMode.QUEUED methods.
+	 * @param free thread pool used to run AsyncMode.FREE methods.
+	 */
+	public Stubhelloworld( DeliveryService svc, T obj, Pool queued, Pool free )
+	{
+		super( svc, obj, queued, free );
+	}
+	
+	static
+	{
+	}
+
+	/**
+	 * Method used to force static initialization.
+	 */
+	public static void init()
+	{
+		// nothing to do.
+	}
+	
+	static
+	{
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/StubhelloworldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/StubhelloworldClient.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/StubhelloworldClient.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/StubhelloworldClient.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,70 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import org.apache.etch.util.core.Who;
+import org.apache.etch.bindings.java.msg.Message;
+import org.apache.etch.bindings.java.support.DeliveryService;
+import org.apache.etch.bindings.java.support.Pool;
+import org.apache.etch.bindings.java.support.StubHelper;
+import org.apache.etch.bindings.java.support._Etch_AuthException;
+import org.apache.etch.bindings.java.support.Pool.PoolRunnable;
+
+/**
+ * Message to call translator for helloworldClient.
+ */
+@SuppressWarnings("unused")
+public class StubhelloworldClient extends Stubhelloworld<helloworldClient>
+{
+	/**
+	 * Stub for helloworldClient.
+	 * @param svc the delivery service.
+	 * @param obj the implementation of helloworldClient responsive to requests.
+	 * @param queued thread pool used to run AsyncMode.QUEUED methods.
+	 * @param free thread pool used to run AsyncMode.FREE methods.
+	 */
+	public StubhelloworldClient( DeliveryService svc, helloworldClient obj, Pool queued, Pool free )
+	{
+		super( svc, obj, queued, free );
+	}
+	
+	static
+	{
+	}
+
+	/**
+	 * Method used to force static initialization.
+	 */
+	public static void init()
+	{
+		// nothing to do.
+	}
+	
+	static
+	{
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/StubhelloworldServer.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/StubhelloworldServer.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/StubhelloworldServer.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/StubhelloworldServer.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,91 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import org.apache.etch.util.core.Who;
+import org.apache.etch.bindings.java.msg.Message;
+import org.apache.etch.bindings.java.support.DeliveryService;
+import org.apache.etch.bindings.java.support.Pool;
+import org.apache.etch.bindings.java.support.StubHelper;
+import org.apache.etch.bindings.java.support._Etch_AuthException;
+import org.apache.etch.bindings.java.support.Pool.PoolRunnable;
+
+/**
+ * Message to call translator for helloworldServer.
+ */
+@SuppressWarnings("unused")
+public class StubhelloworldServer extends Stubhelloworld<helloworldServer>
+{
+	/**
+	 * Stub for helloworldServer.
+	 * @param svc the delivery service.
+	 * @param obj the implementation of helloworldServer responsive to requests.
+	 * @param queued thread pool used to run AsyncMode.QUEUED methods.
+	 * @param free thread pool used to run AsyncMode.FREE methods.
+	 */
+	public StubhelloworldServer( DeliveryService svc, helloworldServer obj, Pool queued, Pool free )
+	{
+		super( svc, obj, queued, free );
+	}
+	
+	static
+	{
+	}
+
+	/**
+	 * Method used to force static initialization.
+	 */
+	public static void init()
+	{
+		// nothing to do.
+	}
+	
+	static
+	{
+		ValueFactoryhelloworld._mt_etch_cbinding_test_helloworld_say_hello.setStubHelper( new StubHelper<helloworldServer>()
+		{
+			public final void run( DeliveryService _svc, helloworldServer _obj, Who _sender, Message _msg ) throws Exception
+			{
+				final Message _rmsg = _msg.reply();
+				try
+				{
+					_rmsg.put( ValueFactoryhelloworld._mf_result,
+					_obj.say_hello(
+						(etch.cbinding.test.helloworld.user) _msg.get( ValueFactoryhelloworld._mf_to_whom )
+					)
+					);
+				}
+				catch ( Exception e )
+				{
+					sessionNotify( _obj, e );
+					_rmsg.put( ValueFactoryhelloworld._mf_result, e );
+				}
+				_svc.transportMessage( _sender, _rmsg );
+			}
+		} );
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ValueFactoryhelloworld.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ValueFactoryhelloworld.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ValueFactoryhelloworld.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/ValueFactoryhelloworld.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,203 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import org.apache.etch.bindings.java.msg.AsyncMode;
+import org.apache.etch.bindings.java.msg.Direction;
+import org.apache.etch.bindings.java.msg.Field;
+import org.apache.etch.bindings.java.msg.ImportExportHelper;
+import org.apache.etch.bindings.java.msg.StructValue;
+import org.apache.etch.bindings.java.msg.Type;
+import org.apache.etch.bindings.java.msg.TypeMap;
+import org.apache.etch.bindings.java.msg.ValueFactory;
+import org.apache.etch.bindings.java.support.Class2TypeMap;
+import org.apache.etch.bindings.java.support.DefaultValueFactory;
+
+
+/**
+ * ValueFactory for helloworld.
+ */
+@SuppressWarnings("unused")
+public final class ValueFactoryhelloworld extends DefaultValueFactory
+{
+	/**
+	 * Constructs ValueFactoryhelloworld.
+	 * @param uri the uri used to configure the session.
+	 */
+	public ValueFactoryhelloworld( String uri )
+	{
+		super( uri, types, class2type );
+	}
+	
+	private final static TypeMap types = new TypeMap();
+	
+	private final static Class2TypeMap class2type = new Class2TypeMap();
+
+	static
+	{
+		DefaultValueFactory.init( types, class2type );
+		initTypes();
+		initResults();
+		initFields();
+		initParams();
+	}
+
+	/** Type for etch.cbinding.test.helloworld.user */
+	public static Type _mt_etch_cbinding_test_helloworld_user;
+
+	/** Type for etch.cbinding.test.helloworld.UserUnknownException */
+	public static Type _mt_etch_cbinding_test_helloworld_UserUnknownException;
+
+	/** Type for etch.cbinding.test.helloworld.say_hello */
+	public static Type _mt_etch_cbinding_test_helloworld_say_hello;
+
+	/** Type for etch.cbinding.test.helloworld._result_say_hello */
+	public static Type _mt_etch_cbinding_test_helloworld__result_say_hello;
+
+	private static void initTypes()
+	{
+		_mt_etch_cbinding_test_helloworld_user = types.get( "etch.cbinding.test.helloworld.user" );
+		_mt_etch_cbinding_test_helloworld_UserUnknownException = types.get( "etch.cbinding.test.helloworld.UserUnknownException" );
+		_mt_etch_cbinding_test_helloworld_say_hello = types.get( "etch.cbinding.test.helloworld.say_hello" );
+		_mt_etch_cbinding_test_helloworld__result_say_hello = types.get( "etch.cbinding.test.helloworld._result_say_hello" );
+	}
+
+	private static void initResults()
+	{
+		_mt_etch_cbinding_test_helloworld_say_hello.setDirection( Direction.SERVER );
+		_mt_etch_cbinding_test_helloworld_say_hello.setAsyncMode( AsyncMode.NONE );
+		_mt_etch_cbinding_test_helloworld_say_hello.setResult( _mt_etch_cbinding_test_helloworld__result_say_hello );
+		_mt_etch_cbinding_test_helloworld__result_say_hello.setTimeout( 0 );
+		_mt_etch_cbinding_test_helloworld__result_say_hello.setDirection( Direction.CLIENT );
+	}
+
+	static
+	{
+		class2type.put( etch.cbinding.test.helloworld.user.class, _mt_etch_cbinding_test_helloworld_user );
+		_mt_etch_cbinding_test_helloworld_user.setComponentType( etch.cbinding.test.helloworld.user.class );
+		_mt_etch_cbinding_test_helloworld_user.setImportExportHelper( new ImportExportHelper()
+		{
+			public final StructValue exportValue( ValueFactory vf, Object value )
+			{
+				StructValue struct = new StructValue( _mt_etch_cbinding_test_helloworld_user, vf );
+				etch.cbinding.test.helloworld.user v = (etch.cbinding.test.helloworld.user) value;
+				struct.put( _mf_id, v.id );
+				struct.put( _mf_name, v.name );
+				return struct;
+			}
+
+			public final Object importValue( StructValue struct )
+			{
+				etch.cbinding.test.helloworld.user v = new etch.cbinding.test.helloworld.user();
+				v.id = (Integer) struct.get( _mf_id );
+				v.name = (String) struct.get( _mf_name );
+				return v;
+			}
+		} );
+	}
+
+	static
+	{
+		class2type.put( etch.cbinding.test.helloworld.UserUnknownException.class, _mt_etch_cbinding_test_helloworld_UserUnknownException );
+		_mt_etch_cbinding_test_helloworld_UserUnknownException.setComponentType( etch.cbinding.test.helloworld.UserUnknownException.class );
+		_mt_etch_cbinding_test_helloworld_UserUnknownException.setImportExportHelper( new ImportExportHelper()
+		{
+			public final StructValue exportValue( ValueFactory vf, Object value )
+			{
+				StructValue struct = new StructValue( _mt_etch_cbinding_test_helloworld_UserUnknownException, vf );
+				etch.cbinding.test.helloworld.UserUnknownException v = (etch.cbinding.test.helloworld.UserUnknownException) value;
+				struct.put( _mf_mes, v.mes );
+				return struct;
+			}
+
+			public final Object importValue( StructValue struct )
+			{
+				etch.cbinding.test.helloworld.UserUnknownException v = new etch.cbinding.test.helloworld.UserUnknownException();
+				v.mes = (String) struct.get( _mf_mes );
+				return v;
+			}
+		} );
+	}
+
+	/** Field for id */
+	public static Field _mf_id;
+
+	/** Field for name */
+	public static Field _mf_name;
+
+	/** Field for mes */
+	public static Field _mf_mes;
+
+	/** Field for to_whom */
+	public static Field _mf_to_whom;
+
+	private static void initFields()
+	{
+		_mf_id = new Field( "id" );
+		_mf_name = new Field( "name" );
+		_mf_mes = new Field( "mes" );
+		_mf_to_whom = new Field( "to_whom" );
+
+		_mt_etch_cbinding_test_helloworld__result_say_hello.setResponseField( _mf_result );
+	}
+	
+	static
+	{
+		// initialize the extern serializers:
+	}
+
+	private static void initParams()
+	{
+
+		// params for user
+		_mt_etch_cbinding_test_helloworld_user.putValidator( _mf_id, org.apache.etch.bindings.java.support.Validator_int.get( 0 ) );
+		_mt_etch_cbinding_test_helloworld_user.putValidator( _mf_name, org.apache.etch.bindings.java.support.Validator_string.get( 0 ) );
+
+		// params for UserUnknownException
+		_mt_etch_cbinding_test_helloworld_UserUnknownException.putValidator( _mf_mes, org.apache.etch.bindings.java.support.Validator_string.get( 0 ) );
+
+		// params for say_hello
+		_mt_etch_cbinding_test_helloworld_say_hello.putValidator( _mf_to_whom, org.apache.etch.bindings.java.support.Validator_custom.get( etch.cbinding.test.helloworld.user.class, 0, true ) );
+		_mt_etch_cbinding_test_helloworld_say_hello.putValidator( _mf__messageId, org.apache.etch.bindings.java.support.Validator_long.get( 0 ) );
+
+		// params for _result_say_hello
+		_mt_etch_cbinding_test_helloworld__result_say_hello.putValidator( _mf_result, org.apache.etch.bindings.java.support.Validator_string.get( 0 ) );
+		_mt_etch_cbinding_test_helloworld__result_say_hello.putValidator( _mf__messageId, org.apache.etch.bindings.java.support.Validator_long.get( 0 ) );
+		_mt_etch_cbinding_test_helloworld__result_say_hello.putValidator( _mf_result, org.apache.etch.bindings.java.support.Validator_custom.get( etch.cbinding.test.helloworld.UserUnknownException.class, 0, true ) ); // thrown UserUnknownException
+		_mt_etch_cbinding_test_helloworld__result_say_hello.putValidator( _mf_result, org.apache.etch.bindings.java.support.Validator_RuntimeException.get() ); // thrown RuntimeException
+		_mt_etch_cbinding_test_helloworld__result_say_hello.putValidator( _mf__inReplyTo, org.apache.etch.bindings.java.support.Validator_long.get( 0 ) );
+	}
+	
+	static
+	{
+		// done updating types, and class2type: lock them.
+		types.lock();
+		for (Type t: types.values())
+			t.lock();
+		class2type.lock();
+	}
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworld.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworld.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworld.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworld.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,169 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import java.io.Serializable;
+
+
+@SuppressWarnings("unused")
+public interface helloworld
+{
+	@SuppressWarnings("serial")
+	public class user
+		implements Serializable
+	{
+		/**
+		 * Constructs the user. Don't init any fields.
+		 */
+		public user()
+		{
+			// don't init any fields.
+		}
+
+		/**
+		 * Constructs the user.
+		 */
+		public user
+		(
+			Integer id
+			, String name
+		)
+		{
+			this.id = id;
+			this.name = name;
+		}
+
+		@Override
+		public String toString()
+		{
+			return String.format( "user(id=%s; name=%s)", id, name );
+		}
+
+		public Integer id;
+
+		/**
+		 * Gets the value.
+		 *
+		 *
+		 * @return the value.
+		 */
+		public Integer getId()
+		{
+			return id;
+		}
+
+		/**
+		 * Sets the value.
+		 *
+		 *
+		 * @param value the value.
+		 */
+		public void setId( Integer value )
+		{
+			this.id = value;
+		}
+
+		public String name;
+
+		/**
+		 * Gets the value.
+		 *
+		 *
+		 * @return the value.
+		 */
+		public String getName()
+		{
+			return name;
+		}
+
+		/**
+		 * Sets the value.
+		 *
+		 *
+		 * @param value the value.
+		 */
+		public void setName( String value )
+		{
+			this.name = value;
+		}
+	}
+
+	@SuppressWarnings("serial")
+	public class UserUnknownException
+		extends Exception
+	{
+		/**
+		 * Constructs the UserUnknownException. Don't init any fields.
+		 */
+		public UserUnknownException()
+		{
+			// don't init any fields.
+		}
+
+		/**
+		 * Constructs the UserUnknownException.
+		 */
+		public UserUnknownException
+		(
+			String mes
+		)
+		{
+			this.mes = mes;
+		}
+
+		@Override
+		public String getMessage()
+		{
+			return String.format( "mes=%s", mes );
+		}
+
+		public String mes;
+
+		/**
+		 * Gets the value.
+		 *
+		 *
+		 * @return the value.
+		 */
+		public String getMes()
+		{
+			return mes;
+		}
+
+		/**
+		 * Sets the value.
+		 *
+		 *
+		 * @param value the value.
+		 */
+		public void setMes( String value )
+		{
+			this.mes = value;
+		}
+	}
+
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworldClient.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworldClient.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworldClient.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,35 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+
+
+@SuppressWarnings("unused")
+public interface helloworldClient extends helloworld
+{
+	// no CLIENT direction items defined.
+}

Added: incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworldHelper.java
URL: http://svn.apache.org/viewvc/incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworldHelper.java?rev=966314&view=auto
==============================================================================
--- incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworldHelper.java (added)
+++ incubator/etch/branches/etch-c/examples/helloworld/java/etch/cbinding/test/helloworldHelper.java Wed Jul 21 16:58:23 2010
@@ -0,0 +1,190 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Fri Jul 16 12:01:27 CEST 2010
+// This file is automatically created and should not be edited!
+
+package etch.cbinding.test;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import org.apache.etch.bindings.java.support.DeliveryService;
+import org.apache.etch.bindings.java.support.Pool;
+import org.apache.etch.bindings.java.support.ServerFactory;
+import org.apache.etch.bindings.java.msg.ValueFactory;
+import org.apache.etch.bindings.java.support.DefaultServerFactory;
+import org.apache.etch.util.core.io.Transport;
+import org.apache.etch.bindings.java.support.TransportFactory;
+import org.apache.etch.bindings.java.support.TransportHelper;
+import org.apache.etch.bindings.java.transport.DefaultDeliveryService;
+import org.apache.etch.bindings.java.transport.MailboxManager;
+import org.apache.etch.bindings.java.transport.PlainMailboxManager;
+import org.apache.etch.bindings.java.transport.TransportMessage;
+import org.apache.etch.util.Resources;
+import org.apache.etch.util.URL;
+
+/**
+ * Transport helper for helloworld. All methods are static.
+ */
+abstract public class helloworldHelper extends TransportHelper
+{
+
+	/**
+	 * Constructs a new server session listener per specifications in uri and
+	 * resources. This listener will accept requests from clients for new server
+	 * sessions.
+	 *
+	 * @param uri contains specifications for the server session listener and
+	 * for the server session transport stack.
+	 *
+	 * @param resources additional resources to aid in constructing new server
+	 * sessions.
+	 *
+	 * @param implFactory factory used to construct a new instance implementing
+	 * helloworldServer. The new instance will receive and process messages from
+	 * the client session.
+	 *
+	 * @return a server session listener.
+	 *
+	 * @throws Exception
+	 */
+	public static ServerFactory newListener( final String uri,
+		final Resources resources, final helloworldServerFactory implFactory )
+		throws Exception
+	{
+		final Resources res = initResources( resources );
+		
+		final Transport<ServerFactory> listener = TransportFactory.getListener( uri, res );
+		
+		return new DefaultServerFactory( listener, implFactory )
+		{
+			public void newServer( TransportMessage t, String uri, Resources r )
+				throws Exception
+			{
+				ValueFactory vf = (ValueFactory) r.get( Transport.VALUE_FACTORY );
+				MailboxManager x = new PlainMailboxManager( t, uri, r );
+				DeliveryService d = new DefaultDeliveryService( x, uri, r );
+				RemotehelloworldClient client = new RemotehelloworldClient( d, vf );
+				helloworldServer server = implFactory.newhelloworldServer( client );
+				Pool qp = (Pool) r.get( QUEUED_POOL );
+				Pool fp = (Pool) r.get( FREE_POOL );
+				new StubhelloworldServer( d, server, qp, fp );
+				client._start();
+			}
+
+			public ValueFactory newValueFactory( String uri )
+			{
+				return new ValueFactoryhelloworld( uri );
+			}
+			
+			@Override
+			public String toString()
+			{
+				return "helloworldHelper.ServerFactory/" + listener;
+			}
+		};
+	}
+
+	/**
+	 * Factory used by
+	 * {@link helloworldHelper#newListener(String, Resources, helloworldServerFactory)}
+	 * to construct a new instance implementing {@link helloworldServer}. The new
+	 * instance will receive and process messages from the client session.
+	 */
+	public interface helloworldServerFactory
+	{
+		/**
+		 * Constructs a new instance implementing helloworldServer. The new
+		 * instance will receive and process messages from the client session.
+		 *
+		 * @param client an instance of RemotehelloworldClient which may be used to
+		 * send messages to the client session.
+		 * @return a new instance implementing helloworldServer (typically
+		 * ImplhelloworldServer).
+		 * @throws Exception
+		 */
+		public helloworldServer newhelloworldServer( RemotehelloworldClient client )
+			throws Exception;
+	}
+
+	/**
+	 * Constructs a new client session per specifications in uri and resources.
+	 * 
+	 * @param uri contains specifications for the client session transport
+	 * stack.
+	 * 
+	 * @param resources additional resources to aid in constructing new client
+	 * sessions.
+	 * 
+	 * @param implFactory factory used to construct a new instance implementing
+	 * helloworldClient. The new instance will receive and process messages from
+	 * the server session.
+	 * 
+	 * @return an instance of RemotehelloworldServer initialized by uri and
+	 * resources which may be used to send messages to the server session.
+	 * 
+	 * @throws Exception
+	 */
+	public static RemotehelloworldServer newServer( String uri,
+		Resources resources, helloworldClientFactory implFactory )
+		throws Exception
+	{
+		final Resources res = initResources( resources );
+		
+		final ValueFactoryhelloworld vf = new ValueFactoryhelloworld( uri );
+		res.put( Transport.VALUE_FACTORY, vf );
+		
+		URL u = new URL( uri );
+		
+		TransportMessage m = TransportFactory.getTransport( uri, res );
+		MailboxManager r = new PlainMailboxManager( m, u, resources );
+		DeliveryService d = new DefaultDeliveryService( r, u, resources );
+		RemotehelloworldServer server = new RemotehelloworldServer( d, vf );
+		helloworldClient client = implFactory.newhelloworldClient( server );
+		Pool qp = (Pool) res.get( QUEUED_POOL );
+		Pool fp = (Pool) res.get( FREE_POOL );
+		new StubhelloworldClient( d, client, qp, fp );
+
+		return server;
+	}
+
+	/**
+	 * Factory used by
+	 * {@link helloworldHelper#newServer(String, Resources, helloworldClientFactory)}
+	 * to construct a new instance implementing {@link helloworldClient}. The new
+	 * instance will receive and process messages from the server session.
+	 */
+	public interface helloworldClientFactory
+	{
+		/**
+		 * Constructs a new instance implementing helloworldClient. The new
+		 * instance will receive and process messages from the server session.
+		 * 
+		 * @param server an instance of RemotehelloworldServer which may be used to
+		 * send messages to the server session.
+		 * @return a new instance implementing helloworldClient (typically
+		 * ImplhelloworldClient).
+		 * @throws Exception
+		 */
+		public helloworldClient newhelloworldClient( RemotehelloworldServer server )
+			throws Exception;
+	}
+}