public String createForAnyType(Class<?> type) { return RepositoryId.createForAnyType(type); }
/** * Returns the repository ID for the given RMI value Class. * * @param clz * The class to return a repository ID for. * @return the repository ID of the Class. **/ public String getRMIRepositoryID(Class<?> clz) { return RepositoryId.createForJavaType(clz); }
public static String createForSpecialCase(java.io.Serializable ser) { Class<?> clazz = ser.getClass(); if (clazz.isArray()) { return createSequenceRepID(ser); } else return createForSpecialCase(clazz); }
/** * Creates a repository ID for a normal Java Type. * * @param clz * The Java class to create a repository ID for * @exception org.jboss.com.sun.corba.se.impl.io.TypeMismatchException * if ser implements the org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL * Value type. **/ public static String createForJavaType(Class<?> clz) throws org.jboss.com.sun.corba.se.impl.io.TypeMismatchException { synchronized (classToRepStr) { String repid = createForSpecialCase(clz); if (repid != null) return repid; repid = (String) classToRepStr.get(clz); if (repid != null) return repid; repid = kValuePrefix + convertToISOLatin1(clz.getName()) + createHashString(clz); classToRepStr.put(clz, repid); repStrToClass.put(repid, clz); return repid; } }
return createSequenceRepID(type); else if (IDLEntity.class.isAssignableFrom(type)) return getIdFromHelper(type); return createForIDLType(type, 1, 0); return createForJavaType(type);
String clazzRepIDStr = createForAnyType(clazz); if ((targetRepid.isRMIValueType()) && (clazzRepid.isRMIValueType())) if (!targetRepid.getSerialVersionUID().equals(clazzRepid.getSerialVersionUID())) + clazzRepid.getSerialVersionUID() + " whereas Target (Rep. ID " + repositoryID + ") = " + targetRepid.getSerialVersionUID();
public String createSequenceRepID(java.lang.Object ser) { return RepositoryId.createSequenceRepID(ser); }
buf.append(convertToISOLatin1(clazz.getName())); buf.append(";"); buf.append(createHashString(clazz)); repid = buf.toString();
loadStubClass = true; else if (RepositoryId.isAbstractBase(componentType)) String repID = RepositoryId.createForAnyType(componentType); Class<?> stubType = Utility.loadStubClass(repID, codebase, componentType); actualType = stubType;
public final synchronized RepositoryId getId(String key) { RepositoryId repId = super.get(key); if (repId != null) return repId; else { // repId = pool.popId().init(key); repId = new RepositoryId(key); put(key, repId); return repId; } } }
/** * 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(); }
/** * Convert strings with ISO Latin 1 escape sequences back to original strings. * <p> * Section 5.5.7 of OBV spec. */ private static String convertFromISOLatin1(String name) { int index = -1; StringBuffer buf = new StringBuffer(name); while ((index = buf.toString().indexOf("\\U")) != -1) { String str = "0000" + buf.toString().substring(index + 2, index + 6); // Convert Hexadecimal byte[] buffer = new byte[(str.length() - 4) / 2]; for (int i = 4, j = 0; i < str.length(); i += 2, j++) { buffer[j] = (byte) ((Utility.hexOf(str.charAt(i)) << 4) & 0xF0); buffer[j] |= (byte) ((Utility.hexOf(str.charAt(i + 1)) << 0) & 0x0F); } buf = new StringBuffer(delete(buf.toString(), index, index + 6)); buf.insert(index, (char) buffer[1]); } return buf.toString(); }
String repId = convertFromISOLatin1(aRepId);
/** * Creates a repository ID for a normal Java Type. * * @param clz * The Java class to create a repository ID for * @exception org.jboss.com.sun.corba.se.impl.io.TypeMismatchException * if ser implements the org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL * Value type. **/ public static String createForJavaType(Class<?> clz) throws org.jboss.com.sun.corba.se.impl.io.TypeMismatchException { synchronized (classToRepStr) { String repid = createForSpecialCase(clz); if (repid != null) return repid; repid = (String) classToRepStr.get(clz); if (repid != null) return repid; repid = kValuePrefix + convertToISOLatin1(clz.getName()) + createHashString(clz); classToRepStr.put(clz, repid); repStrToClass.put(repid, clz); return repid; } }
return createSequenceRepID(type); else if (IDLEntity.class.isAssignableFrom(type)) return getIdFromHelper(type); return createForIDLType(type, 1, 0); return createForJavaType(type);
String clazzRepIDStr = createForAnyType(clazz); if ((targetRepid.isRMIValueType()) && (clazzRepid.isRMIValueType())) if (!targetRepid.getSerialVersionUID().equals(clazzRepid.getSerialVersionUID())) + clazzRepid.getSerialVersionUID() + " whereas Target (Rep. ID " + repositoryID + ") = " + targetRepid.getSerialVersionUID();
public String createSequenceRepID(java.lang.Object ser) { return RepositoryId.createSequenceRepID(ser); }
buf.append(convertToISOLatin1(clazz.getName())); buf.append(";"); buf.append(createHashString(clazz)); repid = buf.toString();
loadStubClass = true; else if (RepositoryId.isAbstractBase(componentType)) String repID = RepositoryId.createForAnyType(componentType); Class<?> stubType = Utility.loadStubClass(repID, codebase, componentType); actualType = stubType;
public final synchronized RepositoryId getId(String key) { RepositoryId repId = super.get(key); if (repId != null) return repId; else { // repId = pool.popId().init(key); repId = new RepositoryId(key); put(key, repId); return repId; } } }