public class WorkerCtx extends Object implements Serializable
Constructor and Description |
---|
WorkerCtx()
Creates a new
WorkerCtx instance. |
Modifier and Type | Method and Description |
---|---|
protected <T> BeanFactory<T> |
getBeanfactory(Class<T> clazz)
Return an instance provider of the specified type.
|
<T,K,V> T |
getWorkerBean(Class<T> clazz,
Map<K,V> topoConf)
Return an instance, which is shared (within a Worker), of the specified type.
|
<T,K,V> T |
getWorkerBean(Class<T> clazz,
Map<K,V> topoConf,
boolean force)
Return an instance, which is shared (within a Worker), of the specified type.
|
<T> void |
register(Class<T> clazz,
BeanFactory<T> provider)
Register a bean provider for a specified type.
|
public WorkerCtx()
WorkerCtx
instance.public <T> void register(Class<T> clazz, BeanFactory<T> provider)
protected <T> BeanFactory<T> getBeanfactory(Class<T> clazz)
RuntimeException
- if no bean provider can be resolve for the given classpublic <T,K,V> T getWorkerBean(Class<T> clazz, Map<K,V> topoConf)
public <T,K,V> T getWorkerBean(Class<T> clazz, Map<K,V> topoConf, boolean force)
clazz
- the class of the bean.topoConf
- the storm configurationforce
- if true
= create a new instance even if one already exist.T
.Copyright © 2023 The Apache Software Foundation. All rights reserved.