Java Code Examples for sun.corba.SharedSecrets

The following examples show how to use sun.corba.SharedSecrets. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: TencentKona-8   Source File: StubIORImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public  void doRead( java.io.ObjectInputStream stream )
    throws IOException, ClassNotFoundException
{
    // read the IOR from the ObjectInputStream
    int typeLength = stream.readInt();
    SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, typeLength);
    typeData = new byte[typeLength];
    stream.readFully(typeData);

    int numProfiles = stream.readInt();
    SharedSecrets.getJavaOISAccess().checkArray(stream, int[].class, numProfiles);
    SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, numProfiles);
    profileTags = new int[numProfiles];
    profileData = new byte[numProfiles][];
    for (int i = 0; i < numProfiles; i++) {
        profileTags[i] = stream.readInt();
        int dataSize = stream.readInt();
        SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, dataSize);
        profileData[i] = new byte[dataSize];
        stream.readFully(profileData[i]);
    }
}
 
Example 2
Source Project: JDKSourceCode1.8   Source File: StubIORImpl.java    License: MIT License 6 votes vote down vote up
public  void doRead( java.io.ObjectInputStream stream )
    throws IOException, ClassNotFoundException
{
    // read the IOR from the ObjectInputStream
    int typeLength = stream.readInt();
    SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, typeLength);
    typeData = new byte[typeLength];
    stream.readFully(typeData);

    int numProfiles = stream.readInt();
    SharedSecrets.getJavaOISAccess().checkArray(stream, int[].class, numProfiles);
    SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, numProfiles);
    profileTags = new int[numProfiles];
    profileData = new byte[numProfiles][];
    for (int i = 0; i < numProfiles; i++) {
        profileTags[i] = stream.readInt();
        int dataSize = stream.readInt();
        SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, dataSize);
        profileData[i] = new byte[dataSize];
        stream.readFully(profileData[i]);
    }
}
 
Example 3
Source Project: openjdk-jdk8u   Source File: StubIORImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public  void doRead( java.io.ObjectInputStream stream )
    throws IOException, ClassNotFoundException
{
    // read the IOR from the ObjectInputStream
    int typeLength = stream.readInt();
    SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, typeLength);
    typeData = new byte[typeLength];
    stream.readFully(typeData);

    int numProfiles = stream.readInt();
    SharedSecrets.getJavaOISAccess().checkArray(stream, int[].class, numProfiles);
    SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, numProfiles);
    profileTags = new int[numProfiles];
    profileData = new byte[numProfiles][];
    for (int i = 0; i < numProfiles; i++) {
        profileTags[i] = stream.readInt();
        int dataSize = stream.readInt();
        SharedSecrets.getJavaOISAccess().checkArray(stream, byte[].class, dataSize);
        profileData[i] = new byte[dataSize];
        stream.readFully(profileData[i]);
    }
}
 
Example 4
Source Project: jdk1.8-source-analysis   Source File: OperationFactory.java    License: Apache License 2.0 5 votes vote down vote up
public Object operate( Object value )
{
    String className = getString( value ) ;

    try {
        Class<?> result =
            SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
        return result ;
    } catch (Exception exc) {
        ORBUtilSystemException wrapper = ORBUtilSystemException.get(
            CORBALogDomains.ORB_LIFECYCLE ) ;
        throw wrapper.couldNotLoadClass( exc, className ) ;
    }
}
 
Example 5
Source Project: jdk1.8-source-analysis   Source File: ParserTable.java    License: Apache License 2.0 5 votes vote down vote up
private Operation makeLegacySocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> legacySocketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) {
                    return legacySocketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( legacySocketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example 6
Source Project: jdk1.8-source-analysis   Source File: ParserTable.java    License: Apache License 2.0 5 votes vote down vote up
private Operation makeSocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> socketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) {
                    return socketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( socketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example 7
Source Project: jdk1.8-source-analysis   Source File: ParserTable.java    License: Apache License 2.0 5 votes vote down vote up
private Operation makeIORToSocketInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iorToSocketInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IORToSocketInfo.class.isAssignableFrom(iorToSocketInfoClass)) {
                    return iorToSocketInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIorToSocketInfoType( iorToSocketInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIorToSocketInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 8
Source Project: jdk1.8-source-analysis   Source File: ParserTable.java    License: Apache License 2.0 5 votes vote down vote up
private Operation makeIIOPPrimaryToContactInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iiopPrimaryToContactInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) {
                    return iiopPrimaryToContactInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIiopPrimaryToContactInfoType( iiopPrimaryToContactInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIiopPrimaryToContactInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 9
Source Project: jdk1.8-source-analysis   Source File: ParserTable.java    License: Apache License 2.0 5 votes vote down vote up
private Operation makeContactInfoListFactoryOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> contactInfoListFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (CorbaContactInfoListFactory.class.isAssignableFrom(
                    contactInfoListFactoryClass)) {
                    return contactInfoListFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalContactInfoListFactoryType(
                        contactInfoListFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badContactInfoListFactory( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 10
public Object operate( Object value )
{
    String className = getString( value ) ;

    try {
        Class<?> result =
            SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
        return result ;
    } catch (Exception exc) {
        ORBUtilSystemException wrapper = ORBUtilSystemException.get(
            CORBALogDomains.ORB_LIFECYCLE ) ;
        throw wrapper.couldNotLoadClass( exc, className ) ;
    }
}
 
Example 11
Source Project: TencentKona-8   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeLegacySocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> legacySocketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) {
                    return legacySocketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( legacySocketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example 12
Source Project: TencentKona-8   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeSocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> socketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) {
                    return socketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( socketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example 13
Source Project: TencentKona-8   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeIORToSocketInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iorToSocketInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IORToSocketInfo.class.isAssignableFrom(iorToSocketInfoClass)) {
                    return iorToSocketInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIorToSocketInfoType( iorToSocketInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIorToSocketInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 14
Source Project: TencentKona-8   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeIIOPPrimaryToContactInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iiopPrimaryToContactInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) {
                    return iiopPrimaryToContactInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIiopPrimaryToContactInfoType( iiopPrimaryToContactInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIiopPrimaryToContactInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 15
Source Project: TencentKona-8   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeContactInfoListFactoryOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> contactInfoListFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (CorbaContactInfoListFactory.class.isAssignableFrom(
                    contactInfoListFactoryClass)) {
                    return contactInfoListFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalContactInfoListFactoryType(
                        contactInfoListFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badContactInfoListFactory( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 16
Source Project: jdk8u60   Source File: OperationFactory.java    License: GNU General Public License v2.0 5 votes vote down vote up
public Object operate( Object value )
{
    String className = getString( value ) ;

    try {
        Class<?> result =
            SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
        return result ;
    } catch (Exception exc) {
        ORBUtilSystemException wrapper = ORBUtilSystemException.get(
            CORBALogDomains.ORB_LIFECYCLE ) ;
        throw wrapper.couldNotLoadClass( exc, className ) ;
    }
}
 
Example 17
Source Project: jdk8u60   Source File: MessageBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
static SystemException getSystemException(
    String exClassName, int minorCode, CompletionStatus completionStatus,
    String message, ORBUtilSystemException wrapper)
{
    SystemException sysEx = null;

    try {
        Class<?> clazz =
            SharedSecrets.getJavaCorbaAccess().loadClass(exClassName);
        if (message == null) {
            sysEx = (SystemException) clazz.newInstance();
        } else {
            Class[] types = { String.class };
            Constructor constructor = clazz.getConstructor(types);
            Object[] args = { message };
            sysEx = (SystemException)constructor.newInstance(args);
        }
    } catch (Exception someEx) {
        throw wrapper.badSystemExceptionInReply(
            CompletionStatus.COMPLETED_MAYBE, someEx );
    }

    sysEx.minor = minorCode;
    sysEx.completed = completionStatus;

    return sysEx;
}
 
Example 18
Source Project: jdk8u60   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeLegacySocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> legacySocketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) {
                    return legacySocketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( legacySocketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example 19
Source Project: jdk8u60   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeSocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> socketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) {
                    return socketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( socketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example 20
Source Project: jdk8u60   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeIORToSocketInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iorToSocketInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IORToSocketInfo.class.isAssignableFrom(iorToSocketInfoClass)) {
                    return iorToSocketInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIorToSocketInfoType( iorToSocketInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIorToSocketInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 21
Source Project: jdk8u60   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeIIOPPrimaryToContactInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iiopPrimaryToContactInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) {
                    return iiopPrimaryToContactInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIiopPrimaryToContactInfoType( iiopPrimaryToContactInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIiopPrimaryToContactInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 22
Source Project: jdk8u60   Source File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeContactInfoListFactoryOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> contactInfoListFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (CorbaContactInfoListFactory.class.isAssignableFrom(
                    contactInfoListFactoryClass)) {
                    return contactInfoListFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalContactInfoListFactoryType(
                        contactInfoListFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badContactInfoListFactory( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 23
Source Project: JDKSourceCode1.8   Source File: OperationFactory.java    License: MIT License 5 votes vote down vote up
public Object operate( Object value )
{
    String className = getString( value ) ;

    try {
        Class<?> result =
            SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
        return result ;
    } catch (Exception exc) {
        ORBUtilSystemException wrapper = ORBUtilSystemException.get(
            CORBALogDomains.ORB_LIFECYCLE ) ;
        throw wrapper.couldNotLoadClass( exc, className ) ;
    }
}
 
Example 24
Source Project: JDKSourceCode1.8   Source File: MessageBase.java    License: MIT License 5 votes vote down vote up
static SystemException getSystemException(
    String exClassName, int minorCode, CompletionStatus completionStatus,
    String message, ORBUtilSystemException wrapper)
{
    SystemException sysEx = null;

    try {
        Class<?> clazz =
            SharedSecrets.getJavaCorbaAccess().loadClass(exClassName);
        if (message == null) {
            sysEx = (SystemException) clazz.newInstance();
        } else {
            Class[] types = { String.class };
            Constructor constructor = clazz.getConstructor(types);
            Object[] args = { message };
            sysEx = (SystemException)constructor.newInstance(args);
        }
    } catch (Exception someEx) {
        throw wrapper.badSystemExceptionInReply(
            CompletionStatus.COMPLETED_MAYBE, someEx );
    }

    sysEx.minor = minorCode;
    sysEx.completed = completionStatus;

    return sysEx;
}
 
Example 25
Source Project: JDKSourceCode1.8   Source File: ParserTable.java    License: MIT License 5 votes vote down vote up
private Operation makeLegacySocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> legacySocketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) {
                    return legacySocketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( legacySocketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example 26
Source Project: JDKSourceCode1.8   Source File: ParserTable.java    License: MIT License 5 votes vote down vote up
private Operation makeSocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> socketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) {
                    return socketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( socketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example 27
Source Project: JDKSourceCode1.8   Source File: ParserTable.java    License: MIT License 5 votes vote down vote up
private Operation makeIORToSocketInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iorToSocketInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IORToSocketInfo.class.isAssignableFrom(iorToSocketInfoClass)) {
                    return iorToSocketInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIorToSocketInfoType( iorToSocketInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIorToSocketInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 28
Source Project: JDKSourceCode1.8   Source File: ParserTable.java    License: MIT License 5 votes vote down vote up
private Operation makeIIOPPrimaryToContactInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iiopPrimaryToContactInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) {
                    return iiopPrimaryToContactInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIiopPrimaryToContactInfoType( iiopPrimaryToContactInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIiopPrimaryToContactInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 29
Source Project: JDKSourceCode1.8   Source File: ParserTable.java    License: MIT License 5 votes vote down vote up
private Operation makeContactInfoListFactoryOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> contactInfoListFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (CorbaContactInfoListFactory.class.isAssignableFrom(
                    contactInfoListFactoryClass)) {
                    return contactInfoListFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalContactInfoListFactoryType(
                        contactInfoListFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badContactInfoListFactory( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example 30
public Object operate( Object value )
{
    String className = getString( value ) ;

    try {
        Class<?> result =
            SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
        return result ;
    } catch (Exception exc) {
        ORBUtilSystemException wrapper = ORBUtilSystemException.get(
            CORBALogDomains.ORB_LIFECYCLE ) ;
        throw wrapper.couldNotLoadClass( exc, className ) ;
    }
}