1 /* |
1 /* |
2 * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2002, 2013, 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 |
76 import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; |
76 import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; |
77 import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry ; |
77 import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry ; |
78 import com.sun.corba.se.impl.legacy.connection.USLPort ; |
78 import com.sun.corba.se.impl.legacy.connection.USLPort ; |
79 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; |
79 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; |
80 import com.sun.corba.se.impl.oa.poa.BadServerIdHandler ; |
80 import com.sun.corba.se.impl.oa.poa.BadServerIdHandler ; |
81 import com.sun.corba.se.impl.orbutil.ORBClassLoader ; |
|
82 import com.sun.corba.se.impl.orbutil.ORBConstants ; |
81 import com.sun.corba.se.impl.orbutil.ORBConstants ; |
83 import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr ; |
82 import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr ; |
84 import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr ; |
83 import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr ; |
85 import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr ; |
84 import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr ; |
86 import com.sun.corba.se.impl.transport.DefaultIORToSocketInfoImpl; |
85 import com.sun.corba.se.impl.transport.DefaultIORToSocketInfoImpl; |
87 import com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl; |
86 import com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl; |
|
87 |
|
88 import sun.corba.SharedSecrets; |
88 |
89 |
89 /** Initialize the parser data for the standard ORB parser. This is used both |
90 /** Initialize the parser data for the standard ORB parser. This is used both |
90 * to implement ORBDataParserImpl and to provide the basic testing framework |
91 * to implement ORBDataParserImpl and to provide the basic testing framework |
91 * for ORBDataParserImpl. |
92 * for ORBDataParserImpl. |
92 */ |
93 */ |
638 public Object operate( Object value ) |
639 public Object operate( Object value ) |
639 { |
640 { |
640 String param = (String)value ; |
641 String param = (String)value ; |
641 |
642 |
642 try { |
643 try { |
643 Class legacySocketFactoryClass = |
644 Class<?> legacySocketFactoryClass = |
644 ORBClassLoader.loadClass(param); |
645 SharedSecrets.getJavaCorbaAccess().loadClass(param); |
645 // For security reasons avoid creating an instance if |
646 // For security reasons avoid creating an instance if |
646 // this socket factory class is not one that would fail |
647 // this socket factory class is not one that would fail |
647 // the class cast anyway. |
648 // the class cast anyway. |
648 if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) { |
649 if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) { |
649 return legacySocketFactoryClass.newInstance(); |
650 return legacySocketFactoryClass.newInstance(); |
668 public Object operate( Object value ) |
669 public Object operate( Object value ) |
669 { |
670 { |
670 String param = (String)value ; |
671 String param = (String)value ; |
671 |
672 |
672 try { |
673 try { |
673 Class socketFactoryClass = ORBClassLoader.loadClass(param); |
674 Class<?> socketFactoryClass = |
|
675 SharedSecrets.getJavaCorbaAccess().loadClass(param); |
674 // For security reasons avoid creating an instance if |
676 // For security reasons avoid creating an instance if |
675 // this socket factory class is not one that would fail |
677 // this socket factory class is not one that would fail |
676 // the class cast anyway. |
678 // the class cast anyway. |
677 if (com.sun.corba.se.spi.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) { |
679 if (com.sun.corba.se.spi.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) { |
678 return socketFactoryClass.newInstance(); |
680 return socketFactoryClass.newInstance(); |
697 public Object operate( Object value ) |
699 public Object operate( Object value ) |
698 { |
700 { |
699 String param = (String)value ; |
701 String param = (String)value ; |
700 |
702 |
701 try { |
703 try { |
702 Class iorToSocketInfoClass = ORBClassLoader.loadClass(param); |
704 Class<?> iorToSocketInfoClass = |
|
705 SharedSecrets.getJavaCorbaAccess().loadClass(param); |
703 // For security reasons avoid creating an instance if |
706 // For security reasons avoid creating an instance if |
704 // this socket factory class is not one that would fail |
707 // this socket factory class is not one that would fail |
705 // the class cast anyway. |
708 // the class cast anyway. |
706 if (IORToSocketInfo.class.isAssignableFrom(iorToSocketInfoClass)) { |
709 if (IORToSocketInfo.class.isAssignableFrom(iorToSocketInfoClass)) { |
707 return iorToSocketInfoClass.newInstance(); |
710 return iorToSocketInfoClass.newInstance(); |
726 public Object operate( Object value ) |
729 public Object operate( Object value ) |
727 { |
730 { |
728 String param = (String)value ; |
731 String param = (String)value ; |
729 |
732 |
730 try { |
733 try { |
731 Class iiopPrimaryToContactInfoClass = ORBClassLoader.loadClass(param); |
734 Class<?> iiopPrimaryToContactInfoClass = |
|
735 SharedSecrets.getJavaCorbaAccess().loadClass(param); |
732 // For security reasons avoid creating an instance if |
736 // For security reasons avoid creating an instance if |
733 // this socket factory class is not one that would fail |
737 // this socket factory class is not one that would fail |
734 // the class cast anyway. |
738 // the class cast anyway. |
735 if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) { |
739 if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) { |
736 return iiopPrimaryToContactInfoClass.newInstance(); |
740 return iiopPrimaryToContactInfoClass.newInstance(); |
755 public Object operate( Object value ) |
759 public Object operate( Object value ) |
756 { |
760 { |
757 String param = (String)value ; |
761 String param = (String)value ; |
758 |
762 |
759 try { |
763 try { |
760 Class contactInfoListFactoryClass = |
764 Class<?> contactInfoListFactoryClass = |
761 ORBClassLoader.loadClass(param); |
765 SharedSecrets.getJavaCorbaAccess().loadClass(param); |
762 // For security reasons avoid creating an instance if |
766 // For security reasons avoid creating an instance if |
763 // this socket factory class is not one that would fail |
767 // this socket factory class is not one that would fail |
764 // the class cast anyway. |
768 // the class cast anyway. |
765 if (CorbaContactInfoListFactory.class.isAssignableFrom( |
769 if (CorbaContactInfoListFactory.class.isAssignableFrom( |
766 contactInfoListFactoryClass)) { |
770 contactInfoListFactoryClass)) { |