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

The following examples show how to use com.sun.corba.se.spi.presentation.rmi.PresentationManager. 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: jdk1.8-source-analysis   Author: raysonfang   File: ORB.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
 * AppContext to hold it. Creates and records one if needed.
 */
public static PresentationManager getPresentationManager()
{
    SecurityManager sm = System.getSecurityManager();
    if (sm != null && AppContext.getAppContexts().size() > 0) {
        AppContext ac = AppContext.getAppContext();
        if (ac != null) {
            synchronized (pmLock) {
                PresentationManager pm =
                    (PresentationManager) ac.get(PresentationManager.class);
                if (pm == null) {
                    pm = setupPresentationManager();
                    ac.put(PresentationManager.class, pm);
                }
                return pm;
            }
        }
    }

    // No security manager or AppContext
    return Holder.defaultPresentationManager;
}
 
Example #2
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: DynamicStubImpl.java    License: Apache License 2.0 6 votes vote down vote up
public Object readResolve()
{
    String repositoryId = ior.getRepositoryId() ;
    String cname = RepositoryId.cache.getId( repositoryId ).getClassName() ;

    Class cls = null ;

    try {
        cls = JDKBridge.loadClass( cname, null, null ) ;
    } catch (ClassNotFoundException exc) {
        // XXX log this
    }

    PresentationManager pm =
        com.sun.corba.se.spi.orb.ORB.getPresentationManager() ;
    PresentationManager.ClassData classData = pm.getClassData( cls ) ;
    InvocationHandlerFactoryImpl ihfactory =
        (InvocationHandlerFactoryImpl)classData.getInvocationHandlerFactory() ;
    return ihfactory.getInvocationHandler( this ) ;
}
 
Example #3
Source Project: openjdk-8-source   Author: keerath   File: ORB.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
 * AppContext to hold it. Creates and records one if needed.
 */
public static PresentationManager getPresentationManager()
{
    SecurityManager sm = System.getSecurityManager();
    if (sm != null && AppContext.getAppContexts().size() > 0) {
        AppContext ac = AppContext.getAppContext();
        if (ac != null) {
            synchronized (pmLock) {
                PresentationManager pm =
                    (PresentationManager) ac.get(PresentationManager.class);
                if (pm == null) {
                    pm = setupPresentationManager();
                    ac.put(PresentationManager.class, pm);
                }
                return pm;
            }
        }
    }

    // No security manager or AppContext
    return Holder.defaultPresentationManager;
}
 
Example #4
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: DynamicStubImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public Object readResolve()
{
    String repositoryId = ior.getRepositoryId() ;
    String cname = RepositoryId.cache.getId( repositoryId ).getClassName() ;

    Class cls = null ;

    try {
        cls = JDKBridge.loadClass( cname, null, null ) ;
    } catch (ClassNotFoundException exc) {
        // XXX log this
    }

    PresentationManager pm =
        com.sun.corba.se.spi.orb.ORB.getPresentationManager() ;
    PresentationManager.ClassData classData = pm.getClassData( cls ) ;
    InvocationHandlerFactoryImpl ihfactory =
        (InvocationHandlerFactoryImpl)classData.getInvocationHandlerFactory() ;
    return ihfactory.getInvocationHandler( this ) ;
}
 
Example #5
Source Project: TencentKona-8   Author: Tencent   File: ORB.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
 * AppContext to hold it. Creates and records one if needed.
 */
public static PresentationManager getPresentationManager()
{
    SecurityManager sm = System.getSecurityManager();
    if (sm != null && AppContext.getAppContexts().size() > 0) {
        AppContext ac = AppContext.getAppContext();
        if (ac != null) {
            synchronized (pmLock) {
                PresentationManager pm =
                    (PresentationManager) ac.get(PresentationManager.class);
                if (pm == null) {
                    pm = setupPresentationManager();
                    ac.put(PresentationManager.class, pm);
                }
                return pm;
            }
        }
    }

    // No security manager or AppContext
    return Holder.defaultPresentationManager;
}
 
Example #6
Source Project: hottub   Author: dsrg-uoft   File: DynamicStubImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public Object readResolve()
{
    String repositoryId = ior.getRepositoryId() ;
    String cname = RepositoryId.cache.getId( repositoryId ).getClassName() ;

    Class cls = null ;

    try {
        cls = JDKBridge.loadClass( cname, null, null ) ;
    } catch (ClassNotFoundException exc) {
        // XXX log this
    }

    PresentationManager pm =
        com.sun.corba.se.spi.orb.ORB.getPresentationManager() ;
    PresentationManager.ClassData classData = pm.getClassData( cls ) ;
    InvocationHandlerFactoryImpl ihfactory =
        (InvocationHandlerFactoryImpl)classData.getInvocationHandlerFactory() ;
    return ihfactory.getInvocationHandler( this ) ;
}
 
Example #7
Source Project: openjdk-8   Author: bpupadhyaya   File: ORB.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
 * AppContext to hold it. Creates and records one if needed.
 */
public static PresentationManager getPresentationManager()
{
    SecurityManager sm = System.getSecurityManager();
    if (sm != null && AppContext.getAppContexts().size() > 0) {
        AppContext ac = AppContext.getAppContext();
        if (ac != null) {
            synchronized (pmLock) {
                PresentationManager pm =
                    (PresentationManager) ac.get(PresentationManager.class);
                if (pm == null) {
                    pm = setupPresentationManager();
                    ac.put(PresentationManager.class, pm);
                }
                return pm;
            }
        }
    }

    // No security manager or AppContext
    return Holder.defaultPresentationManager;
}
 
Example #8
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: DynamicStubImpl.java    License: MIT License 6 votes vote down vote up
public Object readResolve()
{
    String repositoryId = ior.getRepositoryId() ;
    String cname = RepositoryId.cache.getId( repositoryId ).getClassName() ;

    Class cls = null ;

    try {
        cls = JDKBridge.loadClass( cname, null, null ) ;
    } catch (ClassNotFoundException exc) {
        // XXX log this
    }

    PresentationManager pm =
        com.sun.corba.se.spi.orb.ORB.getPresentationManager() ;
    PresentationManager.ClassData classData = pm.getClassData( cls ) ;
    InvocationHandlerFactoryImpl ihfactory =
        (InvocationHandlerFactoryImpl)classData.getInvocationHandlerFactory() ;
    return ihfactory.getInvocationHandler( this ) ;
}
 
Example #9
Source Project: openjdk-8   Author: bpupadhyaya   File: DynamicStubImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public Object readResolve()
{
    String repositoryId = ior.getRepositoryId() ;
    String cname = RepositoryId.cache.getId( repositoryId ).getClassName() ;

    Class cls = null ;

    try {
        cls = JDKBridge.loadClass( cname, null, null ) ;
    } catch (ClassNotFoundException exc) {
        // XXX log this
    }

    PresentationManager pm =
        com.sun.corba.se.spi.orb.ORB.getPresentationManager() ;
    PresentationManager.ClassData classData = pm.getClassData( cls ) ;
    InvocationHandlerFactoryImpl ihfactory =
        (InvocationHandlerFactoryImpl)classData.getInvocationHandlerFactory() ;
    return ihfactory.getInvocationHandler( this ) ;
}
 
Example #10
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: InvocationHandlerFactoryImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InvocationHandlerFactoryImpl( PresentationManager pm,
    PresentationManager.ClassData classData )
{
    this.classData = classData ;
    this.pm = pm ;

    Class[] remoteInterfaces =
        classData.getIDLNameTranslator().getInterfaces() ;
    proxyInterfaces = new Class[ remoteInterfaces.length + 1 ] ;
    for (int ctr=0; ctr<remoteInterfaces.length; ctr++)
        proxyInterfaces[ctr] = remoteInterfaces[ctr] ;

    proxyInterfaces[remoteInterfaces.length] = DynamicStub.class ;
}
 
Example #11
Source Project: openjdk-8-source   Author: keerath   File: StubFactoryFactoryProxyImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public PresentationManager.StubFactory makeDynamicStubFactory(
    PresentationManager pm, final PresentationManager.ClassData classData,
    final ClassLoader classLoader )
{
    return AccessController
            .doPrivileged(new PrivilegedAction<StubFactoryProxyImpl>() {
                @Override
                public StubFactoryProxyImpl run() {
                    return new StubFactoryProxyImpl(classData, classLoader);
                }
            });
}
 
Example #12
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: StubFactoryFactoryDynamicBase.java    License: Apache License 2.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 #13
Source Project: openjdk-8   Author: bpupadhyaya   File: PresentationManagerImpl.java    License: 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 #14
Source Project: openjdk-8-source   Author: keerath   File: PresentationManagerImpl.java    License: 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 #15
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: PresentationManagerImpl.java    License: 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 #16
Source Project: openjdk-8   Author: bpupadhyaya   File: StubFactoryFactoryDynamicBase.java    License: 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 #17
Source Project: TencentKona-8   Author: Tencent   File: StubFactoryDynamicBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
private StubFactoryDynamicBase(Void unused,
        PresentationManager.ClassData classData, ClassLoader loader) {
    super(classData);
    // this.loader must not be null, or the newProxyInstance call
    // will fail.
    if (loader == null) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (cl == null)
            cl = ClassLoader.getSystemClassLoader();
        this.loader = cl ;
    } else {
        this.loader = loader ;
    }
}
 
Example #18
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: StubInvocationHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public StubInvocationHandlerImpl( PresentationManager pm,
    PresentationManager.ClassData classData, org.omg.CORBA.Object stub )
{
    SecurityManager s = System.getSecurityManager();
    if (s != null) {
        s.checkPermission(new DynamicAccessPermission("access"));
    }
    this.classData = classData ;
    this.pm = pm ;
    this.stub = stub ;
}
 
Example #19
Source Project: TencentKona-8   Author: Tencent   File: PresentationManagerImpl.java    License: 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 #20
Source Project: TencentKona-8   Author: Tencent   File: InvocationHandlerFactoryImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InvocationHandlerFactoryImpl( PresentationManager pm,
    PresentationManager.ClassData classData )
{
    this.classData = classData ;
    this.pm = pm ;

    Class[] remoteInterfaces =
        classData.getIDLNameTranslator().getInterfaces() ;
    proxyInterfaces = new Class[ remoteInterfaces.length + 1 ] ;
    for (int ctr=0; ctr<remoteInterfaces.length; ctr++)
        proxyInterfaces[ctr] = remoteInterfaces[ctr] ;

    proxyInterfaces[remoteInterfaces.length] = DynamicStub.class ;
}
 
Example #21
Source Project: openjdk-8   Author: bpupadhyaya   File: PresentationManagerImpl.java    License: 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 #22
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: StubFactoryDynamicBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
private StubFactoryDynamicBase(Void unused,
        PresentationManager.ClassData classData, ClassLoader loader) {
    super(classData);
    // this.loader must not be null, or the newProxyInstance call
    // will fail.
    if (loader == null) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (cl == null)
            cl = ClassLoader.getSystemClassLoader();
        this.loader = cl ;
    } else {
        this.loader = loader ;
    }
}
 
Example #23
Source Project: hottub   Author: dsrg-uoft   File: InvocationHandlerFactoryImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InvocationHandlerFactoryImpl( PresentationManager pm,
    PresentationManager.ClassData classData )
{
    this.classData = classData ;
    this.pm = pm ;

    Class[] remoteInterfaces =
        classData.getIDLNameTranslator().getInterfaces() ;
    proxyInterfaces = new Class[ remoteInterfaces.length + 1 ] ;
    for (int ctr=0; ctr<remoteInterfaces.length; ctr++)
        proxyInterfaces[ctr] = remoteInterfaces[ctr] ;

    proxyInterfaces[remoteInterfaces.length] = DynamicStub.class ;
}
 
Example #24
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: StubFactoryFactoryProxyImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public PresentationManager.StubFactory makeDynamicStubFactory(
    PresentationManager pm, final PresentationManager.ClassData classData,
    final ClassLoader classLoader )
{
    return AccessController
            .doPrivileged(new PrivilegedAction<StubFactoryProxyImpl>() {
                @Override
                public StubFactoryProxyImpl run() {
                    return new StubFactoryProxyImpl(classData, classLoader);
                }
            });
}
 
Example #25
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: ORB.java    License: 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 #26
Source Project: jdk8u60   Author: chenghanpeng   File: InvocationHandlerFactoryImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InvocationHandlerFactoryImpl( PresentationManager pm,
    PresentationManager.ClassData classData )
{
    this.classData = classData ;
    this.pm = pm ;

    Class[] remoteInterfaces =
        classData.getIDLNameTranslator().getInterfaces() ;
    proxyInterfaces = new Class[ remoteInterfaces.length + 1 ] ;
    for (int ctr=0; ctr<remoteInterfaces.length; ctr++)
        proxyInterfaces[ctr] = remoteInterfaces[ctr] ;

    proxyInterfaces[remoteInterfaces.length] = DynamicStub.class ;
}
 
Example #27
Source Project: jdk8u60   Author: chenghanpeng   File: StubFactoryFactoryProxyImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public PresentationManager.StubFactory makeDynamicStubFactory(
    PresentationManager pm, final PresentationManager.ClassData classData,
    final ClassLoader classLoader )
{
    return AccessController
            .doPrivileged(new PrivilegedAction<StubFactoryProxyImpl>() {
                @Override
                public StubFactoryProxyImpl run() {
                    return new StubFactoryProxyImpl(classData, classLoader);
                }
            });
}
 
Example #28
Source Project: jdk8u60   Author: chenghanpeng   File: StubInvocationHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public StubInvocationHandlerImpl( PresentationManager pm,
    PresentationManager.ClassData classData, org.omg.CORBA.Object stub )
{
    SecurityManager s = System.getSecurityManager();
    if (s != null) {
        s.checkPermission(new DynamicAccessPermission("access"));
    }
    this.classData = classData ;
    this.pm = pm ;
    this.stub = stub ;
}
 
Example #29
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: StubFactoryFactoryDynamicBase.java    License: 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 #30
Source Project: hottub   Author: dsrg-uoft   File: StubFactoryFactoryDynamicBase.java    License: 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 ) ;
    }
}