public String createForAnyType(Class<?> type) { return RepositoryId_1_3_1.createForAnyType(type); }
public String createForJavaType(Serializable ser) throws TypeMismatchException { return RepositoryId_1_3_1.createForJavaType(ser); }
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_1_3_1.createSequenceRepID(ser); }
buf.append(convertToISOLatin1(clazz.getName())); buf.append(";"); buf.append(createHashString(clazz)); repid = buf.toString();
final void increasePool(int size) { // if (cache.size() <= MAX_CACHE_SIZE) for (int i = size; i > 0; i--) push(new RepositoryId_1_3_1()); /* * // _REVISIT_ This will not work w/out either thread tracing or weak references. I am // betting that thread * tracing almost completely negates benefit of reuse. Until either // 1.2 only inclusion or proof to the * contrary, I'll leave it this way... else { int numToReclaim = cache.size() / 2; Enumeration keys = * cache.keys(); Enumeration elements = cache.elements(); for (int i = numToReclaim; i > 0; i--) { Object key = * keys.nextElement(); Object element = elements.nextElement(); * * push(element); cache.remove(key); } } */ }
/** * 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();
public String createSequenceRepID(Class<?> clazz) { return RepositoryId_1_3_1.createSequenceRepID(clazz); }
buf.append(convertToISOLatin1(clazz.getName())); buf.append(";"); buf.append(createHashString(clazz)); repid = buf.toString();
public final synchronized RepositoryId_1_3_1 getId(String key) { RepositoryId_1_3_1 repId = super.get(key); if (repId != null) return repId; else { // repId = pool.popId().init(key); repId = new RepositoryId_1_3_1(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; } }