diff options
Diffstat (limited to 'src/share/classes/com/sun/corba/se/spi/presentation/rmi')
7 files changed, 0 insertions, 823 deletions
diff --git a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicMethodMarshaller.java b/src/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicMethodMarshaller.java deleted file mode 100644 index 9055ab7..0000000 --- a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicMethodMarshaller.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import org.omg.CORBA_2_3.portable.InputStream ; -import org.omg.CORBA_2_3.portable.OutputStream ; -import org.omg.CORBA.portable.ApplicationException ; - -import java.lang.reflect.Method ; - -import java.rmi.RemoteException ; - -import com.sun.corba.se.spi.orb.ORB ; - -/** Used to read and write arguments and results for a particular method. -* -*/ -public interface DynamicMethodMarshaller -{ - /** Returns the method used to create this DynamicMethodMarshaller. - */ - Method getMethod() ; - - /** Copy the arguments as needed for this particular method. - * Can be optimized so that as little copying as possible is - * performed. - */ - Object[] copyArguments( Object[] args, ORB orb ) throws RemoteException ; - - /** Read the arguments for this method from the InputStream. - * Returns null if there are no arguments. - */ - Object[] readArguments( InputStream is ) ; - - /** Write arguments for this method to the OutputStream. - * Does nothing if there are no arguments. - */ - void writeArguments( OutputStream os, Object[] args ) ; - - /** Copy the result as needed for this particular method. - * Can be optimized so that as little copying as possible is - * performed. - */ - Object copyResult( Object result, ORB orb ) throws RemoteException ; - - /** Read the result from the InputStream. Returns null - * if the result type is null. - */ - Object readResult( InputStream is ) ; - - /** Write the result to the OutputStream. Does nothing if - * the result type is null. - */ - void writeResult( OutputStream os, Object result ) ; - - /** Returns true iff thr's class is a declared exception (or a subclass of - * a declared exception) for this DynamicMethodMarshaller's method. - */ - boolean isDeclaredException( Throwable thr ) ; - - /** Write the repository ID of the exception and the value of the - * exception to the OutputStream. ex should be a declared exception - * for this DynamicMethodMarshaller's method. - */ - void writeException( OutputStream os, Exception ex ) ; - - /** Reads an exception ID and the corresponding exception from - * the input stream. This should be an exception declared in - * this method. - */ - Exception readException( ApplicationException ae ) ; -} diff --git a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicStub.java b/src/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicStub.java deleted file mode 100644 index 54c1bb8..0000000 --- a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/DynamicStub.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import java.rmi.RemoteException ; - -import org.omg.CORBA.portable.Delegate ; -import org.omg.CORBA.portable.OutputStream ; - -import org.omg.CORBA.ORB ; - -/** Interface used to support dynamically generated stubs. - * This supplies some methods that are found in - * org.omg.CORBA.portable.ObjectImpl that are not available - * in org.omg.CORBA.Object. - */ -public interface DynamicStub extends org.omg.CORBA.Object -{ - /** Similar to ObjectImpl._set_delegate - */ - void setDelegate( Delegate delegate ) ; - - /** Similar to ObjectImpl._get_delegate - */ - Delegate getDelegate() ; - - /** Similar to ObjectImpl._orb() - */ - ORB getORB() ; - - /** Similar to ObjectImpl._ids - */ - String[] getTypeIds() ; - - /** Connect this dynamic stub to an ORB. - * Just as in standard RMI-IIOP, this is required after - * a dynamic stub is deserialized from an ObjectInputStream. - * It is not needed when unmarshalling from a - * org.omg.CORBA.portable.InputStream. - */ - void connect( ORB orb ) throws RemoteException ; - - boolean isLocal() ; - - OutputStream request( String operation, boolean responseExpected ) ; -} diff --git a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java b/src/share/classes/com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java deleted file mode 100644 index 6ac876d..0000000 --- a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import java.lang.reflect.Method ; - -/** Translates between methods on an interface and RMI-IIOP encodings - * of those methods as names. - */ -public interface IDLNameTranslator -{ - /** Get the interfaces that this IDLNameTranslator describes. - */ - Class[] getInterfaces() ; - - /** Get all methods for this remote interface. - * The methods are returned in a canonical order, that is, - * they are always in the same order for a particular interface. - */ - Method[] getMethods() ; - - /** Get the method from this IDLNameTranslator's interfaces that - * corresponds to the mangled name idlName. Returns null - * if there is no matching method. - */ - Method getMethod( String idlName ) ; - - /** Get the mangled name that corresponds to the given method - * on this IDLNameTranslator's interface. Returns null - * if there is no matching name. - */ - String getIDLName( Method method ) ; -} diff --git a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java b/src/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java deleted file mode 100644 index 81ff426..0000000 --- a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi; - -import com.sun.corba.se.spi.orb.ORB; - -import com.sun.corba.se.spi.presentation.rmi.PresentationManager; - -import com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryProxyImpl; -import com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl; -import com.sun.corba.se.impl.presentation.rmi.StubFactoryStaticImpl; - -public abstract class PresentationDefaults -{ - private static StubFactoryFactoryStaticImpl staticImpl = null ; - - private PresentationDefaults() {} - - public synchronized static PresentationManager.StubFactoryFactory - getStaticStubFactoryFactory() - { - if (staticImpl == null) - staticImpl = new StubFactoryFactoryStaticImpl( ); - - return staticImpl ; - } - - public static PresentationManager.StubFactoryFactory - getProxyStubFactoryFactory() - { - return new StubFactoryFactoryProxyImpl(); - } - - public static PresentationManager.StubFactory makeStaticStubFactory( - Class stubClass ) - { - return new StubFactoryStaticImpl( stubClass ) ; - } -} diff --git a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationManager.java b/src/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationManager.java deleted file mode 100644 index adc670b..0000000 --- a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/PresentationManager.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import java.util.Map ; - -import java.lang.reflect.Method ; -import java.lang.reflect.InvocationHandler ; - -import javax.rmi.CORBA.Tie ; - -import com.sun.corba.se.spi.orb.ORB ; -import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; - - -/** Provides access to RMI-IIOP stubs and ties. - * Any style of stub and tie generation may be used. - * This includes compiler generated stubs and runtime generated stubs - * as well as compiled and reflective ties. There is normally - * only one instance of this interface per VM. The instance - * is obtained from the static method - * com.sun.corba.se.spi.orb.ORB.getPresentationManager. - * <p> - * Note that - * the getClassData and getDynamicMethodMarshaller methods - * maintain caches to avoid redundant computation. - */ -public interface PresentationManager -{ - /** Creates StubFactory and Tie instances. - */ - public interface StubFactoryFactory - { - /** Return the standard name of a stub (according to the RMI-IIOP specification - * and rmic). This is needed so that the name of a stub is known for - * standalone clients of the app server. - */ - String getStubName( String className ) ; - - /** Create a stub factory for stubs for the interface whose type is given by - * className. className may identify either an IDL interface or an RMI-IIOP - * interface. - * @param className The name of the remote interface as a Java class name. - * @param isIDLStub True if className identifies an IDL stub, else false. - * @param remoteCodeBase The CodeBase to use for loading Stub classes, if - * necessary (may be null or unused). - * @param expectedClass The expected stub type (may be null or unused). - * @param classLoader The classLoader to use (may be null). - */ - PresentationManager.StubFactory createStubFactory( String className, - boolean isIDLStub, String remoteCodeBase, Class expectedClass, - ClassLoader classLoader); - - /** Return a Tie for the given class. - */ - Tie getTie( Class cls ) ; - - /** Return whether or not this StubFactoryFactory creates StubFactory - * instances that create dynamic stubs and ties. At the top level, - * true indicates that rmic -iiop is not needed for generating stubs - * or ties. - */ - boolean createsDynamicStubs() ; - } - - /** Creates the actual stub needed for RMI-IIOP remote - * references. - */ - public interface StubFactory - { - /** Create a new dynamic stub. It has the type that was - * used to create this factory. - */ - org.omg.CORBA.Object makeStub() ; - - /** Return the repository ID information for all Stubs - * created by this stub factory. - */ - String[] getTypeIds() ; - } - - public interface ClassData - { - /** Get the class used to create this ClassData instance - */ - Class getMyClass() ; - - /** Get the IDLNameTranslator for the class used to create - * this ClassData instance. - */ - IDLNameTranslator getIDLNameTranslator() ; - - /** Return the array of repository IDs for all of the remote - * interfaces implemented by this class. - */ - String[] getTypeIds() ; - - /** Get the InvocationHandlerFactory that is used to create - * an InvocationHandler for dynamic stubs of the type of the - * ClassData. - */ - InvocationHandlerFactory getInvocationHandlerFactory() ; - - /** Get the dictionary for this ClassData instance. - * This is used to hold class-specific information for a Class - * in the class data. This avoids the need to create other - * caches for accessing the information. - */ - Map getDictionary() ; - } - - /** Get the ClassData for a particular class. - * This class may be an implementation class, in which - * case the IDLNameTranslator handles all Remote interfaces implemented by - * the class. If the class implements more than one remote interface, and not - * all of the remote interfaces are related by inheritance, then the type - * IDs have the implementation class as element 0. - */ - ClassData getClassData( Class cls ) ; - - /** Given a particular method, return a DynamicMethodMarshaller - * for that method. This is used for dynamic stubs and ties. - */ - DynamicMethodMarshaller getDynamicMethodMarshaller( Method method ) ; - - /** Return the registered StubFactoryFactory. - */ - StubFactoryFactory getStubFactoryFactory( boolean isDynamic ) ; - - /** Register the StubFactoryFactory. Note that - * a static StubFactoryFactory is always required for IDL. The - * dynamic stubFactoryFactory is optional. - */ - void setStubFactoryFactory( boolean isDynamic, StubFactoryFactory sff ) ; - - /** Equivalent to getStubFactoryFactory( true ).getTie( null ). - * Provided for compatibility with earlier versions of PresentationManager - * as used in the app server. The class argument is ignored in - * the dynamic case, so this is safe. - */ - Tie getTie() ; - - /** Returns the value of the com.sun.CORBA.ORBUseDynamicStub - * property. - */ - boolean useDynamicStubs() ; -} diff --git a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/StubAdapter.java b/src/share/classes/com/sun/corba/se/spi/presentation/rmi/StubAdapter.java deleted file mode 100644 index 879803f..0000000 --- a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/StubAdapter.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import javax.rmi.CORBA.Tie ; - -import org.omg.CORBA.portable.Delegate ; -import org.omg.CORBA.portable.ObjectImpl ; -import org.omg.CORBA.portable.OutputStream ; - -import org.omg.PortableServer.POA ; -import org.omg.PortableServer.POAManager ; -import org.omg.PortableServer.Servant ; - -import org.omg.PortableServer.POAPackage.WrongPolicy ; -import org.omg.PortableServer.POAPackage.ServantNotActive ; -import org.omg.PortableServer.POAManagerPackage.AdapterInactive ; - -import org.omg.CORBA.ORB ; - -import com.sun.corba.se.spi.logging.CORBALogDomains ; -import com.sun.corba.se.impl.logging.ORBUtilSystemException ; - -// XXX Getting rid of this requires introducing an ObjectAdapterManager abstraction -// as an interface into the OA framework. -import com.sun.corba.se.impl.oa.poa.POAManagerImpl ; - -/** Provide access to stub delegate and type id information - * independent of the stub type. This class exists because - * ObjectImpl does not have an interface for the 3 delegate and - * type id methods, so a DynamicStub has a different type. - * We cannot simply change ObjectImpl as it is a standard API. - * We also cannot change the code generation of Stubs, as that - * is also standard. Hence I am left with this ugly class. - */ -public abstract class StubAdapter -{ - private StubAdapter() {} - - private static ORBUtilSystemException wrapper = - ORBUtilSystemException.get( CORBALogDomains.RPC_PRESENTATION ) ; - - public static boolean isStubClass( Class cls ) - { - return (ObjectImpl.class.isAssignableFrom( cls )) || - (DynamicStub.class.isAssignableFrom( cls )) ; - } - - public static boolean isStub( Object stub ) - { - return (stub instanceof DynamicStub) || - (stub instanceof ObjectImpl) ; - } - - public static void setDelegate( Object stub, Delegate delegate ) - { - if (stub instanceof DynamicStub) - ((DynamicStub)stub).setDelegate( delegate ) ; - else if (stub instanceof ObjectImpl) - ((ObjectImpl)stub)._set_delegate( delegate ) ; - else - throw wrapper.setDelegateRequiresStub() ; - } - - /** Use implicit activation to get an object reference for the servant. - */ - public static org.omg.CORBA.Object activateServant( Servant servant ) - { - POA poa = servant._default_POA() ; - org.omg.CORBA.Object ref = null ; - - try { - ref = poa.servant_to_reference( servant ) ; - } catch (ServantNotActive sna) { - throw wrapper.getDelegateServantNotActive( sna ) ; - } catch (WrongPolicy wp) { - throw wrapper.getDelegateWrongPolicy( wp ) ; - } - - // Make sure that the POAManager is activated if no other - // POAManager state management has taken place. - POAManager mgr = poa.the_POAManager() ; - if (mgr instanceof POAManagerImpl) { - POAManagerImpl mgrImpl = (POAManagerImpl)mgr ; - mgrImpl.implicitActivation() ; - } - - return ref ; - } - - /** Given any Tie, return the corresponding object refernce, activating - * the Servant if necessary. - */ - public static org.omg.CORBA.Object activateTie( Tie tie ) - { - /** Any implementation of Tie should be either a Servant or an ObjectImpl, - * depending on which style of code generation is used. rmic -iiop by - * default results in an ObjectImpl-based Tie, while rmic -iiop -poa - * results in a Servant-based Tie. Dynamic RMI-IIOP also uses Servant-based - * Ties (see impl.presentation.rmi.ReflectiveTie). - */ - if (tie instanceof ObjectImpl) { - return tie.thisObject() ; - } else if (tie instanceof Servant) { - Servant servant = (Servant)tie ; - return activateServant( servant ) ; - } else { - throw wrapper.badActivateTieCall() ; - } - } - - - /** This also gets the delegate from a Servant by - * using Servant._this_object() - */ - public static Delegate getDelegate( Object stub ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).getDelegate() ; - else if (stub instanceof ObjectImpl) - return ((ObjectImpl)stub)._get_delegate() ; - else if (stub instanceof Tie) { - Tie tie = (Tie)stub ; - org.omg.CORBA.Object ref = activateTie( tie ) ; - return getDelegate( ref ) ; - } else - throw wrapper.getDelegateRequiresStub() ; - } - - public static ORB getORB( Object stub ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).getORB() ; - else if (stub instanceof ObjectImpl) - return (ORB)((ObjectImpl)stub)._orb() ; - else - throw wrapper.getOrbRequiresStub() ; - } - - public static String[] getTypeIds( Object stub ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).getTypeIds() ; - else if (stub instanceof ObjectImpl) - return ((ObjectImpl)stub)._ids() ; - else - throw wrapper.getTypeIdsRequiresStub() ; - } - - public static void connect( Object stub, - ORB orb ) throws java.rmi.RemoteException - { - if (stub instanceof DynamicStub) - ((DynamicStub)stub).connect( - (com.sun.corba.se.spi.orb.ORB)orb ) ; - else if (stub instanceof javax.rmi.CORBA.Stub) - ((javax.rmi.CORBA.Stub)stub).connect( orb ) ; - else if (stub instanceof ObjectImpl) - orb.connect( (org.omg.CORBA.Object)stub ) ; - else - throw wrapper.connectRequiresStub() ; - } - - public static boolean isLocal( Object stub ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).isLocal() ; - else if (stub instanceof ObjectImpl) - return ((ObjectImpl)stub)._is_local() ; - else - throw wrapper.isLocalRequiresStub() ; - } - - public static OutputStream request( Object stub, - String operation, boolean responseExpected ) - { - if (stub instanceof DynamicStub) - return ((DynamicStub)stub).request( operation, - responseExpected ) ; - else if (stub instanceof ObjectImpl) - return ((ObjectImpl)stub)._request( operation, - responseExpected ) ; - else - throw wrapper.requestRequiresStub() ; - } -} diff --git a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/StubWrapper.java b/src/share/classes/com/sun/corba/se/spi/presentation/rmi/StubWrapper.java deleted file mode 100644 index 1a683e7..0000000 --- a/src/share/classes/com/sun/corba/se/spi/presentation/rmi/StubWrapper.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.corba.se.spi.presentation.rmi ; - -import java.rmi.RemoteException ; - -import org.omg.CORBA.portable.Delegate ; -import org.omg.CORBA.ORB ; -import org.omg.CORBA.Request ; -import org.omg.CORBA.Context ; -import org.omg.CORBA.NamedValue ; -import org.omg.CORBA.NVList ; -import org.omg.CORBA.ContextList ; -import org.omg.CORBA.ExceptionList ; -import org.omg.CORBA.Policy ; -import org.omg.CORBA.DomainManager ; -import org.omg.CORBA.SetOverrideType ; - -import org.omg.CORBA.portable.OutputStream ; - -/** Wrapper that can take any stub (object x such that StubAdapter.isStub(x)) - * and treat it as a DynamicStub. - */ -public class StubWrapper implements DynamicStub -{ - private org.omg.CORBA.Object object ; - - public StubWrapper( org.omg.CORBA.Object object ) - { - if (!(StubAdapter.isStub(object))) - throw new IllegalStateException() ; - - this.object = object ; - } - - public void setDelegate( Delegate delegate ) - { - StubAdapter.setDelegate( object, delegate ) ; - } - - public Delegate getDelegate() - { - return StubAdapter.getDelegate( object ) ; - } - - public ORB getORB() - { - return StubAdapter.getORB( object ) ; - } - - public String[] getTypeIds() - { - return StubAdapter.getTypeIds( object ) ; - } - - public void connect( ORB orb ) throws RemoteException - { - StubAdapter.connect( object, (com.sun.corba.se.spi.orb.ORB)orb ) ; - } - - public boolean isLocal() - { - return StubAdapter.isLocal( object ) ; - } - - public OutputStream request( String operation, boolean responseExpected ) - { - return StubAdapter.request( object, operation, responseExpected ) ; - } - - public boolean _is_a(String repositoryIdentifier) - { - return object._is_a( repositoryIdentifier ) ; - } - - public boolean _is_equivalent(org.omg.CORBA.Object other) - { - return object._is_equivalent( other ) ; - } - - public boolean _non_existent() - { - return object._non_existent() ; - } - - public int _hash(int maximum) - { - return object._hash( maximum ) ; - } - - public org.omg.CORBA.Object _duplicate() - { - return object._duplicate() ; - } - - public void _release() - { - object._release() ; - } - - public org.omg.CORBA.Object _get_interface_def() - { - return object._get_interface_def() ; - } - - public Request _request(String operation) - { - return object._request( operation ) ; - } - - public Request _create_request( Context ctx, String operation, NVList arg_list, - NamedValue result) - { - return object._create_request( ctx, operation, arg_list, result ) ; - } - - public Request _create_request( Context ctx, String operation, NVList arg_list, - NamedValue result, ExceptionList exclist, ContextList ctxlist) - { - return object._create_request( ctx, operation, arg_list, result, - exclist, ctxlist ) ; - } - - public Policy _get_policy(int policy_type) - { - return object._get_policy( policy_type ) ; - } - - public DomainManager[] _get_domain_managers() - { - return object._get_domain_managers() ; - } - - public org.omg.CORBA.Object _set_policy_override( Policy[] policies, - SetOverrideType set_add) - { - return object._set_policy_override( policies, set_add ) ; - } -} |