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 File: DynamicStubImpl.java    From openjdk-jdk9 with 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 #2
Source File: ValueUtility.java    From openjdk-jdk8u-backup with 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 #3
Source File: ValueHandlerImpl.java    From openjdk-jdk9 with 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 File: ObjectStreamClass.java    From openjdk-jdk8u with 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 #5
Source File: ValueHandlerImpl.java    From hottub with 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 File: ValueHandlerImpl.java    From openjdk-8-source with 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 File: ValueHandlerImpl.java    From openjdk-8 with 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 #8
Source File: RepIdDelegator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public int getStandardRMIUnchunkedId() {
    return RepositoryId.kPreComputed_StandardRMIUnchunked;
}
 
Example #9
Source File: RepIdDelegator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public boolean isCodeBasePresent(int valueTag) {
    return RepositoryId.isCodeBasePresent(valueTag);
}
 
Example #10
Source File: RepIdDelegator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public int getTypeInfo(int valueTag) {
    return RepositoryId.getTypeInfo(valueTag);
}
 
Example #11
Source File: RepIdDelegator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public String createSequenceRepID(Class clazz) {
    return RepositoryId.createSequenceRepID(clazz);
}
 
Example #12
Source File: ValueHandlerImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public String createForAnyType(Class cl)
{
   return RepositoryId.createForAnyType(cl);
}
 
Example #13
Source File: ValueHandlerImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public String getSerialVersionUID(String id)
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.getSerialVersionUID();
}
 
Example #14
Source File: RepIdDelegator.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public String createForAnyType(Class type) {
    return RepositoryId.createForAnyType(type);
}
 
Example #15
Source File: ValueHandlerImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public boolean isSequence(String id)
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.isSequence();
}
 
Example #16
Source File: ValueHandlerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Class getClassFromType(String id)
   throws ClassNotFoundException
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.getClassFromType();
}
 
Example #17
Source File: RepIdDelegator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public int getTypeInfo(int valueTag) {
    return RepositoryId.getTypeInfo(valueTag);
}
 
Example #18
Source File: ValueHandlerImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public boolean isSequence(String id)
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.isSequence();
}
 
Example #19
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 #20
Source File: RepIdDelegator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public String getClassDescValueRepId() {
    return RepositoryId.kClassDescValueRepID;
}
 
Example #21
Source File: ValueHandlerImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public Class getClassFromType(String id)
   throws ClassNotFoundException
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.getClassFromType();
}
 
Example #22
Source File: ValueHandlerImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public String getClassName(String id)
{
   RepositoryId repID = RepositoryId.cache.getId(id);
   return repID.getClassName();
}
 
Example #23
Source File: RepIdDelegator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public String createSequenceRepID(Class clazz) {
    return RepositoryId.createSequenceRepID(clazz);
}
 
Example #24
Source File: RepIdDelegator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public int getCodeBaseRMIChunkedId() {
    return RepositoryId.kPreComputed_CodeBaseRMIChunked;
}
 
Example #25
Source File: PortableRemoteObject.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Checks to ensure that an object of a remote or abstract interface type
 * can be cast to a desired type.
 * @param narrowFrom the object to check.
 * @param narrowTo the desired type.
 * @return an object which can be cast to the desired type.
 * @throws ClassCastException if narrowFrom cannot be cast to narrowTo.
 */
public java.lang.Object narrow ( java.lang.Object narrowFrom,
    java.lang.Class narrowTo) throws ClassCastException
{
    java.lang.Object result = null;

    if (narrowFrom == null)
        return null;

    if (narrowTo == null)
        throw new NullPointerException("invalid argument");

    try {
        if (narrowTo.isAssignableFrom(narrowFrom.getClass()))
            return narrowFrom;

        // Is narrowTo an interface that might be
        // implemented by a servant running on iiop?
        if (narrowTo.isInterface() &&
            narrowTo != java.io.Serializable.class &&
            narrowTo != java.io.Externalizable.class) {

            org.omg.CORBA.Object narrowObj
                = (org.omg.CORBA.Object) narrowFrom;

            // Create an id from the narrowTo type...
            String id = RepositoryId.createForAnyType(narrowTo);

            if (narrowObj._is_a(id)) {
                return Utility.loadStub(narrowObj,narrowTo);
            } else {
                throw new ClassCastException( "Object is not of remote type " +
                    narrowTo.getName() ) ;
            }
        } else {
            throw new ClassCastException( "Class " + narrowTo.getName() +
                " is not a valid remote interface" ) ;
        }
    } catch(Exception error) {
        ClassCastException cce = new ClassCastException() ;
        cce.initCause( error ) ;
        throw cce ;
    }
}
 
Example #26
Source File: RepIdDelegator.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
private RepIdDelegator(RepositoryId _delegate) {
    this.delegate = _delegate;
}
 
Example #27
Source File: ValueHandlerImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public String getSerialVersionUID(String id)
{
   RepositoryId repId = RepositoryId.cache.getId(id);
   return repId.getSerialVersionUID();
}
 
Example #28
Source File: RepIdDelegator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public String createForJavaType(Class clz)
    throws TypeMismatchException
{
    return RepositoryId.createForJavaType(clz);
}
 
Example #29
Source File: RepIdDelegator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public int getCodeBaseRMIUnchunkedNoRepStrId() {
    return RepositoryId.kPreComputed_CodeBaseRMIUnchunked_NoRep;
}
 
Example #30
Source File: ValueHandlerImpl.java    From jdk8u60 with 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();
}