Search in sources :

Example 1 with MarshallerContext

use of org.apache.ignite.marshaller.MarshallerContext in project ignite by apache.

the class GridCacheEntryMemorySizeSelfTest method createMarshaller.

/**
     * Creates an instance of Marshaller that is used by caches during the test run.
     *
     * @return Marshaller.
     */
protected Marshaller createMarshaller() throws IgniteCheckedException {
    Marshaller marsh = createStandaloneBinaryMarshaller();
    marsh.setContext(new MarshallerContext() {

        @Override
        public boolean registerClassName(byte platformId, int typeId, String clsName) {
            return true;
        }

        @Override
        public Class getClass(int typeId, ClassLoader ldr) {
            throw new UnsupportedOperationException();
        }

        @Override
        public String getClassName(byte platformId, int typeId) {
            throw new UnsupportedOperationException();
        }

        @Override
        public boolean isSystemType(String typeName) {
            return false;
        }
    });
    return marsh;
}
Also used : OptimizedMarshaller(org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller) Marshaller(org.apache.ignite.marshaller.Marshaller) MarshallerContext(org.apache.ignite.marshaller.MarshallerContext)

Aggregations

OptimizedMarshaller (org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller)1 Marshaller (org.apache.ignite.marshaller.Marshaller)1 MarshallerContext (org.apache.ignite.marshaller.MarshallerContext)1