src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java

changeset 0
7ef37b2cdcad
child 748
6845b95cba6b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java	Wed Apr 27 01:21:28 2016 +0800
     1.3 @@ -0,0 +1,152 @@
     1.4 +/*
     1.5 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.  Oracle designates this
    1.11 + * particular file as subject to the "Classpath" exception as provided
    1.12 + * by Oracle in the LICENSE file that accompanied this code.
    1.13 + *
    1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 + * version 2 for more details (a copy is included in the LICENSE file that
    1.18 + * accompanied this code).
    1.19 + *
    1.20 + * You should have received a copy of the GNU General Public License version
    1.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 + *
    1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 + * or visit www.oracle.com if you need additional information or have any
    1.26 + * questions.
    1.27 + */
    1.28 +/*
    1.29 + * Licensed Materials - Property of IBM
    1.30 + * RMI-IIOP v1.0
    1.31 + * Copyright IBM Corp. 1998 1999  All Rights Reserved
    1.32 + *
    1.33 + */
    1.34 +
    1.35 +package org.omg.CORBA_2_3.portable;
    1.36 +
    1.37 +import java.io.SerializablePermission;
    1.38 +import java.security.AccessController;
    1.39 +import java.security.PrivilegedAction;
    1.40 +
    1.41 +/**
    1.42 + * InputStream provides for the reading of all of the mapped IDL types
    1.43 + * from the stream. It extends org.omg.CORBA.portable.InputStream.  This
    1.44 + * class defines new methods that were added for CORBA 2.3.
    1.45 + *
    1.46 + * @see org.omg.CORBA.portable.InputStream
    1.47 + * @author  OMG
    1.48 + * @since   JDK1.2
    1.49 + */
    1.50 +
    1.51 +public abstract class InputStream extends org.omg.CORBA.portable.InputStream {
    1.52 +
    1.53 +
    1.54 +    private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowInputStreamSubclass";
    1.55 +
    1.56 +    private static final boolean allowSubclass = AccessController.doPrivileged(
    1.57 +        new PrivilegedAction<Boolean>() {
    1.58 +            @Override
    1.59 +            public Boolean run() {
    1.60 +            String prop = System.getProperty(ALLOW_SUBCLASS_PROP);
    1.61 +                return prop == null ? false :
    1.62 +                           (prop.equalsIgnoreCase("false") ? false : true);
    1.63 +            }
    1.64 +        });
    1.65 +
    1.66 +    private static Void checkPermission() {
    1.67 +        SecurityManager sm = System.getSecurityManager();
    1.68 +        if (sm != null) {
    1.69 +            if (!allowSubclass)
    1.70 +                sm.checkPermission(new
    1.71 +                    SerializablePermission("enableSubclassImplementation"));
    1.72 +        }
    1.73 +        return null;
    1.74 +    }
    1.75 +
    1.76 +    private InputStream(Void ignore) { }
    1.77 +
    1.78 +    /**
    1.79 +     * Create a new instance of this class.
    1.80 +     *
    1.81 +     * throw SecurityException if SecurityManager is installed and
    1.82 +     * enableSubclassImplementation SerializablePermission
    1.83 +     * is not granted or jdk.corba.allowOutputStreamSubclass system
    1.84 +     * property is either not set or is set to 'false'
    1.85 +     */
    1.86 +    public InputStream() {
    1.87 +        this(checkPermission());
    1.88 +    }
    1.89 +
    1.90 +    /**
    1.91 +     * Unmarshalls a value type from the input stream.
    1.92 +     * @return the value type unmarshalled from the input stream
    1.93 +     */
    1.94 +    public java.io.Serializable read_value() {
    1.95 +        throw new org.omg.CORBA.NO_IMPLEMENT();
    1.96 +    }
    1.97 +
    1.98 +    /**
    1.99 +     * Unmarshalls a value type from the input stream.
   1.100 +     * @param clz is the declared type of the value to be unmarshalled
   1.101 +     * @return the value unmarshalled from the input stream
   1.102 +     */
   1.103 +    public java.io.Serializable read_value(java.lang.Class clz) {
   1.104 +        throw new org.omg.CORBA.NO_IMPLEMENT();
   1.105 +    }
   1.106 +
   1.107 +    /**
   1.108 +     * Unmarshalls a value type from the input stream.
   1.109 +     * @param factory is the instance fo the helper to be used for
   1.110 +     * unmarshalling the value type
   1.111 +     * @return the value unmarshalled from the input stream
   1.112 +     */
   1.113 +    public java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory) {
   1.114 +        throw new org.omg.CORBA.NO_IMPLEMENT();
   1.115 +    }
   1.116 +
   1.117 +    /**
   1.118 +     * Unmarshalls a value type from the input stream.
   1.119 +     * @param rep_id identifies the type of the value to be unmarshalled
   1.120 +     * @return value type unmarshalled from the input stream
   1.121 +     */
   1.122 +    public java.io.Serializable read_value(java.lang.String rep_id) {
   1.123 +        throw new org.omg.CORBA.NO_IMPLEMENT();
   1.124 +    }
   1.125 +
   1.126 +    /**
   1.127 +     * Unmarshalls a value type from the input stream.
   1.128 +     * @param value is an uninitialized value which is added to the orb's
   1.129 +     * indirection table before calling Streamable._read() or
   1.130 +     * CustomMarshal.unmarshal() to unmarshal the value.
   1.131 +     * @return value type unmarshalled from the input stream
   1.132 +     */
   1.133 +    public java.io.Serializable read_value(java.io.Serializable value) {
   1.134 +        throw new org.omg.CORBA.NO_IMPLEMENT();
   1.135 +    }
   1.136 +
   1.137 +    /**
   1.138 +     * Unmarshal the value object or a suitable stub object.
   1.139 +     * @return ORB runtime returns the value object or a suitable stub object.
   1.140 +     */
   1.141 +    public java.lang.Object read_abstract_interface() {
   1.142 +        throw new org.omg.CORBA.NO_IMPLEMENT();
   1.143 +    }
   1.144 +
   1.145 +    /**
   1.146 +     * Unmarshal the class object or the stub class corresponding to the passed type.
   1.147 +     * @param clz is the Class object for the stub class which corresponds to
   1.148 +     * the type that is statically expected.
   1.149 +     * @return ORB runtime returns the value object or a suitable stub object.
   1.150 +     */
   1.151 +    public java.lang.Object read_abstract_interface(java.lang.Class clz) {
   1.152 +        throw new org.omg.CORBA.NO_IMPLEMENT();
   1.153 +    }
   1.154 +
   1.155 +}

mercurial