com.sun.corba.se.impl.util.RepositoryId Java Examples

The following examples show how to use com.sun.corba.se.impl.util.RepositoryId. 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: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: ValueUtility.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static String getSignature(ValueMember member)
    throws ClassNotFoundException {

    // REVISIT.  Can the type be something that is
    // non-primitive yet not a value_box, value, or objref?
    // If so, should use ObjectStreamClass or throw
    // exception.

    if (member.type.kind().value() == TCKind._tk_value_box ||
        member.type.kind().value() == TCKind._tk_value ||
        member.type.kind().value() == TCKind._tk_objref) {
        Class c = RepositoryId.cache.getId(member.id).getClassFromType();
        return ObjectStreamClass.getSignature(c);

    } else {

        return primitiveConstants[member.type.kind().value()];
    }

}
 
Example #2
Source Project: openjdk-jdk9   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 #3
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
*  Returns a boolean of whether or not RepositoryId indicates
*  FullValueDescriptor.
*  used for backward compatability
*/

public boolean useFullValueDescription(Class clazz, String repositoryID)
   throws IOException
{
   return RepositoryId.useFullValueDescription(clazz, repositoryID);
}
 
Example #4
Source Project: hottub   Author: dsrg-uoft   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
*  Returns a boolean of whether or not RepositoryId indicates
*  FullValueDescriptor.
*  used for backward compatability
*/

public boolean useFullValueDescription(Class clazz, String repositoryID)
   throws IOException
{
   return RepositoryId.useFullValueDescription(clazz, repositoryID);
}
 
Example #5
Source Project: openjdk-8-source   Author: keerath   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
*  Returns a boolean of whether or not RepositoryId indicates
*  FullValueDescriptor.
*  used for backward compatability
*/

public boolean useFullValueDescription(Class clazz, String repositoryID)
   throws IOException
{
   return RepositoryId.useFullValueDescription(clazz, repositoryID);
}
 
Example #6
Source Project: openjdk-8   Author: bpupadhyaya   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
*  Returns a boolean of whether or not RepositoryId indicates
*  FullValueDescriptor.
*  used for backward compatability
*/

public boolean useFullValueDescription(Class clazz, String repositoryID)
   throws IOException
{
   return RepositoryId.useFullValueDescription(clazz, repositoryID);
}
 
Example #7
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: ObjectStreamClass.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Java to IDL ptc-02-01-12 1.5.1
 *
 * "The rep_id string passed to the start_value method must be
 * 'RMI:org.omg.custom.class:hashcode:suid' where class is the
 * fully-qualified name of the class whose writeObject method
 * is being invoked and hashcode and suid are the class's hashcode
 * and SUID."
 */
private String computeRMIIIOPOptionalDataRepId() {

    StringBuffer sbuf = new StringBuffer("RMI:org.omg.custom.");
    sbuf.append(RepositoryId.convertToISOLatin1(this.getName()));
    sbuf.append(':');
    sbuf.append(this.getActualSerialVersionUIDStr());
    sbuf.append(':');
    sbuf.append(this.getSerialVersionUIDStr());

    return sbuf.toString();
}
 
Example #8
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public Class getAnyClassFromType(String id)
   throws ClassNotFoundException
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.getAnyClassFromType();
}
 
Example #9
Source Project: openjdk-8   Author: bpupadhyaya   File: IDLJavaSerializationInputStream.java    License: 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 #10
Source Project: hottub   Author: dsrg-uoft   File: IDLJavaSerializationInputStream.java    License: 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 Project: jdk1.8-source-analysis   Author: raysonfang   File: RepIdDelegator.java    License: Apache License 2.0 4 votes vote down vote up
public String createForJavaType(Serializable ser)
    throws TypeMismatchException
{
    return RepositoryId.createForJavaType(ser);
}
 
Example #12
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: IIOPOutputStream.java    License: GNU General Public License v2.0 4 votes vote down vote up
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example #13
Source Project: hottub   Author: dsrg-uoft   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public String getDefinedInId(String id)
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.getDefinedInId();
}
 
Example #14
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: RepIdDelegator.java    License: GNU General Public License v2.0 4 votes vote down vote up
public String createForJavaType(Serializable ser)
    throws TypeMismatchException
{
    return RepositoryId.createForJavaType(ser);
}
 
Example #15
Source Project: openjdk-8   Author: bpupadhyaya   File: RepIdDelegator.java    License: GNU General Public License v2.0 4 votes vote down vote up
public int getCodeBaseRMIUnchunkedNoRepStrId() {
    return RepositoryId.kPreComputed_CodeBaseRMIUnchunked_NoRep;
}
 
Example #16
Source Project: hottub   Author: dsrg-uoft   File: RepIdDelegator.java    License: GNU General Public License v2.0 4 votes vote down vote up
public String createForJavaType(Serializable ser)
    throws TypeMismatchException
{
    return RepositoryId.createForJavaType(ser);
}
 
Example #17
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: RepIdDelegator.java    License: Apache License 2.0 4 votes vote down vote up
public String getWStringValueRepId() {
    return RepositoryId.kWStringValueRepID;
}
 
Example #18
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: RepIdDelegator.java    License: GNU General Public License v2.0 4 votes vote down vote up
public String createSequenceRepID(Class clazz) {
    return RepositoryId.createSequenceRepID(clazz);
}
 
Example #19
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: RepIdDelegator.java    License: MIT License 4 votes vote down vote up
public String createSequenceRepID(java.lang.Object ser) {
    return RepositoryId.createSequenceRepID(ser);
}
 
Example #20
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: ValueHandlerImpl.java    License: MIT License 4 votes vote down vote up
public boolean isAbstractBase(Class clazz)
{
   return RepositoryId.isAbstractBase(clazz);
}
 
Example #21
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: RepIdDelegator.java    License: GNU General Public License v2.0 4 votes vote down vote up
public String getWStringValueRepId() {
    return RepositoryId.kWStringValueRepID;
}
 
Example #22
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: RepIdDelegator.java    License: MIT License 4 votes vote down vote up
public int getStandardRMIUnchunkedNoRepStrId() {
    return RepositoryId.kPreComputed_StandardRMIUnchunked_NoRep;
}
 
Example #23
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: RepIdDelegator.java    License: Apache License 2.0 4 votes vote down vote up
public int getStandardRMIUnchunkedId() {
    return RepositoryId.kPreComputed_StandardRMIUnchunked;
}
 
Example #24
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
private boolean isArray(String repId){
    return RepositoryId.cache.getId(repId).isSequence();
}
 
Example #25
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: RepIdDelegator.java    License: GNU General Public License v2.0 4 votes vote down vote up
public int getCodeBaseRMIUnchunkedNoRepStrId() {
    return RepositoryId.kPreComputed_CodeBaseRMIUnchunked_NoRep;
}
 
Example #26
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: RepIdDelegator.java    License: GNU General Public License v2.0 4 votes vote down vote up
public int getCodeBaseRMIUnchunkedId() {
    return RepositoryId.kPreComputed_CodeBaseRMIUnchunked;
}
 
Example #27
Source Project: hottub   Author: dsrg-uoft   File: ValueHandlerImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public Class getAnyClassFromType(String id)
   throws ClassNotFoundException
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.getAnyClassFromType();
}
 
Example #28
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPOutputStream.java    License: Apache License 2.0 4 votes vote down vote up
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example #29
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: IIOPOutputStream.java    License: MIT License 4 votes vote down vote up
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example #30
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: RepIdDelegator.java    License: GNU General Public License v2.0 4 votes vote down vote up
public boolean isChunkedEncoding(int valueTag) {
    return RepositoryId.isChunkedEncoding(valueTag);
}