本文整理汇总了Java中javax.enterprise.inject.spi.Bean.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Bean.getName方法的具体用法?Java Bean.getName怎么用?Java Bean.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.enterprise.inject.spi.Bean
的用法示例。
在下文中一共展示了Bean.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import javax.enterprise.inject.spi.Bean; //导入方法依赖的package包/类
@Override
public <T> T get(Contextual<T> contextual) {
Bean<T> bean = (Bean<T>) contextual;
String variableName = bean.getName();
BusinessProcess businessProcess = getBusinessProcess();
Object variable = businessProcess.getVariable(variableName);
if (variable != null) {
if (LOGGER.isDebugEnabled()) {
if (businessProcess.isAssociated()) {
LOGGER.debug("Getting instance of bean '{}' from Execution[{}]", variableName, businessProcess.getExecutionId());
} else {
LOGGER.debug("Getting instance of bean '{}' from transient bean store", variableName);
}
}
return (T) variable;
} else {
return null;
}
}
示例2: get
import javax.enterprise.inject.spi.Bean; //导入方法依赖的package包/类
@Override
public <T> T get(Contextual<T> contextual) {
Bean<T> bean = (Bean<T>) contextual;
String variableName = bean.getName();
BusinessProcess businessProcess = getBusinessProcess();
Object variable = businessProcess.getVariable(variableName);
if (variable != null) {
if (logger.isLoggable(Level.FINE)) {
if(businessProcess.isAssociated()) {
logger.fine("Getting instance of bean '" + variableName + "' from Execution[" + businessProcess.getExecutionId() + "].");
} else {
logger.fine("Getting instance of bean '" + variableName + "' from transient bean store");
}
}
return (T) variable;
} else {
return null;
}
}
示例3: registerEventHandlers
import javax.enterprise.inject.spi.Bean; //导入方法依赖的package包/类
private void registerEventHandlers(final X eventStore, final TokenStore tokenStore, Set<Annotation> qualifiers) {
for (HandlerInfo eventHandlerInfo : eventHandlersInfo) {
Bean<?> eventHandlerBean = CdiUtils.getBean(getBeanManager(), eventHandlerInfo.getType(), qualifiers);
if (eventHandlerBean != null) {
/**
SubscribingEventProcessor subscribingEventProcessor = new SubscribingEventProcessor(eventHandlerBean.getName() + "SubscribingEventProcessor",
new SimpleEventHandlerInvoker(CdiUtils.getReference(getBeanManager(), eventHandlerBean, eventHandlerInfo.getType())),
eventStore);
subscribingEventProcessor.start();
*/
TrackingEventProcessor processor = new TrackingEventProcessor(eventHandlerBean.getName() + "Tracking",
new SimpleEventHandlerInvoker(CdiUtils.getReference(getBeanManager(), eventHandlerBean, eventHandlerInfo.getType())),
eventStore,
tokenStore,
NoTransactionManager.instance());
processor.start();
}
}
}
示例4: get
import javax.enterprise.inject.spi.Bean; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public <T> T get(Contextual<T> contextual) {
Bean<T> bean = (Bean<T>) contextual;
String variableName = bean.getName();
Object variable = getBeanStore().getContextualInstance(variableName);
if (variable != null) {
return (T) variable;
} else {
return null;
}
}