1 /* |
1 /* |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
723 // clz is a stub class iff StubAdapter.isStubClass( clz ). |
723 // clz is a stub class iff StubAdapter.isStubClass( clz ). |
724 // In addition, clz is a IDL stub class iff |
724 // In addition, clz is a IDL stub class iff |
725 // IDLEntity.class.isAssignableFrom( clz ). |
725 // IDLEntity.class.isAssignableFrom( clz ). |
726 // 3. If clz is an interface, use it to create the appropriate |
726 // 3. If clz is an interface, use it to create the appropriate |
727 // stub factory. |
727 // stub factory. |
|
728 |
728 public org.omg.CORBA.Object read_Object(Class clz) |
729 public org.omg.CORBA.Object read_Object(Class clz) |
729 { |
730 { |
730 // In any case, we must first read the IOR. |
731 // In any case, we must first read the IOR. |
731 IOR ior = IORFactories.makeIOR(parent) ; |
732 IOR ior = IORFactories.makeIOR(parent) ; |
732 if (ior.isNil()) |
733 if (ior.isNil()) { |
733 return null ; |
734 return null ; |
|
735 } |
734 |
736 |
735 PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ; |
737 PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ; |
736 String codeBase = ior.getProfile().getCodebase() ; |
738 String codeBase = ior.getProfile().getCodebase() ; |
737 PresentationManager.StubFactory stubFactory = null ; |
739 PresentationManager.StubFactory stubFactory = null ; |
738 |
740 |
739 if (clz == null) { |
741 if (clz == null) { |
740 RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ; |
742 RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ; |
741 String className = rid.getClassName() ; |
743 String className = rid.getClassName() ; |
|
744 orb.validateIORClass(className); |
742 boolean isIDLInterface = rid.isIDLType() ; |
745 boolean isIDLInterface = rid.isIDLType() ; |
743 |
746 |
744 if (className == null || className.equals( "" )) |
747 if (className == null || className.equals( "" )) |
745 stubFactory = null ; |
748 stubFactory = null ; |
746 else |
749 else |
759 stubFactory = PresentationDefaults.makeStaticStubFactory( |
762 stubFactory = PresentationDefaults.makeStaticStubFactory( |
760 clz ) ; |
763 clz ) ; |
761 } else { |
764 } else { |
762 // clz is an interface class |
765 // clz is an interface class |
763 boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ; |
766 boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ; |
764 |
|
765 stubFactory = sff.createStubFactory( clz.getName(), |
767 stubFactory = sff.createStubFactory( clz.getName(), |
766 isIDL, codeBase, clz, clz.getClassLoader() ) ; |
768 isIDL, codeBase, clz, clz.getClassLoader() ) ; |
767 } |
769 } |
768 |
|
769 return internalIORToObject( ior, stubFactory, orb ) ; |
770 return internalIORToObject( ior, stubFactory, orb ) ; |
770 } |
771 } |
771 |
772 |
772 /* |
773 /* |
773 * This is used as a general utility (e.g., the PortableInterceptor |
774 * This is used as a general utility (e.g., the PortableInterceptor |