/** {@inheritDoc} */ @Nullable @Override public BinaryType metadata(int typeId) throws BinaryObjectException { BinaryType metadata = super.metadata(typeId); if (listeners != null) { for (TestBinaryContextListener listener : listeners) listener.onAfterMetadataRequest(typeId, metadata); } return metadata; }
/** {@inheritDoc} */ @Override public BinaryType type(int typeId) { return marsh.context().metadata(typeId); }
/** {@inheritDoc} */ @Override public Collection<BinaryType> types() { return marsh.context().metadata(); }
/** * Create binary type which is used by users. * * @param ctx Context. * @param obj Binary object. * @return Binary type. */ public static BinaryType type(BinaryContext ctx, BinaryObjectEx obj) { if (ctx == null) throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(obj.typeId()); }
/** * @return Target type. */ private BinaryType target() { if (target == null) { synchronized (this) { if (target == null) { if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID && clsName != null) typeId = ctx.typeId(clsName); target = ctx.metadata(typeId); if (target == null) throw new BinaryObjectException("Failed to get binary type details [typeId=" + typeId + ']'); } } } return target; }
/** {@inheritDoc} */ @Override public BinaryType registerEnum(String typeName, Map<String, Integer> vals) { if (typeName == null || typeName.isEmpty()) throw new IllegalArgumentException("typeName"); BinaryContext ctx = marsh.context(); int typeId = ctx.typeId(typeName); ctx.updateMetadata(typeId, new BinaryMetadata(typeId, typeName, null, null, null, true, vals), false); return ctx.metadata(typeId); } }
/** {@inheritDoc} */ @Override public BinaryType registerEnum(String typeName, Map<String, Integer> vals) throws BinaryObjectException { A.notNullOrEmpty(typeName, "enum type name"); int typeId = binaryCtx.typeId(typeName); typeName = binaryCtx.userTypeName(typeName); BinaryUtils.validateEnumValues(typeName, vals); updateMetadata(typeId, typeName, null, null, true, vals); return binaryCtx.metadata(typeId); }
BinaryTypeImpl type = (BinaryTypeImpl) ctx.metadata(typeId, schemaId);
BinaryType meta = ctx.metadata(typeId);
/** {@inheritDoc} */ @Override public BinaryType type(int typeId) { return marsh.context().metadata(typeId); }
/** {@inheritDoc} */ @Override public Collection<BinaryType> types() { return marsh.context().metadata(); }
/** * Create binary type which is used by users. * * @param ctx Context. * @param obj Binary object. * @return Binary type. */ public static BinaryType type(BinaryContext ctx, BinaryObjectEx obj) { if (ctx == null) throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(obj.typeId()); }
/** {@inheritDoc} */ @Override public BinaryType registerEnum(String typeName, Map<String, Integer> vals) { if (typeName == null || typeName.isEmpty()) throw new IllegalArgumentException("typeName"); BinaryContext ctx = marsh.context(); int typeId = ctx.typeId(typeName); ctx.updateMetadata(typeId, new BinaryMetadata(typeId, typeName, null, null, null, true, vals), false); return ctx.metadata(typeId); } }
/** * @return Target type. */ private BinaryType target() { if (target == null) { synchronized (this) { if (target == null) { if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID && clsName != null) typeId = ctx.typeId(clsName); target = ctx.metadata(typeId); if (target == null) throw new BinaryObjectException("Failed to get binary type details [typeId=" + typeId + ']'); } } } return target; }
/** {@inheritDoc} */ @Override public BinaryType registerEnum(String typeName, Map<String, Integer> vals) throws BinaryObjectException { A.notNullOrEmpty(typeName, "enum type name"); int typeId = binaryCtx.typeId(typeName); typeName = binaryCtx.userTypeName(typeName); BinaryUtils.validateEnumValues(typeName, vals); updateMetadata(typeId, typeName, null, null, true, vals); return binaryCtx.metadata(typeId); }
BinaryTypeImpl type = (BinaryTypeImpl) ctx.metadata(typeId, schemaId);
BinaryType meta = ctx.metadata(typeId);