當前位置: 首頁>>代碼示例>>Java>>正文


Java Bean.getName方法代碼示例

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

}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:23,代碼來源:BusinessProcessContext.java

示例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;
  }

}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:24,代碼來源:BusinessProcessContext.java

示例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();
		}
	}
}
 
開發者ID:kamaladafrica,項目名稱:axon-cdi,代碼行數:20,代碼來源:AutoConfiguringEventStoreProducer.java

示例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;
  }
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:12,代碼來源:ThreadContext.java


注:本文中的javax.enterprise.inject.spi.Bean.getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。