public abstract class PlatformAbstractService extends Object implements PlatformService, Externalizable
| Modifier and Type | Field and Description |
|---|---|
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)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(ServiceContext ctx)
Cancels this service.
|
void |
execute(ServiceContext ctx)
Starts execution of this service.
|
void |
init(ServiceContext ctx)
Pre-initializes service before execution.
|
Object |
invokeMethod(String mthdName,
boolean srvKeepBinary,
boolean deserializeResult,
Object[] args)
Invokes native service method.
|
Object |
invokeMethod(String mthdName,
boolean srvKeepBinary,
Object[] args)
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 boolean srvKeepBinary
protected transient long ptr
protected transient PlatformContext platformCtx
public PlatformAbstractService()
public PlatformAbstractService(Object svc, PlatformContext ctx, boolean srvKeepBinary)
svc - Service.ctx - Context.srvKeepBinary - Whether to keep objects binary on server if possible.public void init(ServiceContext ctx) throws Exception
Service.execute(ServiceContext) is called).public void execute(ServiceContext ctx) 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(ServiceContext) method was called.execute in interface Servicectx - Service execution context.Exception - If service execution failed. Not that service will still remain deployed, until
IgniteServices.cancel(String) method will be called.public void cancel(ServiceContext ctx)
cancel methods on IgniteServices API are called.
Note that Ignite cannot guarantee that the service exits from Service.execute(ServiceContext)
method whenever cancel(ServiceContext) method is called. It is up to the user to
make sure that the service code properly reacts to cancellations.
public long pointer()
pointer in interface PlatformServicepublic Object invokeMethod(String mthdName, boolean srvKeepBinary, Object[] args) throws IgniteCheckedException
invokeMethod in interface PlatformServicemthdName - Method name.srvKeepBinary - Server keep binary flag.args - Arguments.IgniteCheckedException - If failed.public Object invokeMethod(String mthdName, boolean srvKeepBinary, boolean deserializeResult, Object[] args) 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.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.11.0 Release Date : September 11 2021