001: /*
002: * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package org.omg.CORBA;
027:
028: /**
029: * The Holder for <tt>ServiceInformation</tt>. For more information on
030: * Holder files, see <a href="doc-files/generatedfiles.html#holder">
031: * "Generated Files: Holder Files"</a>.<P>
032: * A Holder class for a <code>ServiceInformation</code> object
033: * that is used to store "out" and "inout" parameters in IDL methods.
034: * If an IDL method signature has an IDL <code>xxx</code> as an "out"
035: * or "inout" parameter, the programmer must pass an instance of
036: * <code>ServiceInformationHolder</code> as the corresponding
037: * parameter in the method invocation; for "inout" parameters, the programmer
038: * must also fill the "in" value to be sent to the server.
039: * Before the method invocation returns, the ORB will fill in the
040: * value corresponding to the "out" value returned from the server.
041: * <P>
042: * If <code>myServiceInformationHolder</code> is an instance of <code>ServiceInformationHolder</code>,
043: * the value stored in its <code>value</code> field can be accessed with
044: * <code>myServiceInformationHolder.value</code>.
045: */
046: public final class ServiceInformationHolder implements
047: org.omg.CORBA.portable.Streamable {
048:
049: /**
050: * The <code>ServiceInformation</code> value held by this
051: * <code>ServiceInformationHolder</code> object in its <code>value</code> field.
052: */
053: public ServiceInformation value;
054:
055: /**
056: * Constructs a new <code>ServiceInformationHolder</code> object with its
057: * <code>value</code> field initialized to null.
058: */
059: public ServiceInformationHolder() {
060: this (null);
061: }
062:
063: /**
064: * Constructs a new <code>ServiceInformationHolder</code> object with its
065: * <code>value</code> field initialized to the given
066: * <code>ServiceInformation</code> object.
067: *
068: * @param arg the <code>ServiceInformation</code> object with which to initialize
069: * the <code>value</code> field of the newly-created
070: * <code>ServiceInformationHolder</code> object
071: */
072: public ServiceInformationHolder(org.omg.CORBA.ServiceInformation arg) {
073: value = arg;
074: }
075:
076: /**
077: * Marshals the value in this <code>ServiceInformationHolder</code> object's
078: * <code>value</code> field to the output stream <code>out</code>.
079: *
080: * @param out the <code>OutputStream</code> object that will contain
081: * the CDR formatted data
082: */
083: public void _write(org.omg.CORBA.portable.OutputStream out) {
084: org.omg.CORBA.ServiceInformationHelper.write(out, value);
085: }
086:
087: /**
088: * Reads unmarshalled data from the input stream <code>in</code> and assigns it to
089: * the <code>value</code> field in this <code>ServiceInformationHolder</code> object.
090: *
091: * @param in the <code>InputStream</code> object containing CDR
092: * formatted data from the wire
093: */
094: public void _read(org.omg.CORBA.portable.InputStream in) {
095: value = org.omg.CORBA.ServiceInformationHelper.read(in);
096: }
097:
098: /**
099: * Retrieves the <code>TypeCode</code> object that corresponds
100: * to the value held in this <code>ServiceInformationHolder</code> object's
101: * <code>value</code> field.
102: *
103: * @return the type code for the value held in this <code>ServiceInformationHolder</code>
104: * object
105: */
106: public org.omg.CORBA.TypeCode _type() {
107: return org.omg.CORBA.ServiceInformationHelper.type();
108: }
109: }
|