public abstract class PlatformAbstractService extends Object implements PlatformService, Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected Object |
interceptors
Service call interceptors.
|
protected PlatformContext |
platformCtx
Context.
|
protected long |
ptr
Pointer to deployed service.
|
protected boolean |
srvKeepBinary
Whether to keep objects binary on server if possible.
|
protected Object |
svc
.Net binary service.
|
| Constructor and Description |
|---|
PlatformAbstractService()
Default constructor for serialization.
|
PlatformAbstractService(Object svc,
PlatformContext ctx,
boolean srvKeepBinary,
@Nullable Object interceptors)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels this service.
|
void |
execute()
Starts execution of this service.
|
void |
init()
Pre-initializes service before execution.
|
Object |
invokeMethod(String mthdName,
boolean srvKeepBinary,
boolean deserializeResult,
@Nullable Object[] args,
@Nullable Map<String,Object> callAttrs)
Invokes native service method.
|
long |
pointer()
Gets native pointer.
|
void |
readExternal(ObjectInput in) |
void |
setIgniteInstance(Ignite ignite) |
void |
writeExternal(ObjectOutput out) |
protected Object svc
protected Object interceptors
protected boolean srvKeepBinary
protected transient long ptr
protected transient PlatformContext platformCtx
public PlatformAbstractService()
public PlatformAbstractService(Object svc, PlatformContext ctx, boolean srvKeepBinary, @Nullable @Nullable Object interceptors)
svc - Service.ctx - Context.srvKeepBinary - Whether to keep objects binary on server if possible.interceptors - Service call interceptors.public void init()
throws Exception
Service.execute() is called).init in interface ServiceException - If service initialization failed.ServiceContextResourcepublic void execute()
throws Exception
execute
method and can be cancelled (or undeployed) only by calling any of the cancel methods on
IgniteServices API. Also note that service is not required to exit from execute method until
Service.cancel() method was called.execute in interface ServiceException - If service execution failed. Not that service will still remain deployed, until
IgniteServices.cancel(String) method will be called.ServiceContextResourcepublic void cancel()
cancel methods on IgniteServices API are called.
Note that Ignite cannot guarantee that the service exits from Service.execute()
method whenever cancel() method is called. It is up to the user to
make sure that the service code properly reacts to cancellations.
cancel in interface ServiceServiceContextResourcepublic long pointer()
pointer in interface PlatformServicepublic Object invokeMethod(String mthdName, boolean srvKeepBinary, boolean deserializeResult, @Nullable @Nullable Object[] args, @Nullable @Nullable Map<String,Object> callAttrs) throws IgniteCheckedException
invokeMethod in interface PlatformServicemthdName - Method name.srvKeepBinary - Server keep binary flag.deserializeResult - If true, call service in cross-platform compatible manner.args - Arguments.callAttrs - Service call context attributes.IgniteCheckedException - If failed.@IgniteInstanceResource public void setIgniteInstance(Ignite ignite)
ignite - Ignite instance.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023