public class MarshallerContextImpl extends Object implements MarshallerContext
| Constructor and Description |
|---|
MarshallerContextImpl(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.
|
File |
getMarshallerMappingFileStoreDir() |
boolean |
isSystemType(String typeName)
Checks whether the given type is a system one - JDK class or Ignite class.
|
JdkMarshaller |
jdkMarshaller()
Returns JDK marshaller instance.
|
void |
onMappingAccepted(MarshallerMappingItem item) |
void |
onMappingDataReceived(byte platformId,
Map<Integer,MappedName> marshallerMappings) |
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)
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.
|
String |
resolveMissedMapping(byte platformId,
int typeId) |
void |
setMarshallerMappingFileStoreDir(File marshallerMappingFileStoreDir)
Sets custom marshaller mapping files directory.
|
public MarshallerContextImpl(@Nullable
Collection<PluginProvider> plugins,
IgnitePredicate<String> clsFilter)
plugins - Plugins.public ArrayList<Map<Integer,MappedName>> getCachedMappings()
public void onMappingDataReceived(byte platformId,
Map<Integer,MappedName> marshallerMappings)
throws IgniteCheckedException
platformId - Platform id.marshallerMappings - All marshaller mappings for given platformId.IgniteCheckedException - In case of failure to process incoming marshaller mappings.public 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)
throws IgniteCheckedException
registerClassName in interface MarshallerContextplatformId - Id of a platform (java, .NET, etc.) to register mapping for.typeId - Type ID.clsName - Class name.True if mapping was registered successfully.IgniteCheckedException - In case of error.public 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 void onMarshallerProcessorStop()
public Iterator<Map.Entry<Byte,Map<Integer,String>>> currentMappings()
@Nullable public File getMarshallerMappingFileStoreDir()
public void setMarshallerMappingFileStoreDir(@Nullable
File marshallerMappingFileStoreDir)
marshallerMappingFileStoreDir - directory with type name mappings
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018