org.apache.ignite.internal.processors.platform

## Class PlatformAbstractTarget

- java.lang.Object
- - org.apache.ignite.internal.processors.platform.PlatformAbstractTarget

All Implemented Interfaces:
  PlatformTarget

Direct Known Subclasses:
  PlatformAbstractQueryCursor, PlatformAffinity, PlatformAffinityFunctionTarget, PlatformAtomicLong, PlatformAtomicReference, PlatformAtomicSequence, PlatformBinaryProcessor, PlatformCache, PlatformCacheIterator, PlatformClusterGroup, PlatformCompute, PlatformContinuousQueryProxy, PlatformDataStreamer, PlatformEvents, PlatformMessaging, PlatformServices, PlatformTransactions

    public abstract class PlatformAbstractTarget
    extends Object
    implements PlatformTarget

Abstract interop target.

### Field Summary

Fields
`protected static int` `ERROR` Constant: ERROR.
`protected static int` `FALSE` Constant: FALSE.
`protected IgniteLogger` `log` Logger.
`protected PlatformContext` `platformCtx` Context.
`protected static int` `TRUE` Constant: TRUE.

### Constructor Summary

Constructors
`protected` `PlatformAbstractTarget(PlatformContext platformCtx)` Constructor.

### Method Summary

Methods
`Exception` `convertException(Exception e)` Convert caught exception.
`protected IgniteInternalFuture` `currentFuture()` When overridden in a derived class, gets future for the current operation.
`protected PlatformFutureUtils.Writer` `futureWriter(int opId)` When overridden in a derived class, gets a custom future writer.
`long` `inLongOutLong(int type, long val)` Operation accepting long value and returning long value.
`Object` `inObjectStreamOutObjectStream(int type, Object arg, long inMemPtr, long outMemPtr)` Operation accepting an object and a memory stream and returning result to another memory stream and an object.
`long` `inStreamOutLong(int type, long memPtr)` Operation accepting memory stream and returning long value.
`Object` `inStreamOutObject(int type, long memPtr)` Operation accepting memory stream and returning object.
`void` `inStreamOutStream(int type, long inMemPtr, long outMemPtr)` Operation accepting one memory stream and returning result to another memory stream.
`void` `listenFuture(long futId, int typ)` Start listening for the future.
`void` `listenFutureForOperation(long futId, int typ, int opId)` Start listening for the future for specific operation type.
`Object` `outObject(int type)` Operation returning object result.
`void` `outStream(int type, long memPtr)` Operation returning result to memory stream.
`PlatformContext` `platformContext()`
`protected long` `processInLongOutLong(int type, long val)` Process IN operation.
`protected Object` `processInObjectStreamOutObjectStream(int type, Object arg, BinaryRawReaderEx reader, BinaryRawWriterEx writer)` Process IN-OUT operation.
`protected long` `processInStreamOutLong(int type, BinaryRawReaderEx reader)` Process IN operation.
`protected long` `processInStreamOutLong(int type, BinaryRawReaderEx reader, PlatformMemory mem)` Process IN operation.
`protected Object` `processInStreamOutObject(int type, BinaryRawReaderEx reader)` Process IN operation with managed object as result.
`protected void` `processInStreamOutStream(int type, BinaryRawReaderEx reader, BinaryRawWriterEx writer)` Process IN-OUT operation.
`protected Object` `processOutObject(int type)` Process OUT operation.
`protected void` `processOutStream(int type, BinaryRawWriterEx writer)` Process OUT operation.
`protected long` `readAndListenFuture(BinaryRawReader reader)` Reads future information and listens.
`protected PlatformListenable` `readAndListenFuture(BinaryRawReader reader, IgniteFuture fut)` Reads future information and listens.
`protected PlatformListenable` `readAndListenFuture(BinaryRawReader reader, IgniteFuture fut, PlatformFutureUtils.Writer writer)` Reads future information and listens.
`protected PlatformListenable` `readAndListenFuture(BinaryRawReader reader, IgniteInternalFuture fut)` Reads future information and listens.
`protected PlatformListenable` `readAndListenFuture(BinaryRawReader reader, IgniteInternalFuture fut, PlatformFutureUtils.Writer writer)` Reads future information and listens.
`protected <T> T` `throwUnsupported(int type)` Throw an exception rendering unsupported operation type.

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

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

### Field Detail

#### TRUE

    protected static final int TRUE

Constant: TRUE.

See Also:
  Constant Field Values

#### FALSE

    protected static final int FALSE

Constant: FALSE.

See Also:
  Constant Field Values

#### ERROR

    protected static final int ERROR

Constant: ERROR.

See Also:
  Constant Field Values

#### platformCtx

    protected final PlatformContext platformCtx

Context.

#### log

    protected final IgniteLogger log

Logger.

### Constructor Detail

#### PlatformAbstractTarget

    protected PlatformAbstractTarget(PlatformContext platformCtx)

Constructor.

Parameters:
  `platformCtx` - Context.

### Method Detail

#### inLongOutLong

    public long inLongOutLong(int type,
                     long val)
                       throws Exception

Operation accepting long value and returning long value.

Specified by:
  `inLongOutLong` in interface `PlatformTarget`
Parameters:
  `type` - Operation type.
  `val` - Value.
Returns:
  Result.
Throws:
  `Exception` - If case of failure.

#### inStreamOutLong

    public long inStreamOutLong(int type,
                       long memPtr)
                         throws Exception

Operation accepting memory stream and returning long value.

Specified by:
  `inStreamOutLong` in interface `PlatformTarget`
Parameters:
  `type` - Operation type.
  `memPtr` - Memory pointer.
Returns:
  Result.
Throws:
  `Exception` - If case of failure.

#### inStreamOutObject

    public Object inStreamOutObject(int type,
                           long memPtr)
                             throws Exception

Operation accepting memory stream and returning object.

Specified by:
  `inStreamOutObject` in interface `PlatformTarget`
Parameters:
  `type` - Operation type.
  `memPtr` - Memory pointer.
Returns:
  Result.
Throws:
  `Exception` - If case of failure.

#### outStream

    public void outStream(int type,
                 long memPtr)
                   throws Exception

Operation returning result to memory stream.

Specified by:
  `outStream` in interface `PlatformTarget`
Parameters:
  `type` - Operation type.
  `memPtr` - Memory pointer.
Throws:
  `Exception` - In case of failure.

#### outObject

    public Object outObject(int type)
                     throws Exception

Operation returning object result.

Specified by:
  `outObject` in interface `PlatformTarget`
Parameters:
  `type` - Operation type.
Returns:
  Result.
Throws:
  `Exception` - If failed.

#### inStreamOutStream

    public void inStreamOutStream(int type,
                         long inMemPtr,
                         long outMemPtr)
                           throws Exception

Operation accepting one memory stream and returning result to another memory stream.

Specified by:
  `inStreamOutStream` in interface `PlatformTarget`
Parameters:
  `type` - Operation type.
  `inMemPtr` - Input memory pointer.
  `outMemPtr` - Output memory pointer.
Throws:
  `Exception` - In case of failure.

#### inObjectStreamOutObjectStream

    public Object inObjectStreamOutObjectStream(int type,
                                       Object arg,
                                       long inMemPtr,
                                       long outMemPtr)
                                         throws Exception

Operation accepting an object and a memory stream and returning result to another memory stream and an object.

Specified by:
  `inObjectStreamOutObjectStream` in interface `PlatformTarget`
Parameters:
  `type` - Operation type.
  `arg` - Argument (optional).
  `inMemPtr` - Input memory pointer.
  `outMemPtr` - Output memory pointer.
Returns:
  Result.
Throws:
  `Exception` - In case of failure.

#### convertException

    public Exception convertException(Exception e)

Convert caught exception.

Parameters:
  `e` - Exception to convert.
Returns:
  Converted exception.

#### platformContext

    public PlatformContext platformContext()

Returns:
  Context.

#### listenFuture

    public void listenFuture(long futId,
                    int typ)
                      throws Exception

Start listening for the future.

Specified by:
  `listenFuture` in interface `PlatformTarget`
Parameters:
  `futId` - Future ID.
  `typ` - Result type.
Throws:
  `IgniteCheckedException` - In case of failure.
  `Exception`

#### listenFutureForOperation

    public void listenFutureForOperation(long futId,
                                int typ,
                                int opId)
                                  throws Exception

Start listening for the future for specific operation type.

Specified by:
  `listenFutureForOperation` in interface `PlatformTarget`
Parameters:
  `futId` - Future ID.
  `typ` - Result type.
  `opId` - Operation ID required to pick correct result writer.
Throws:
  `IgniteCheckedException` - In case of failure.
  `Exception`

#### currentFuture

    protected IgniteInternalFuture currentFuture()
                                          throws IgniteCheckedException

When overridden in a derived class, gets future for the current operation.

Returns:
  current future.
Throws:
  `IgniteCheckedException` - If failed.

#### futureWriter

    @Nullable
    protected PlatformFutureUtils.Writer futureWriter(int opId)

When overridden in a derived class, gets a custom future writer.

Parameters:
  `opId` - Operation id.
Returns:
  A custom writer for given op id.

#### processInLongOutLong

    protected long processInLongOutLong(int type,
                            long val)
                                 throws IgniteCheckedException

Process IN operation.

Parameters:
  `type` - Type.
  `val` - Value.
Returns:
  Result.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processInStreamOutLong

    protected long processInStreamOutLong(int type,
                              BinaryRawReaderEx reader)
                                   throws IgniteCheckedException

Process IN operation.

Parameters:
  `type` - Type.
  `reader` - Binary reader.
Returns:
  Result.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processInStreamOutLong

    protected long processInStreamOutLong(int type,
                              BinaryRawReaderEx reader,
                              PlatformMemory mem)
                                   throws IgniteCheckedException

Process IN operation.

Parameters:
  `type` - Type.
  `reader` - Binary reader.
Returns:
  Result.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processInStreamOutStream

    protected void processInStreamOutStream(int type,
                                BinaryRawReaderEx reader,
                                BinaryRawWriterEx writer)
                                     throws IgniteCheckedException

Process IN-OUT operation.

Parameters:
  `type` - Type.
  `reader` - Binary reader.
  `writer` - Binary writer.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processInStreamOutObject

    protected Object processInStreamOutObject(int type,
                                  BinaryRawReaderEx reader)
                                       throws IgniteCheckedException

Process IN operation with managed object as result.

Parameters:
  `type` - Type.
  `reader` - Binary reader.
Returns:
  Result.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processInObjectStreamOutObjectStream

    protected Object processInObjectStreamOutObjectStream(int type,
                                              @Nullable
                                              Object arg,
                                              BinaryRawReaderEx reader,
                                              BinaryRawWriterEx writer)
                                                   throws IgniteCheckedException

Process IN-OUT operation.

Parameters:
  `type` - Type.
  `arg` - Argument.
  `reader` - Binary reader.
  `writer` - Binary writer.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processOutStream

    protected void processOutStream(int type,
                        BinaryRawWriterEx writer)
                             throws IgniteCheckedException

Process OUT operation.

Parameters:
  `type` - Type.
  `writer` - Binary writer.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processOutObject

    protected Object processOutObject(int type)
                               throws IgniteCheckedException

Process OUT operation.

Parameters:
  `type` - Type.
Throws:
  `IgniteCheckedException` - In case of exception.

#### throwUnsupported

    protected <T> T throwUnsupported(int type)
                          throws IgniteCheckedException

Throw an exception rendering unsupported operation type.

Parameters:
  `type` - Operation type.
Returns:
  Dummy value which is never returned.
Throws:
  `IgniteCheckedException` - Exception to be thrown.

#### readAndListenFuture

    protected PlatformListenable readAndListenFuture(BinaryRawReader reader,
                                         IgniteInternalFuture fut,
                                         PlatformFutureUtils.Writer writer)
                                              throws IgniteCheckedException

Reads future information and listens.

Parameters:
  `reader` - Reader.
  `fut` - Future.
  `writer` - Writer.
Throws:
  `IgniteCheckedException` - In case of error.

#### readAndListenFuture

    protected PlatformListenable readAndListenFuture(BinaryRawReader reader,
                                         IgniteFuture fut,
                                         PlatformFutureUtils.Writer writer)
                                              throws IgniteCheckedException

Reads future information and listens.

Parameters:
  `reader` - Reader.
  `fut` - Future.
  `writer` - Writer.
Throws:
  `IgniteCheckedException` - In case of error.

#### readAndListenFuture

    protected PlatformListenable readAndListenFuture(BinaryRawReader reader,
                                         IgniteInternalFuture fut)
                                              throws IgniteCheckedException

Reads future information and listens.

Parameters:
  `reader` - Reader.
  `fut` - Future.
Throws:
  `IgniteCheckedException` - In case of error.

#### readAndListenFuture

    protected PlatformListenable readAndListenFuture(BinaryRawReader reader,
                                         IgniteFuture fut)
                                              throws IgniteCheckedException

Reads future information and listens.

Parameters:
  `reader` - Reader.
  `fut` - Future.
Throws:
  `IgniteCheckedException` - In case of error.

#### readAndListenFuture

    protected long readAndListenFuture(BinaryRawReader reader)
                                throws IgniteCheckedException

Reads future information and listens.

Parameters:
  `reader` - Reader.
Throws:
  `IgniteCheckedException` - In case of error.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.8.0
Release Date | : December 5 2016