01: /*
02: * JacORB - a free Java ORB
03: *
04: * Copyright (C) 1997-2004 Gerald Brose.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Library General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Library General Public License for more details.
15: *
16: * You should have received a copy of the GNU Library General Public
17: * License along with this library; if not, write to the Free
18: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19: */
20:
21: package org.jacorb.orb;
22:
23: /**
24: * @author Gerald Brose, FU Berlin
25: * @version $Id: NamedValue.java,v 1.8 2006/07/10 13:33:04 alphonse.bendt Exp $
26: */
27:
28: public class NamedValue extends org.omg.CORBA.NamedValue {
29: private org.omg.CORBA.Any value;
30: private String name;
31: private final int arg_modes;
32:
33: public NamedValue(int modes) {
34: super ();
35: arg_modes = modes;
36: }
37:
38: public NamedValue(String name, org.omg.CORBA.Any value, int modes) {
39: this (modes);
40:
41: this .name = name;
42: this .value = value;
43: }
44:
45: public NamedValue(String name, int modes) {
46: this (modes);
47: this .name = name;
48: }
49:
50: public java.lang.String name() {
51: return name;
52: }
53:
54: public org.omg.CORBA.Any value() {
55: return value;
56: }
57:
58: public int flags() {
59: return arg_modes;
60: }
61:
62: public void set_value(org.omg.CORBA.Any value) {
63: this .value = value;
64: }
65:
66: /** JacORB-specific */
67:
68: public void send(org.omg.CORBA.portable.OutputStream out) {
69: value().write_value(out);
70: }
71:
72: public void receive(org.omg.CORBA.portable.InputStream inputStream) {
73: value().read_value(inputStream, value().type());
74: }
75: }
|