com.sun.corba.se.spi.presentation.rmi.PresentationDefaults Java Examples

The following examples show how to use com.sun.corba.se.spi.presentation.rmi.PresentationDefaults. 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 File: ORB.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub = false;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory = null;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #2
Source File: ORB.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #3
Source File: CDRInputStream_1_0.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil())
        return null ;

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;

        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }

    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #4
Source File: IDLJavaSerializationInputStream.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #5
Source File: ORB.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #6
Source File: CDRInputStream_1_0.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil())
        return null ;

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;

        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }

    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #7
Source File: IDLJavaSerializationInputStream.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #8
Source File: ORB.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #9
Source File: CDRInputStream_1_0.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil())
        return null ;

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;

        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }

    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #10
Source File: IDLJavaSerializationInputStream.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #11
Source File: ORB.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #12
Source File: CDRInputStream_1_0.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil())
        return null ;

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;

        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }

    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #13
Source File: IDLJavaSerializationInputStream.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #14
Source File: CDRInputStream_1_0.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil()) {
        return null ;
    }

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        orb.validateIORClass(className);
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;
        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }
    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #15
Source File: IDLJavaSerializationInputStream.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #16
Source File: ORB.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #17
Source File: CDRInputStream_1_0.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil()) {
        return null ;
    }

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        orb.validateIORClass(className);
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;
        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }
    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #18
Source File: IDLJavaSerializationInputStream.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #19
Source File: ORB.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #20
Source File: CDRInputStream_1_0.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil()) {
        return null ;
    }

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        orb.validateIORClass(className);
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;
        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }
    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #21
Source File: IDLJavaSerializationInputStream.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #22
Source File: ORB.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #23
Source File: CDRInputStream_1_0.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil())
        return null ;

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;

        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }

    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #24
Source File: IDLJavaSerializationInputStream.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #25
Source File: ORB.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #26
Source File: CDRInputStream_1_0.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil()) {
        return null ;
    }

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        orb.validateIORClass(className);
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;
        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }
    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #27
Source File: IDLJavaSerializationInputStream.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }
 
Example #28
Source File: ORB.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static PresentationManager setupPresentationManager() {
    staticWrapper = ORBUtilSystemException.get(
        CORBALogDomains.RPC_PRESENTATION ) ;

    boolean useDynamicStub =
        ((Boolean)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Boolean.valueOf( Boolean.getBoolean (
                        ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
                }
            }
        )).booleanValue() ;

    PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
        (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
            new PrivilegedAction() {
                public java.lang.Object run() {
                    PresentationManager.StubFactoryFactory sff =
                        PresentationDefaults.getProxyStubFactoryFactory() ;

                    String className = System.getProperty(
                        ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
                        "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;

                    try {
                        // First try the configured class name, if any
                        Class<?> cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ;
                        sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
                    } catch (Exception exc) {
                        // Use the default. Log the error as a warning.
                        staticWrapper.errorInSettingDynamicStubFactoryFactory(
                            exc, className ) ;
                    }

                    return sff ;
                }
            }
        ) ;

    PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
    pm.setStubFactoryFactory( false,
        PresentationDefaults.getStaticStubFactoryFactory() ) ;
    pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
    return pm;
}
 
Example #29
Source File: CDRInputStream_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(Class clz)
{
    // In any case, we must first read the IOR.
    IOR ior = IORFactories.makeIOR(parent) ;
    if (ior.isNil())
        return null ;

    PresentationManager.StubFactoryFactory sff = ORB.getStubFactoryFactory() ;
    String codeBase = ior.getProfile().getCodebase() ;
    PresentationManager.StubFactory stubFactory = null ;

    if (clz == null) {
        RepositoryId rid = RepositoryId.cache.getId( ior.getTypeId() ) ;
        String className = rid.getClassName() ;
        boolean isIDLInterface = rid.isIDLType() ;

        if (className == null || className.equals( "" ))
            stubFactory = null ;
        else
            try {
                stubFactory = sff.createStubFactory( className,
                    isIDLInterface, codeBase, (Class)null,
                    (ClassLoader)null );
            } catch (Exception exc) {
                // Could not create stubFactory, so use null.
                // XXX stubFactory handling is still too complex:
                // Can we resolve the stubFactory question once in
                // a single place?
                stubFactory = null ;
            }
    } else if (StubAdapter.isStubClass( clz )) {
        stubFactory = PresentationDefaults.makeStaticStubFactory(
            clz ) ;
    } else {
        // clz is an interface class
        boolean isIDL = IDLEntity.class.isAssignableFrom( clz ) ;

        stubFactory = sff.createStubFactory( clz.getName(),
            isIDL, codeBase, clz, clz.getClassLoader() ) ;
    }

    return internalIORToObject( ior, stubFactory, orb ) ;
}
 
Example #30
Source File: IDLJavaSerializationInputStream.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public org.omg.CORBA.Object read_Object(java.lang.Class clz) {

        // In any case, we must first read the IOR.
        IOR ior = IORFactories.makeIOR(parent) ;
        if (ior.isNil()) {
            return null;
        }

        PresentationManager.StubFactoryFactory sff =
            ORB.getStubFactoryFactory();
        String codeBase = ior.getProfile().getCodebase();
        PresentationManager.StubFactory stubFactory = null;

        if (clz == null) {
            RepositoryId rid = RepositoryId.cache.getId(ior.getTypeId() );
            String className = rid.getClassName();
            boolean isIDLInterface = rid.isIDLType();

            if (className == null || className.equals( "" )) {
                stubFactory = null;
            } else {
                try {
                    stubFactory = sff.createStubFactory(className,
                        isIDLInterface, codeBase, (Class) null,
                        (ClassLoader) null);
                } catch (Exception exc) {
                    // Could not create stubFactory, so use null.
                    // XXX stubFactory handling is still too complex:
                    // Can we resolve the stubFactory question once in
                    // a single place?
                    stubFactory = null ;
                }
            }
        } else if (StubAdapter.isStubClass(clz)) {
            stubFactory = PresentationDefaults.makeStaticStubFactory(clz);
        } else {
            // clz is an interface class
            boolean isIDL = IDLEntity.class.isAssignableFrom(clz);

            stubFactory = sff.createStubFactory(
                 clz.getName(), isIDL, codeBase, clz, clz.getClassLoader());
        }

        return CDRInputStream_1_0.internalIORToObject(ior, stubFactory, orb);
    }