本文整理匯總了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;
}
}