duke@1: /* coffeys@478: * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@158: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@158: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@158: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@158: * or visit www.oracle.com if you need additional information or have any ohair@158: * questions. duke@1: */ duke@1: /* duke@1: * Licensed Materials - Property of IBM duke@1: * RMI-IIOP v1.0 duke@1: * Copyright IBM Corp. 1998 1999 All Rights Reserved duke@1: * duke@1: */ duke@1: duke@1: package org.omg.CORBA_2_3.portable; duke@1: coffeys@478: import java.io.SerializablePermission; coffeys@478: import java.security.AccessController; coffeys@478: import java.security.PrivilegedAction; coffeys@478: duke@1: /** duke@1: * OutputStream provides interface for writing of all of the mapped IDL type duke@1: * to the stream. It extends org.omg.CORBA.portable.OutputStream, and defines duke@1: * new methods defined by CORBA 2.3. duke@1: * duke@1: * @see org.omg.CORBA.portable.OutputStream duke@1: * @author OMG duke@1: * @since JDK1.2 duke@1: */ duke@1: duke@1: public abstract class OutputStream extends org.omg.CORBA.portable.OutputStream { duke@1: coffeys@478: private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowOutputStreamSubclass"; coffeys@478: private static final boolean allowSubclass = AccessController.doPrivileged( coffeys@478: new PrivilegedAction() { coffeys@478: @Override coffeys@478: public Boolean run() { coffeys@478: String prop = System.getProperty(ALLOW_SUBCLASS_PROP); coffeys@478: return prop == null ? false : coffeys@478: (prop.equalsIgnoreCase("false") ? false : true); coffeys@478: } coffeys@478: }); coffeys@478: coffeys@478: private static Void checkPermission() { coffeys@478: SecurityManager sm = System.getSecurityManager(); coffeys@478: if (sm != null) { coffeys@478: if (!allowSubclass) coffeys@478: sm.checkPermission(new coffeys@478: SerializablePermission("enableSubclassImplementation")); coffeys@478: } coffeys@478: return null; coffeys@478: } coffeys@478: private OutputStream(Void ignore) { } coffeys@478: coffeys@478: /** coffeys@478: * Create a new instance of this class. coffeys@478: * coffeys@478: * throw SecurityException if SecurityManager is installed and coffeys@478: * enableSubclassImplementation SerializablePermission coffeys@478: * is not granted or jdk.corba.allowOutputStreamSubclass system coffeys@478: * property is either not set or is set to 'false' coffeys@478: */ coffeys@478: public OutputStream() { coffeys@478: this(checkPermission()); coffeys@478: } coffeys@478: duke@1: /** duke@1: * Marshals a value type to the output stream. duke@1: * @param value is the acutal value to write duke@1: */ duke@1: public void write_value(java.io.Serializable value) { duke@1: throw new org.omg.CORBA.NO_IMPLEMENT(); duke@1: } duke@1: duke@1: /** duke@1: * Marshals a value type to the output stream. duke@1: * @param value is the acutal value to write duke@1: * @param clz is the declared type of the value to be marshaled duke@1: */ duke@1: public void write_value(java.io.Serializable value, java.lang.Class clz) { duke@1: throw new org.omg.CORBA.NO_IMPLEMENT(); duke@1: } duke@1: duke@1: /** duke@1: * Marshals a value type to the output stream. duke@1: * @param value is the acutal value to write duke@1: * @param repository_id identifies the type of the value type to duke@1: * be marshaled duke@1: */ duke@1: public void write_value(java.io.Serializable value, String repository_id) { duke@1: throw new org.omg.CORBA.NO_IMPLEMENT(); duke@1: } duke@1: duke@1: /** duke@1: * Marshals a value type to the output stream. duke@1: * @param value is the acutal value to write duke@1: * @param factory is the instance of the helper to be used for marshaling duke@1: * the boxed value duke@1: */ duke@1: public void write_value(java.io.Serializable value, org.omg.CORBA.portable.BoxedValueHelper factory) { duke@1: throw new org.omg.CORBA.NO_IMPLEMENT(); duke@1: } duke@1: duke@1: /** duke@1: * Marshals a value object or a stub object. duke@1: * @param obj the actual value object to marshal or the stub to be marshalled duke@1: */ duke@1: public void write_abstract_interface(java.lang.Object obj) { duke@1: throw new org.omg.CORBA.NO_IMPLEMENT(); duke@1: } duke@1: duke@1: }