org.apache.ignite.internal

## Class MarshallerContextAdapter

- java.lang.Object
- - org.apache.ignite.internal.MarshallerContextAdapter

All Implemented Interfaces:
  MarshallerContext

Direct Known Subclasses:
  MarshallerContextImpl

    public abstract class MarshallerContextAdapter
    extends Object
    implements MarshallerContext

Marshaller context adapter.

### Constructor Summary

Constructors
Constructor and Description
`MarshallerContextAdapter(List<PluginProvider> plugins)` Initializes context.

### Method Summary

Methods
`void` `checkHasClassName(String clsName, ClassLoader ldr, String fileName)`
`protected abstract String` `className(int id)` Gets class name by type ID.
`Class` `getClass(int id, ClassLoader ldr)` Gets class for provided type ID.
`boolean` `isSystemType(String typeName)` Checks whether the given type is a system one - JDK class or Ignite class.
`boolean` `registerClass(int id, Class cls)` Registers class with provided type ID.
`protected abstract boolean` `registerClassName(int id, String clsName)` Registers class name.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MarshallerContextAdapter

    public MarshallerContextAdapter(@Nullable
                            List<PluginProvider> plugins)

Initializes context.

Parameters:
  `plugins` - Plugins.

### Method Detail

#### checkHasClassName

    public void checkHasClassName(String clsName,
                         ClassLoader ldr,
                         String fileName)

Parameters:
  `clsName` - Class name.
  `ldr` - Class loader used to get properties file.
  `fileName` - File name.

#### registerClass

    public boolean registerClass(int id,
                        Class cls)
                          throws IgniteCheckedException

Registers class with provided type ID.

Specified by:
  `registerClass` in interface `MarshallerContext`
Parameters:
  `id` - Type ID.
  `cls` - Class.
Returns:
  Whether class was registered.
Throws:
  `IgniteCheckedException` - In case of error.

#### getClass

    public Class getClass(int id,
                 ClassLoader ldr)
                   throws ClassNotFoundException,
                          IgniteCheckedException

Gets class for provided type ID.

Specified by:
  `getClass` in interface `MarshallerContext`
Parameters:
  `id` - Type ID.
  `ldr` - Class loader.
Returns:
  Class.
Throws:
  `ClassNotFoundException` - If class was not found.
  `IgniteCheckedException` - In case of any other error.

#### isSystemType

    public boolean isSystemType(String typeName)

Checks whether the given type is a system one - JDK class or Ignite class.

Specified by:
  `isSystemType` in interface `MarshallerContext`
Parameters:
  `typeName` - Type name.
Returns:
  `true` if the type is a system one, `false` otherwise.

#### registerClassName

    protected abstract boolean registerClassName(int id,
                            String clsName)
                                          throws IgniteCheckedException

Registers class name.

Parameters:
  `id` - Type ID.
  `clsName` - Class name.
Returns:
  Whether class name was registered.
Throws:
  `IgniteCheckedException` - In case of error.

#### className

    protected abstract String className(int id)
                                 throws IgniteCheckedException

Gets class name by type ID.

Parameters:
  `id` - Type ID.
Returns:
  Class name.
Throws:
  `IgniteCheckedException` - In case of error.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.9.0
Release Date | : March 2 2017