| // 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(); |
| } |
| } |