public InterfaceRepository(ORB orb, POA poa, String name) { this.orb = orb; this.poa = poa; impl = new RepositoryImpl(orb, poa, name); // TypeCodes for primitive types final HashMap<Class<?>, TypeCode> primitiveTypeCodeMap = new HashMap<Class<?>, TypeCode>(); primitiveTypeCodeMap.put(Void.TYPE, orb.get_primitive_tc(TCKind.tk_void)); primitiveTypeCodeMap.put(Boolean.TYPE, orb.get_primitive_tc(TCKind.tk_boolean)); primitiveTypeCodeMap.put(Character.TYPE, orb.get_primitive_tc(TCKind.tk_wchar)); primitiveTypeCodeMap.put(Byte.TYPE, orb.get_primitive_tc(TCKind.tk_octet)); primitiveTypeCodeMap.put(Short.TYPE, orb.get_primitive_tc(TCKind.tk_short)); primitiveTypeCodeMap.put(Integer.TYPE, orb.get_primitive_tc(TCKind.tk_long)); primitiveTypeCodeMap.put(Long.TYPE, orb.get_primitive_tc(TCKind.tk_longlong)); primitiveTypeCodeMap.put(Float.TYPE, orb.get_primitive_tc(TCKind.tk_float)); primitiveTypeCodeMap.put(Double.TYPE, orb.get_primitive_tc(TCKind.tk_double)); this.typeCodeMap = primitiveTypeCodeMap; final HashMap<Class<?>, TypeCode> typeCodes = new HashMap<Class<?>, TypeCode>(primitiveTypeCodeMap); typeCodes.put(String.class, orb.create_wstring_tc(0)); constantTypeCodeMap = typeCodes; }
LocalContained _lookup_id(java.lang.String search_id) { // mapping of arrays are special if (search_id.startsWith("RMI:[")) return (ValueBoxDefImpl) sequenceIdMap.get(search_id); // convert id String name = scopedName(search_id); // look it up if converted id not null //return (name == null) ? null : _lookup(name); LocalContained ret = (name == null) ? null : _lookup(name); return ret; }
public Contained lookup_id(java.lang.String search_id) { LocalContained c = _lookup_id(search_id); if (c == null) return null; return ContainedHelper.narrow(c.getReference()); }
public void shutdown() { // shutdown all anonymous IR objects in this IR for (long i = 1; i < nextPOAId; i++) { try { getPOA().deactivate_object(getAnonymousObjectId(i)); } catch (org.omg.CORBA.UserException ex) { IIOPLogger.ROOT_LOGGER.warnCouldNotDeactivateAnonIRObject(ex); } } // shutdown this IR's top-level container super.shutdown(); }
/** * Return the LocalIDLType for the given TypeCode. */ static LocalIDLType getIDLType(TypeCode typeCode, RepositoryImpl repository) { TCKind tcKind = typeCode.kind(); if (PrimitiveDefImpl.isPrimitiveTCKind(tcKind)) return new PrimitiveDefImpl(typeCode, repository); if (tcKind == TCKind.tk_sequence) return repository.getSequenceImpl(typeCode); if (tcKind == TCKind.tk_value || tcKind == TCKind.tk_value_box || tcKind == TCKind.tk_alias || tcKind == TCKind.tk_struct || tcKind == TCKind.tk_union || tcKind == TCKind.tk_enum || tcKind == TCKind.tk_objref) { try { return (LocalIDLType) repository._lookup_id(typeCode.id()); } catch (BadKind ex) { throw IIOPLogger.ROOT_LOGGER.badKindForTypeCode(tcKind.value()); } } throw IIOPLogger.ROOT_LOGGER.badKindForTypeCode(tcKind.value()); }
/** * Return a CORBA reference to this IR. */ public Repository getReference() { return RepositoryHelper.narrow(impl.getReference()); }
/** * Return the POA object ID of this IR object. * Contained objects use the UTF-8 encoding of their id, prefixed by * "repository_name:". */ protected byte[] getObjectId() { return (getRepository().getObjectIdPrefix() + id).getBytes(StandardCharsets.UTF_8); } }
/** * Finish the build. */ public void finishBuild() throws IRConstructionException { impl.allDone(); }
/** * The next "anonymous" POA object ID. * While contained IR objects can generate a sensible ID from their * repository ID, non-contained objects use this method to get an * ID that is unique within the IR. */ protected byte[] getNextObjectId() { return getAnonymousObjectId(nextPOAId++); }
/** * Return the POA object ID of this IR object. * We delegate to the IR to get a serial number ID. */ protected byte[] getObjectId() { return repository.getNextObjectId(); }
public LocalContained _lookup(String search_name) { if (search_name.startsWith("::")) return delegateFor.getRepository()._lookup(search_name.substring(2)); int idx = search_name.indexOf("::"); if (idx > 0) { String first = search_name.substring(0, idx); Object o = contMap.get(first); if (o == null || !(o instanceof LocalContainer)) return null; else { LocalContainer next = (LocalContainer) o; String rest = search_name.substring(idx + 2); return next._lookup(rest); } } else return (LocalContained) contMap.get(search_name); }
public void shutdown() { // shutdown all anonymous IR objects in this IR for (long i = 1; i < nextPOAId; i++) { try { getPOA().deactivate_object(getAnonymousObjectId(i)); } catch (org.omg.CORBA.UserException ex) { IIOPLogger.ROOT_LOGGER.warnCouldNotDeactivateAnonIRObject(ex); } } // shutdown this IR's top-level container super.shutdown(); }
/** * Return the LocalIDLType for the given TypeCode. */ static LocalIDLType getIDLType(TypeCode typeCode, RepositoryImpl repository) { TCKind tcKind = typeCode.kind(); if (PrimitiveDefImpl.isPrimitiveTCKind(tcKind)) return new PrimitiveDefImpl(typeCode, repository); if (tcKind == TCKind.tk_sequence) return repository.getSequenceImpl(typeCode); if (tcKind == TCKind.tk_value || tcKind == TCKind.tk_value_box || tcKind == TCKind.tk_alias || tcKind == TCKind.tk_struct || tcKind == TCKind.tk_union || tcKind == TCKind.tk_enum || tcKind == TCKind.tk_objref) { try { return (LocalIDLType) repository._lookup_id(typeCode.id()); } catch (BadKind ex) { throw IIOPLogger.ROOT_LOGGER.badKindForTypeCode(tcKind.value()); } } throw IIOPLogger.ROOT_LOGGER.badKindForTypeCode(tcKind.value()); }
public Repository containing_repository() { return RepositoryHelper.narrow(repository.getReference()); }
/** * Return the POA object ID of this IR object. * Contained objects use the UTF-8 encoding of their id, prefixed by * "repository_name:". */ protected byte[] getObjectId() { return (getRepository().getObjectIdPrefix() + id).getBytes(StandardCharsets.UTF_8); } }
/** * Finish the build. */ public void finishBuild() throws IRConstructionException { impl.allDone(); }
/** * The next "anonymous" POA object ID. * While contained IR objects can generate a sensible ID from their * repository ID, non-contained objects use this method to get an * ID that is unique within the IR. */ protected byte[] getNextObjectId() { return getAnonymousObjectId(nextPOAId++); }
/** * Return the POA object ID of this IR object. * We delegate to the IR to get a serial number ID. */ protected byte[] getObjectId() { return repository.getNextObjectId(); }
public LocalContained _lookup(String search_name) { if (search_name.startsWith("::")) return delegateFor.getRepository()._lookup(search_name.substring(2)); int idx = search_name.indexOf("::"); if (idx > 0) { String first = search_name.substring(0, idx); Object o = contMap.get(first); if (o == null || !(o instanceof LocalContainer)) return null; else { LocalContainer next = (LocalContainer) o; String rest = search_name.substring(idx + 2); return next._lookup(rest); } } else return (LocalContained) contMap.get(search_name); }
public void shutdown() { // shutdown all anonymous IR objects in this IR for (long i = 1; i < nextPOAId; i++) { try { getPOA().deactivate_object(getAnonymousObjectId(i)); } catch (org.omg.CORBA.UserException ex) { IIOPLogger.ROOT_LOGGER.warnCouldNotDeactivateAnonIRObject(ex); } } // shutdown this IR's top-level container super.shutdown(); }