public class GridResourceProcessor extends GridProcessorAdapter
ctx, log| Constructor and Description |
|---|
GridResourceProcessor(GridKernalContext ctx)
Creates resources processor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup(GridLifecycleBean lifecycleBean)
Cleans up resources from given lifecycle beans.
|
void |
cleanup(GridSpi spi)
Cleans up resources from given SPI implementation.
|
void |
cleanupGeneric(Object obj) |
Collection<Method> |
getMethodsWithAnnotation(GridDeployment dep,
Class<?> rsrcCls,
Class<? extends Annotation> annCls)
Gets list of methods in specified class annotated with specified annotation.
|
void |
inject(GridDeployment dep,
Class<?> taskCls,
GridComputeJob job,
GridComputeTaskSession ses,
GridJobContextImpl jobCtx)
Injects held resources into given
job. |
void |
inject(GridDeployment dep,
Class<?> depCls,
Object target)
Injects resources into generic class.
|
void |
inject(GridDeployment dep,
GridComputeTask<?,?> task,
GridTaskSessionImpl ses,
GridComputeLoadBalancer balancer,
GridComputeTaskContinuousMapper mapper)
Injects held resources into given grid task.
|
void |
inject(GridLifecycleBean lifecycleBean)
Injects held resources into given lifecycle bean.
|
void |
inject(GridSpi spi)
Injects held resources into given SPI implementation.
|
void |
injectBasicResource(Object target,
Class<? extends Annotation> annCls,
Object rsrc)
This method is declared public as it is used from tests as well.
|
void |
injectBasicResource(Object target,
Class<? extends Annotation> annCls,
Object rsrc,
GridDeployment dep,
Class<?> depCls)
This method is declared public as it is used from tests as well.
|
void |
injectCacheName(Object obj,
String cacheName)
Injects cache name into given object.
|
void |
injectGeneric(Object obj) |
void |
invokeAnnotated(GridDeployment dep,
Object target,
Class<? extends Annotation> annCls) |
boolean |
isAnnotationPresent(GridDeployment dep,
Object target,
Class<? extends Annotation> annCls)
Checks if annotation presents in specified object.
|
void |
onUndeployed(GridDeployment dep)
Callback to be called when class loader is undeployed.
|
void |
printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.).
|
void |
setSpringContext(GridSpringResourceContext rsrcCtx)
Sets Spring resource context.
|
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
addAttributes, assertParameter, collectDiscoveryData, onDiscoveryDataReceived, onKernalStart, onKernalStop, toString, validateNodepublic GridResourceProcessor(GridKernalContext ctx)
ctx - Kernal context.public void start()
throws GridException
start in interface GridComponentstart in class GridProcessorAdapterGridException - Throws in case of any errors.public void stop(boolean cancel)
stop in interface GridComponentstop in class GridProcessorAdaptercancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.public void setSpringContext(@Nullable GridSpringResourceContext rsrcCtx)
rsrcCtx - Spring resource context.public void onUndeployed(GridDeployment dep)
dep - Deployment to release resources for.public void invokeAnnotated(GridDeployment dep, Object target, Class<? extends Annotation> annCls) throws GridException
dep - Deployment.target - Target object.annCls - Annotation class.GridException - If failed to execute annotated methods.public void inject(GridDeployment dep, Class<?> depCls, Object target) throws GridException
dep - Deployment.depCls - Deployed class.target - Target instance to inject into.GridException - Thrown in case of any errors.public void injectCacheName(Object obj, String cacheName) throws GridException
obj - Object.cacheName - Cache name to inject.GridException - If failed to inject.public void injectGeneric(Object obj) throws GridException
obj - Object to inject.GridException - If failed to inject.public void cleanupGeneric(Object obj) throws GridException
obj - Object.GridException - If failed.public void inject(GridDeployment dep, Class<?> taskCls, GridComputeJob job, GridComputeTaskSession ses, GridJobContextImpl jobCtx) throws GridException
job.dep - Deployment.taskCls - Task class.job - Grid job to inject resources to.ses - Current task session.jobCtx - Job context.GridException - Thrown in case of any errors.public void inject(GridDeployment dep, GridComputeTask<?,?> task, GridTaskSessionImpl ses, GridComputeLoadBalancer balancer, GridComputeTaskContinuousMapper mapper) throws GridException
dep - Deployed class.task - Grid task.ses - Grid task session.balancer - Load balancer.mapper - Continuous task mapper.GridException - Thrown in case of any errors.public boolean isAnnotationPresent(GridDeployment dep, Object target, Class<? extends Annotation> annCls)
dep - Class deployment.target - Object to check.annCls - Annotation to find.true if annotation is presented, false otherwise.public void inject(GridSpi spi) throws GridException
spi - SPI implementation.GridException - Throw in case of any errors.public void cleanup(GridSpi spi) throws GridException
nulls into SPI implementation.spi - SPI implementation.GridException - Thrown in case of any errors.public void inject(GridLifecycleBean lifecycleBean) throws GridException
lifecycleBean - Lifecycle bean.GridException - Thrown in case of any errors.public void cleanup(GridLifecycleBean lifecycleBean) throws GridException
nulls into lifecycle bean.lifecycleBean - Lifecycle bean.GridException - Thrown in case of any errors.public void injectBasicResource(Object target, Class<? extends Annotation> annCls, Object rsrc, GridDeployment dep, Class<?> depCls) throws GridException
unwrapTarget(Object)).target - Target object.annCls - Setter annotation.rsrc - Resource to inject.dep - Deployment.depCls - Deployed class.GridException - If injection failed.public void injectBasicResource(Object target, Class<? extends Annotation> annCls, Object rsrc) throws GridException
unwrapTarget(Object)).target - Target object.annCls - Setter annotation.rsrc - Resource to inject.GridException - If injection failed.@Nullable public Collection<Method> getMethodsWithAnnotation(GridDeployment dep, Class<?> rsrcCls, Class<? extends Annotation> annCls)
dep - Class deployment.rsrcCls - Class to find methods in.annCls - Annotation to find annotated methods with.public void printMemoryStats()
printMemoryStats in interface GridComponentprintMemoryStats in class GridProcessorAdapterCopyright © 2014. All rights reserved.