public String createForAnyType(Class<?> cl) { return RepositoryId_1_3.createForAnyType(cl); }
/** * 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 java.lang.String getRMIRepositoryID(Class<?> clz) { return RepositoryId_1_3.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(); throw new IOException(mssg);
public String createSequenceRepID(java.lang.Object ser) { return RepositoryId_1_3.createSequenceRepID(ser); }
buf.append(convertToISOLatin1(clazz.getName())); buf.append(";"); buf.append(createHashString(clazz)); repid = buf.toString();
public final synchronized RepositoryId_1_3 getId(String key) { RepositoryId_1_3 repId = super.get(key); if (repId != null) return repId; else { // repId = pool.popId().init(key); repId = new RepositoryId_1_3(key); put(key, repId); return repId; } } }
/** * 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) ((ORBUtility.hexOf(str.charAt(i)) << 4) & 0xF0); buffer[j] |= (byte) ((ORBUtility.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(); }
/** * Creates a repository ID for an IDL Java Type. * * @param ser * The IDL Value object to create a repository ID for * @param major * The major version number * @param minor * The minor version number * @exception org.jboss.com.sun.corba.se.impl.io.TypeMismatchException * if ser does not implement the org.omg.CORBA.portable.IDLEntity interface which indicates it is an * IDL Value type. **/ public static String createForIDLType(Class<?> ser, int major, int minor) throws org.jboss.com.sun.corba.se.impl.io.TypeMismatchException { synchronized (classIDLToRepStr) { String repid = (String) classIDLToRepStr.get(ser); if (repid != null) return repid; repid = kIDLPrefix + convertToISOLatin1(ser.getName()).replace('.', '/') + ":" + major + "." + minor; classIDLToRepStr.put(ser, repid); return repid; } }
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(); throw new IOException(mssg);
public String createSequenceRepID(Class<?> clazz) { return RepositoryId_1_3.createSequenceRepID(clazz); }
buf.append(convertToISOLatin1(clazz.getName())); buf.append(";"); buf.append(createHashString(clazz)); repid = buf.toString();
public final synchronized RepositoryId_1_3 getId(String key) { RepositoryId_1_3 repId = super.get(key); if (repId != null) return repId; else { // repId = pool.popId().init(key); repId = new RepositoryId_1_3(key); put(key, repId); return repId; } } }
/** * 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) ((ORBUtility.hexOf(str.charAt(i)) << 4) & 0xF0); buffer[j] |= (byte) ((ORBUtility.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(); }
/** * Creates a repository ID for an IDL Java Type. * * @param ser * The IDL Value object to create a repository ID for * @param major * The major version number * @param minor * The minor version number * @exception org.jboss.com.sun.corba.se.impl.io.TypeMismatchException * if ser does not implement the org.omg.CORBA.portable.IDLEntity interface which indicates it is an * IDL Value type. **/ public static String createForIDLType(Class<?> ser, int major, int minor) throws org.jboss.com.sun.corba.se.impl.io.TypeMismatchException { synchronized (classIDLToRepStr) { String repid = (String) classIDLToRepStr.get(ser); if (repid != null) return repid; repid = kIDLPrefix + convertToISOLatin1(ser.getName()).replace('.', '/') + ":" + major + "." + minor; classIDLToRepStr.put(ser, repid); return repid; } }