1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/classes/org/omg/CORBA_2_3/portable/OutputStream.java Wed Apr 27 01:21:28 2016 +0800 1.3 @@ -0,0 +1,129 @@ 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 + * OutputStream provides interface for writing of all of the mapped IDL type 1.43 + * to the stream. It extends org.omg.CORBA.portable.OutputStream, and defines 1.44 + * new methods defined by CORBA 2.3. 1.45 + * 1.46 + * @see org.omg.CORBA.portable.OutputStream 1.47 + * @author OMG 1.48 + * @since JDK1.2 1.49 + */ 1.50 + 1.51 +public abstract class OutputStream extends org.omg.CORBA.portable.OutputStream { 1.52 + 1.53 + private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowOutputStreamSubclass"; 1.54 + private static final boolean allowSubclass = AccessController.doPrivileged( 1.55 + new PrivilegedAction<Boolean>() { 1.56 + @Override 1.57 + public Boolean run() { 1.58 + String prop = System.getProperty(ALLOW_SUBCLASS_PROP); 1.59 + return prop == null ? false : 1.60 + (prop.equalsIgnoreCase("false") ? false : true); 1.61 + } 1.62 + }); 1.63 + 1.64 + private static Void checkPermission() { 1.65 + SecurityManager sm = System.getSecurityManager(); 1.66 + if (sm != null) { 1.67 + if (!allowSubclass) 1.68 + sm.checkPermission(new 1.69 + SerializablePermission("enableSubclassImplementation")); 1.70 + } 1.71 + return null; 1.72 + } 1.73 + private OutputStream(Void ignore) { } 1.74 + 1.75 + /** 1.76 + * Create a new instance of this class. 1.77 + * 1.78 + * throw SecurityException if SecurityManager is installed and 1.79 + * enableSubclassImplementation SerializablePermission 1.80 + * is not granted or jdk.corba.allowOutputStreamSubclass system 1.81 + * property is either not set or is set to 'false' 1.82 + */ 1.83 + public OutputStream() { 1.84 + this(checkPermission()); 1.85 + } 1.86 + 1.87 + /** 1.88 + * Marshals a value type to the output stream. 1.89 + * @param value is the acutal value to write 1.90 + */ 1.91 + public void write_value(java.io.Serializable value) { 1.92 + throw new org.omg.CORBA.NO_IMPLEMENT(); 1.93 + } 1.94 + 1.95 + /** 1.96 + * Marshals a value type to the output stream. 1.97 + * @param value is the acutal value to write 1.98 + * @param clz is the declared type of the value to be marshaled 1.99 + */ 1.100 + public void write_value(java.io.Serializable value, java.lang.Class clz) { 1.101 + throw new org.omg.CORBA.NO_IMPLEMENT(); 1.102 + } 1.103 + 1.104 + /** 1.105 + * Marshals a value type to the output stream. 1.106 + * @param value is the acutal value to write 1.107 + * @param repository_id identifies the type of the value type to 1.108 + * be marshaled 1.109 + */ 1.110 + public void write_value(java.io.Serializable value, String repository_id) { 1.111 + throw new org.omg.CORBA.NO_IMPLEMENT(); 1.112 + } 1.113 + 1.114 + /** 1.115 + * Marshals a value type to the output stream. 1.116 + * @param value is the acutal value to write 1.117 + * @param factory is the instance of the helper to be used for marshaling 1.118 + * the boxed value 1.119 + */ 1.120 + public void write_value(java.io.Serializable value, org.omg.CORBA.portable.BoxedValueHelper factory) { 1.121 + throw new org.omg.CORBA.NO_IMPLEMENT(); 1.122 + } 1.123 + 1.124 + /** 1.125 + * Marshals a value object or a stub object. 1.126 + * @param obj the actual value object to marshal or the stub to be marshalled 1.127 + */ 1.128 + public void write_abstract_interface(java.lang.Object obj) { 1.129 + throw new org.omg.CORBA.NO_IMPLEMENT(); 1.130 + } 1.131 + 1.132 +}