public class MarshallerContextImpl extends Object implements MarshallerContext
| Constructor and Description |
|---|
MarshallerContextImpl(@Nullable Collection<PluginProvider> plugins,
IgnitePredicate<String> clsFilter)
Initializes context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkHasClassName(String clsName,
ClassLoader ldr,
String fileName) |
IgnitePredicate<String> |
classNameFilter()
Returns class name filter.
|
Iterator<Map.Entry<Byte,Map<Integer,String>>> |
currentMappings()
Method collects current mappings for all platforms.
|
ArrayList<Map<Integer,MappedName>> |
getCachedMappings() |
Class |
getClass(int typeId,
ClassLoader ldr)
Gets class for provided type ID.
|
String |
getClassName(byte platformId,
int typeId)
Gets class name for provided (platformId, typeId) pair.
|
boolean |
initialized() |
boolean |
isSystemType(String typeName)
Checks whether the given type is a system one - JDK class or Ignite class.
|
JdkMarshaller |
jdkMarshaller()
Returns JDK marshaller instance.
|
static File |
mappingFileStoreWorkDir(String igniteWorkDir) |
void |
onMappingAccepted(MarshallerMappingItem item) |
void |
onMappingDataReceived(IgniteLogger log,
List<Map<Integer,MappedName>> mappings) |
MappedName |
onMappingProposed(MarshallerMappingItem item) |
void |
onMarshallerProcessorStarted(GridKernalContext ctx,
MarshallerMappingTransport transport) |
void |
onMarshallerProcessorStop() |
void |
onMissedMappingResolved(MarshallerMappingItem item,
String resolvedClsName) |
boolean |
registerClassName(byte platformId,
int typeId,
String clsName)
Same as
MarshallerContext.registerClassName(byte, int, java.lang.String, boolean) but with shortened
parameters list. |
boolean |
registerClassName(byte platformId,
int typeId,
String clsName,
boolean failIfUnregistered)
Method to register typeId->class name mapping in marshaller context cluster-wide.
|
boolean |
registerClassNameLocally(byte platformId,
int typeId,
String clsName)
Method to register typeId->class name mapping in marshaller context on local node only.
|
static File |
resolveMappingFileStoreWorkDir(String igniteWorkDir) |
String |
resolveMissedMapping(byte platformId,
int typeId) |
static void |
saveMappings(GridKernalContext ctx,
List<Map<Integer,MappedName>> mappings,
File dir) |
void |
setMarshallerMappingFileStoreDir(@Nullable File marshallerMappingFileStoreDir)
Sets custom marshaller mapping files directory.
|
public MarshallerContextImpl(@Nullable
@Nullable Collection<PluginProvider> plugins,
IgnitePredicate<String> clsFilter)
plugins - Plugins.public ArrayList<Map<Integer,MappedName>> getCachedMappings()
public void onMappingDataReceived(IgniteLogger log, List<Map<Integer,MappedName>> mappings)
log - Ignite logger.mappings - All marshaller mappings to write.public static void saveMappings(GridKernalContext ctx, List<Map<Integer,MappedName>> mappings, File dir) throws IgniteCheckedException
ctx - Kernal context.mappings - Marshaller mappings to save.dir - Directory to save given mappings to.IgniteCheckedExceptionpublic void checkHasClassName(String clsName, ClassLoader ldr, String fileName)
clsName - Class name.ldr - Class loader used to get properties file.fileName - File name.public boolean registerClassName(byte platformId,
int typeId,
String clsName,
boolean failIfUnregistered)
throws IgniteCheckedException
registerClassName in interface MarshallerContextplatformId - Id of a platform (java, .NET, etc.) to register mapping for.typeId - Type ID.clsName - Class name.failIfUnregistered - If true then throw UnregisteredBinaryTypeException with
registration future instead of synchronously awaiting for its completion.True if mapping was registered successfully.IgniteCheckedException - In case of error.public boolean registerClassName(byte platformId,
int typeId,
String clsName)
throws IgniteCheckedException
MarshallerContext.registerClassName(byte, int, java.lang.String, boolean) but with shortened
parameters list.registerClassName in interface MarshallerContextIgniteCheckedExceptionpublic boolean registerClassNameLocally(byte platformId,
int typeId,
String clsName)
throws IgniteCheckedException
registerClassNameLocally in interface MarshallerContextplatformId - Id of a platform (java, .NET, etc.) to register mapping for.typeId - Type id.clsName - Class name.True if class mapping was registered successfully.IgniteCheckedException - In case of error.public MappedName onMappingProposed(MarshallerMappingItem item)
item - type mapping to proposemapped name otherwise.public void onMappingAccepted(MarshallerMappingItem item)
item - Item.public Class getClass(int typeId, ClassLoader ldr) throws ClassNotFoundException, IgniteCheckedException
getClass in interface MarshallerContexttypeId - Type ID.ldr - Class loader.ClassNotFoundException - If class was not found.IgniteCheckedException - In case of any other error.public String getClassName(byte platformId, int typeId) throws ClassNotFoundException, IgniteCheckedException
getClassName in interface MarshallerContextplatformId - id of a platform the class was registered for.typeId - Type ID.ClassNotFoundException - If class was not found.IgniteCheckedException - In case of any other error.public IgnitePredicate<String> classNameFilter()
classNameFilter in interface MarshallerContextpublic JdkMarshaller jdkMarshaller()
jdkMarshaller in interface MarshallerContextpublic String resolveMissedMapping(byte platformId, int typeId)
platformId - Platform id.typeId - Type id.public void onMissedMappingResolved(MarshallerMappingItem item, String resolvedClsName)
item - Item.resolvedClsName - Resolved class name.public boolean isSystemType(String typeName)
isSystemType in interface MarshallerContexttypeName - Type name.true if the type is a system one, false otherwise.public void onMarshallerProcessorStarted(GridKernalContext ctx, MarshallerMappingTransport transport) throws IgniteCheckedException
ctx - Context.transport - Transport.IgniteCheckedExceptionpublic static File resolveMappingFileStoreWorkDir(String igniteWorkDir)
igniteWorkDir - Base ignite working directory.public static File mappingFileStoreWorkDir(String igniteWorkDir)
igniteWorkDir - Base ignite working directory.public void onMarshallerProcessorStop()
public Iterator<Map.Entry<Byte,Map<Integer,String>>> currentMappings()
public boolean initialized()
True if marshaller context is initialized.public void setMarshallerMappingFileStoreDir(@Nullable
@Nullable File marshallerMappingFileStoreDir)
marshallerMappingFileStoreDir - directory with type name mappings
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021