Java 类javax.annotation.Resource 实例源码

项目:incubator-netbeans    文件:PersistenceTestCase.java   
@Override
protected void setUp() throws Exception {
    super.setUp();
    URL persistenceProviderUrl = FileUtil.getArchiveRoot(PersistenceProvider.class.getProtectionDomain().getCodeSource().getLocation());
    ProtectionDomain domain = Resource.class.getProtectionDomain();
    System.out.println("Protection domain: " + domain);
    CodeSource source = domain.getCodeSource();
    System.out.println("Code source: " + source);
    if (source != null) {
        URL location = source.getLocation();
        System.out.println("Location: " + location);
        URL resourceUrl = FileUtil.getArchiveRoot(location);
        addCompileRoots(Arrays.asList(persistenceProviderUrl, resourceUrl));
    } else {
        addCompileRoots(Arrays.asList(persistenceProviderUrl));
    }
}
项目:testee.fi    文件:TopicResourceProvider.java   
@Override
public Object resolve(final InjectionPoint injectionPoint) {
    final Resource annotation = injectionPoint.getAnnotated().getAnnotation(Resource.class);
    if (null == annotation) {
        return null;
    }
    if (Topic.class != injectionPoint.getType()) {
        return null;
    }
    return new TestEEfiTopic(annotation.mappedName());
}
项目:testee.fi    文件:ManualResourceProviderBuilder.java   
@Override
public Object resolve(final InjectionPoint injectionPoint) {
    if (injectionPoint.getAnnotated().getAnnotation(Resource.class) == null) {
        return null;
    }
    return resources.get(injectionPoint.getAnnotated().getAnnotation(Resource.class).mappedName());
}
项目:lazycat    文件:WebAnnotationSet.java   
protected static void loadFieldsAnnotation(Context context, Class<?> classClass) {
    // Initialize the annotations
    Field[] fields = Introspection.getDeclaredFields(classClass);
    if (fields != null && fields.length > 0) {
        for (Field field : fields) {
            Resource annotation = field.getAnnotation(Resource.class);
            if (annotation != null) {
                String defaultName = classClass.getName() + SEPARATOR + field.getName();
                Class<?> defaultType = field.getType();
                addResource(context, annotation, defaultName, defaultType);
            }
        }
    }
}
项目:esup-ecandidat    文件:MainUI.java   
/**Ajout d'un menu d'item avec ou sans sous menu
 * @param caption le libelle
 * @param viewName la vue rattachee
 * @param icon l'icon du menu
 * @param itemMenu l'item menu rattache
 * @param mapSubMenu un eventuel sous-menu
 */
private void addItemMenu(String caption, String viewName, com.vaadin.server.Resource icon, LinkedList<SubMenu> subMenus, AccordionItemMenu itemMenu) {
    OneClickButton itemBtn = new OneClickButton(caption, icon);
    Menu menu = new Menu(viewName,subMenus,itemBtn);
    itemBtn.setPrimaryStyleName(ValoTheme.MENU_ITEM);
    /*Pas de sous menu*/
    if (subMenus==null){
        itemBtn.addClickListener(e -> {
            navigateToView(viewName);
        });
        viewButtons.put(viewName, menu);
        if (itemMenu!=null){
            viewAccordion.put(viewName, (String)itemMenu.getData());
        }
    }
    /*Des sous menu, on associe le bouton du menu à chaque vue de sous menu*/
    else{
        subMenus.forEach(e -> {
            viewButtons.put(e.getVue(), menu);
            if (itemMenu!=null){
                viewAccordion.put(e.getVue(), (String)itemMenu.getData());
            }
        });
        itemBtn.addClickListener(e -> {
            navigateToView(subMenus.getFirst().getVue());
        });

    }
    if (itemMenu==null){
        menuButtonLayout.addComponent(itemBtn);
    }else{
        itemMenu.addButton(itemBtn);            
    }

}
项目:jvm-sandbox    文件:DefaultProviderManager.java   
private void injectResource(final Object provider) throws IllegalAccessException {
    final Field[] resourceFieldArray = FieldUtils.getFieldsWithAnnotation(provider.getClass(), Resource.class);
    if (ArrayUtils.isEmpty(resourceFieldArray)) {
        return;
    }
    for (final Field resourceField : resourceFieldArray) {
        final Class<?> fieldType = resourceField.getType();
        // ConfigInfo注入
        if (ConfigInfo.class.isAssignableFrom(fieldType)) {
            final ConfigInfo configInfo = new DefaultConfigInfo(cfg);
            FieldUtils.writeField(resourceField, provider, configInfo, true);
        }
    }
}
项目:lemon    文件:AccountLogService.java   
@Resource
public void setAccountLockService(AccountLockService accountLockService) {
    this.accountLockService = accountLockService;
}
项目:lemon    文件:AccountInfoController.java   
@Resource
public void setAccountInfoManager(AccountInfoManager accountInfoManager) {
    this.accountInfoManager = accountInfoManager;
}
项目:lemon    文件:AuthService.java   
@Resource
public void setAccessManager(AccessManager accessManager) {
    this.accessManager = accessManager;
}
项目:lemon    文件:IndexController.java   
@Resource
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
    this.jdbcTemplate = jdbcTemplate;
}
项目:lemon    文件:BpmConfCountersignController.java   
@Resource
public void setBpmConfNodeManager(BpmConfNodeManager bpmConfNodeManager) {
    this.bpmConfNodeManager = bpmConfNodeManager;
}
项目:lemon    文件:TaskInfoController.java   
@Resource
public void setExportor(Exportor exportor) {
    this.exportor = exportor;
}
项目:lemon    文件:AccountLogConsumer.java   
@Resource
public void setAccountLogService(AccountLogService accountLogService) {
    this.accountLogService = accountLogService;
}
项目:lemon    文件:BpmConfAssignController.java   
@Resource
public void setTaskDefinitionConnector(
        TaskDefinitionConnector taskDefinitionConnector) {
    this.taskDefinitionConnector = taskDefinitionConnector;
}
项目:lemon    文件:BpmConfCountersignController.java   
@Resource
public void setTaskDefinitionConnector(
        TaskDefinitionConnector taskDefinitionConnector) {
    this.taskDefinitionConnector = taskDefinitionConnector;
}
项目:lemon    文件:SpecialAuthenticationHandler.java   
@Resource
public void setAccountInfoManager(AccountInfoManager accountInfoManager) {
    this.accountInfoManager = accountInfoManager;
}
项目:lemon    文件:PartyStructController.java   
@Resource
public void setPartyEntityManager(PartyEntityManager partyEntityManager) {
    this.partyEntityManager = partyEntityManager;
}
项目:lemon    文件:WorkCalendarService.java   
@Resource
public void setWorkcalRuleManager(WorkcalRuleManager workcalRuleManager) {
    this.workcalRuleManager = workcalRuleManager;
}
项目:lemon    文件:PartyStructController.java   
@Resource
public void setMessageHelper(MessageHelper messageHelper) {
    this.messageHelper = messageHelper;
}
项目:lemon    文件:MeetingRoomController.java   
@Resource
public void setTenantHolder(TenantHolder tenantHolder) {
    this.tenantHolder = tenantHolder;
}
项目:lemon    文件:FormTemplateController.java   
@Resource
public void setTenantHolder(TenantHolder tenantHolder) {
    this.tenantHolder = tenantHolder;
}
项目:lemon    文件:TemporaryPasswordGeneratorImpl.java   
@Resource
public void setAccountInfoManager(AccountInfoManager accountInfoManager) {
    this.accountInfoManager = accountInfoManager;
}
项目:lemon    文件:HumanTaskConnectorImpl.java   
@Resource
public void setTaskInfoManager(TaskInfoManager taskInfoManager) {
    this.taskInfoManager = taskInfoManager;
}
项目:lemon    文件:PlmKanbanResource.java   
@Resource
public void setUserConnector(UserConnector userConnector) {
    this.userConnector = userConnector;
}
项目:lemon    文件:BpmConfNoticeController.java   
@Resource
public void setTaskDefinitionConnector(
        TaskDefinitionConnector taskDefinitionConnector) {
    this.taskDefinitionConnector = taskDefinitionConnector;
}
项目:lemon    文件:MenuController.java   
@Resource
public void setMessageHelper(MessageHelper messageHelper) {
    this.messageHelper = messageHelper;
}
项目:WeiXing_xmu-2016-MrCode    文件:CustomerServiceImpl.java   
@Resource(name="customerDaoImpl")
public void setBaseDao(BaseDaoImpl<Customer> baseDao){
    super.setBaseDao(baseDao);
}
项目:lemon    文件:CmsCommentController.java   
@Resource
public void setCurrentUserHolder(CurrentUserHolder currentUserHolder) {
    this.currentUserHolder = currentUserHolder;
}
项目:lemon    文件:SendmailHistoryController.java   
@Resource
public void setTenantHolder(TenantHolder tenantHolder) {
    this.tenantHolder = tenantHolder;
}
项目:lemon    文件:PermController.java   
@Resource
public void setMessageHelper(MessageHelper messageHelper) {
    this.messageHelper = messageHelper;
}
项目:lemon    文件:WhitelistAppController.java   
@Resource
public void setExportor(Exportor exportor) {
    this.exportor = exportor;
}
项目:lemon    文件:AdminBatchController.java   
@Resource
public void setMessageHelper(MessageHelper messageHelper) {
    this.messageHelper = messageHelper;
}
项目:lemon    文件:BpmConfNodeController.java   
@Resource
public void setBpmConfNodeManager(BpmConfNodeManager bpmConfNodeManager) {
    this.bpmConfNodeManager = bpmConfNodeManager;
}
项目:lemon    文件:TreeController.java   
@Resource
public void setPartyStructTypeManager(
        PartyStructTypeManager partyStructTypeManager) {
    this.partyStructTypeManager = partyStructTypeManager;
}
项目:lemon    文件:CardInfoController.java   
@Resource
public void setExportor(Exportor exportor) {
    this.exportor = exportor;
}
项目:lemon    文件:BpmProcessController.java   
@Resource
public void setBpmConfOperationManager(
        BpmConfOperationManager bpmConfOperationManager) {
    this.bpmConfOperationManager = bpmConfOperationManager;
}
项目:lemon    文件:HumantaskPortalController.java   
@Resource
public void setCurrentUserHolder(CurrentUserHolder currentUserHolder) {
    this.currentUserHolder = currentUserHolder;
}
项目:lemon    文件:VisitorInfoController.java   
@Resource
public void setVisitorInfoManager(VisitorInfoManager visitorInfoManager) {
    this.visitorInfoManager = visitorInfoManager;
}
项目:lemon    文件:MsgInfoController.java   
@Resource
public void setMessageHelper(MessageHelper messageHelper) {
    this.messageHelper = messageHelper;
}
项目:easy-test    文件:SimpleJsonProcessorImpl.java   
@Resource(name = "simpleMybatisMapper")
public void setDataBaseMapper(DataBaseMapper dataBaseMapper) {
    super.setDataBaseMapper(dataBaseMapper);
}