Java Code Examples for com.sun.corba.se.spi.presentation.rmi.PresentationManager#StubFactoryFactory

The following examples show how to use com.sun.corba.se.spi.presentation.rmi.PresentationManager#StubFactoryFactory . 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
/** Get the appropriate StubFactoryFactory.  This
 * will be dynamic or static depending on whether
 * com.sun.CORBA.ORBUseDynamicStub is true or false.
 */
public static PresentationManager.StubFactoryFactory
    getStubFactoryFactory()
{
    PresentationManager gPM = getPresentationManager();
    boolean useDynamicStubs = gPM.useDynamicStubs() ;
    return gPM.getStubFactoryFactory( useDynamicStubs ) ;
}
 
Example 2
Source File: StubFactoryFactoryDynamicBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public PresentationManager.StubFactory createStubFactory(
    String className, boolean isIDLStub, String remoteCodeBase,
    Class expectedClass, ClassLoader classLoader)
{
    Class cls = null ;

    try {
        cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
    } catch (ClassNotFoundException exc) {
        throw wrapper.classNotFound3(
            CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
    }

    PresentationManager pm = ORB.getPresentationManager() ;

    if (IDLEntity.class.isAssignableFrom( cls ) &&
        !Remote.class.isAssignableFrom( cls )) {
        // IDL stubs must always use static factories.
        PresentationManager.StubFactoryFactory sff =
            pm.getStubFactoryFactory( false ) ;
        PresentationManager.StubFactory sf =
            sff.createStubFactory( className, true, remoteCodeBase,
                expectedClass, classLoader ) ;
        return sf ;
    } else {
        PresentationManager.ClassData classData = pm.getClassData( cls ) ;
        return makeDynamicStubFactory( pm, classData, classLoader ) ;
    }
}
 
Example 3
Source File: ORB.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Get the appropriate StubFactoryFactory.  This
 * will be dynamic or static depending on whether
 * com.sun.CORBA.ORBUseDynamicStub is true or false.
 */
public static PresentationManager.StubFactoryFactory
    getStubFactoryFactory()
{
    PresentationManager gPM = getPresentationManager();
    boolean useDynamicStubs = gPM.useDynamicStubs() ;
    return gPM.getStubFactoryFactory( useDynamicStubs ) ;
}
 
Example 4
Source File: PresentationManagerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void setStubFactoryFactory( boolean isDynamic,
    PresentationManager.StubFactoryFactory sff )
{
    if (isDynamic)
        dynamicStubFactoryFactory = sff ;
    else
        staticStubFactoryFactory = sff ;
}
 
Example 5
Source File: StubFactoryFactoryDynamicBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public PresentationManager.StubFactory createStubFactory(
    String className, boolean isIDLStub, String remoteCodeBase,
    Class expectedClass, ClassLoader classLoader)
{
    Class cls = null ;

    try {
        cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
    } catch (ClassNotFoundException exc) {
        throw wrapper.classNotFound3(
            CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
    }

    PresentationManager pm = ORB.getPresentationManager() ;

    if (IDLEntity.class.isAssignableFrom( cls ) &&
        !Remote.class.isAssignableFrom( cls )) {
        // IDL stubs must always use static factories.
        PresentationManager.StubFactoryFactory sff =
            pm.getStubFactoryFactory( false ) ;
        PresentationManager.StubFactory sf =
            sff.createStubFactory( className, true, remoteCodeBase,
                expectedClass, classLoader ) ;
        return sf ;
    } else {
        PresentationManager.ClassData classData = pm.getClassData( cls ) ;
        return makeDynamicStubFactory( pm, classData, classLoader ) ;
    }
}
 
Example 6
Source File: PresentationManagerImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void setStubFactoryFactory( boolean isDynamic,
    PresentationManager.StubFactoryFactory sff )
{
    if (isDynamic)
        dynamicStubFactoryFactory = sff ;
    else
        staticStubFactoryFactory = sff ;
}
 
Example 7
Source File: PresentationManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public PresentationManager.StubFactoryFactory getStubFactoryFactory(
    boolean isDynamic )
{
    if (isDynamic)
        return dynamicStubFactoryFactory ;
    else
        return staticStubFactoryFactory ;
}
 
Example 8
Source File: PresentationManagerImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void setStubFactoryFactory( boolean isDynamic,
    PresentationManager.StubFactoryFactory sff )
{
    if (isDynamic)
        dynamicStubFactoryFactory = sff ;
    else
        staticStubFactoryFactory = sff ;
}
 
Example 9
Source File: PresentationManagerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public PresentationManager.StubFactoryFactory getStubFactoryFactory(
    boolean isDynamic )
{
    if (isDynamic)
        return dynamicStubFactoryFactory ;
    else
        return staticStubFactoryFactory ;
}
 
Example 10
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 11
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 12
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 13
Source File: PresentationDefaults.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public static PresentationManager.StubFactoryFactory
    getProxyStubFactoryFactory()
{
    return new StubFactoryFactoryProxyImpl();
}
 
Example 14
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 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: PresentationDefaults.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static PresentationManager.StubFactoryFactory
    getProxyStubFactoryFactory()
{
    return new StubFactoryFactoryProxyImpl();
}
 
Example 17
Source File: PresentationDefaults.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static PresentationManager.StubFactoryFactory
    getProxyStubFactoryFactory()
{
    return new StubFactoryFactoryProxyImpl();
}
 
Example 18
Source File: PresentationDefaults.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static PresentationManager.StubFactoryFactory
    getProxyStubFactoryFactory()
{
    return new StubFactoryFactoryProxyImpl();
}
 
Example 19
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 20
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);
    }