Package org.apache.ignite.marshaller
Interface MarshallerContext
-
public interface MarshallerContextMarshaller context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description IgnitePredicate<String>classNameFilter()Returns class name filter.ClassgetClass(int typeId, ClassLoader ldr)Gets class for provided type ID.StringgetClassName(byte platformId, int typeId)Gets class name for provided (platformId, typeId) pair.booleanisSystemType(String typeName)Checks whether the given type is a system one - JDK class or Ignite class.JdkMarshallerjdkMarshaller()booleanregisterClassName(byte platformId, int typeId, String clsName)Deprecated.default booleanregisterClassName(byte platformId, int typeId, String clsName, boolean failIfUnregistered)Method to register typeId->class name mapping in marshaller context <b>cluster-wide</b>.booleanregisterClassNameLocally(byte platformId, int typeId, String clsName)Method to register typeId->class name mapping in marshaller context <b>on local node only</b>.
-
-
-
Method Detail
-
registerClassName
default boolean registerClassName(byte platformId, int typeId, String clsName, boolean failIfUnregistered) throws IgniteCheckedExceptionMethod to register typeId->class name mapping in marshaller context <b>cluster-wide</b>. This method guarantees that mapping is delivered to all nodes in cluster and blocks caller thread until then.- Parameters:
platformId- Id of a platform (java, .NET, etc.) to register mapping for.typeId- Type ID.clsName- Class name.failIfUnregistered- Iftruethen throwUnregisteredBinaryTypeExceptionwith registration future instead of synchronously awaiting for its completion.- Returns:
Trueif mapping was registered successfully.- Throws:
IgniteCheckedException- In case of error.
-
registerClassName
@Deprecated boolean registerClassName(byte platformId, int typeId, String clsName) throws IgniteCheckedException
Deprecated.UseregisterClassName(byte, int, java.lang.String, boolean)instead. This particular method will be deleted in future releases.Same asregisterClassName(byte, int, java.lang.String, boolean)but with shortened parameters list.- Parameters:
platformId- ID of a platform (java, .NET, etc.) to register mapping for.typeId- Type ID.clsName- Class name.- Returns:
Trueif mapping was registered successfully.- Throws:
IgniteCheckedException
-
registerClassNameLocally
boolean registerClassNameLocally(byte platformId, int typeId, String clsName) throws IgniteCheckedExceptionMethod to register typeId->class name mapping in marshaller context <b>on local node only</b>. No guarantees that the mapping is presented on other nodes are provided. This method is safe to use if there is another source of mappings like metadata persisted on disk and this source is known to be solid and free of conflicts beforehand.- Parameters:
platformId- Id of a platform (java, .NET, etc.) to register mapping for.typeId- Type id.clsName- Class name.- Returns:
Trueif class mapping was registered successfully.- Throws:
IgniteCheckedException- In case of error.
-
getClass
Class getClass(int typeId, ClassLoader ldr) throws ClassNotFoundException, IgniteCheckedException
Gets class for provided type ID.- Parameters:
typeId- Type ID.ldr- Class loader.- Returns:
- Class.
- Throws:
ClassNotFoundException- If class was not found.IgniteCheckedException- In case of any other error.
-
getClassName
String getClassName(byte platformId, int typeId) throws ClassNotFoundException, IgniteCheckedException
Gets class name for provided (platformId, typeId) pair.- Parameters:
platformId- id of a platform the class was registered for.typeId- Type ID.- Returns:
- Class name
- Throws:
ClassNotFoundException- If class was not found.IgniteCheckedException- In case of any other error.
-
isSystemType
boolean isSystemType(String typeName)
Checks whether the given type is a system one - JDK class or Ignite class.- Parameters:
typeName- Type name.- Returns:
trueif the type is a system one,falseotherwise.
-
classNameFilter
IgnitePredicate<String> classNameFilter()
Returns class name filter.- Returns:
- Class name filter.
-
jdkMarshaller
JdkMarshaller jdkMarshaller()
- Returns:
- JDK marshaller instance.
-
-