本篇文章給大家談?wù)刟spect外呼系統(tǒng),以及對(duì)應(yīng)的知識(shí)點(diǎn),希望對(duì)各位有所幫助,不要忘了收藏本站喔。
本文目錄一覽:
1、spring中aop全注解時(shí)配置類怎么寫
2、BIS是什么?
3、BIS的腦電雙頻指數(shù)
4、BIS的化學(xué)藥品名稱
spring中aop全注解時(shí)配置類怎么寫
先說(shuō)注解aspect外呼系統(tǒng),使用注解配置Spring AOP總體分為兩步,第一步是在xml文件中聲明激活自動(dòng)掃描組件功能,同時(shí)激活自動(dòng)代理功能(同時(shí)在xml中添加一個(gè)UserService的普通服務(wù)層組件,來(lái)測(cè)試AOP的注解功能):
?xml version="1.0" encoding="UTF-8"?
beans xmlns=""
xmlns:xsi=""
xmlns:context=""
xmlns:aop=""
xsi:schemaLocation="
"
!-- 激活組件掃描功能,在包c(diǎn)n.ysh.studio.spring.aop及其子包下面自動(dòng)掃描通過(guò)注解配置的組件 --
context:component-scan base-package="cn.ysh.studio.spring.aop"/
!-- 激活自動(dòng)代理功能 --
aop:aspectj-autoproxy proxy-target-class="true"/
!-- 用戶服務(wù)對(duì)象 --
bean id="userService" class="cn.ysh.studio.spring.aop.service.UserService" /
/beans
第二步是為Aspect切面類添加注解:
package cn.ysh.studio.spring.aop.aspect;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
/**
* 系統(tǒng)服務(wù)組件Aspect切面Bean
* @author Shenghany
* @date 2013-5-28
*/
//聲明這是一個(gè)組件
@Component
//聲明這是一個(gè)切面Bean
@Aspect
public class ServiceAspect {
private final static Log log = LogFactory.getLog(ServiceAspect.class);
//配置切入點(diǎn),該方法無(wú)方法體,主要為方便同類中其他方法使用此處配置的切入點(diǎn)
@Pointcut("execution(* cn.ysh.studio.spring.aop.service..*(..))")
public void aspect(){ }
/*
* 配置前置通知,使用在方法aspect()上注冊(cè)的切入點(diǎn)
* 同時(shí)接受JoinPoint切入點(diǎn)對(duì)象,可以沒有該參數(shù)
*/
@Before("aspect()")
public void before(JoinPoint joinPoint){
if(log.isInfoEnabled()){
log.info("before " + joinPoint);
}
}
//配置后置通知,使用在方法aspect()上注冊(cè)的切入點(diǎn)
@After("aspect()")
public void after(JoinPoint joinPoint){
if(log.isInfoEnabled()){
log.info("after " + joinPoint);
}
}
//配置環(huán)繞通知,使用在方法aspect()上注冊(cè)的切入點(diǎn)
@Around("aspect()")
public void around(JoinPoint joinPoint){
long start = System.currentTimeMillis();
try {
((ProceedingJoinPoint) joinPoint).proceed();
long end = System.currentTimeMillis();
if(log.isInfoEnabled()){
log.info("around " + joinPoint + "\tUse time : " + (end - start) + " ms!");
}
} catch (Throwable e) {
long end = System.currentTimeMillis();
if(log.isInfoEnabled()){
log.info("around " + joinPoint + "\tUse time : " + (end - start) + " ms with exception : " + e.getMessage());
}
}
}
//配置后置返回通知,使用在方法aspect()上注冊(cè)的切入點(diǎn)
@AfterReturning("aspect()")
public void afterReturn(JoinPoint joinPoint){
if(log.isInfoEnabled()){
log.info("afterReturn " + joinPoint);
}
}
//配置拋出異常后通知,使用在方法aspect()上注冊(cè)的切入點(diǎn)
@AfterThrowing(pointcut="aspect()", throwing="ex")
public void afterThrow(JoinPoint joinPoint, Exception ex){
if(log.isInfoEnabled()){
log.info("afterThrow " + joinPoint + "\t" + ex.getMessage());
}
}
}
測(cè)試代碼:
package cn.ysh.studio.spring.aop;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import cn.ysh.studio.spring.aop.service.UserService;
import cn.ysh.studio.spring.mvc.bean.User;
/**
* Spring AOP測(cè)試
* @author Shenghany
* @date 2013-5-28
*/
public class Tester {
private final static Log log = LogFactory.getLog(Tester.class);
public static void main(String[] args) {
//啟動(dòng)Spring容器
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//獲取service組件
UserService service = (UserService) context.getBean("userService");
//以普通的方式調(diào)用UserService對(duì)象的三個(gè)方法
User user = service.get(1L);
service.save(user);
try {
service.delete(1L);
} catch (Exception e) {
if(log.isWarnEnabled()){
log.warn("Delete user : " + e.getMessage());
}
}
}
}
控制臺(tái)輸出如下:
INFO [spring.aop.aspect.ServiceAspect:40] before execution(User cn.ysh.studio.spring.aop.service.UserService.get(long))
INFO [spring.aop.service.UserService:19] getUser method . . .
INFO [spring.aop.aspect.ServiceAspect:60] around execution(User cn.ysh.studio.spring.aop.service.UserService.get(long)) Use time : 42 ms!
INFO [spring.aop.aspect.ServiceAspect:48] after execution(User cn.ysh.studio.spring.aop.service.UserService.get(long))
INFO [spring.aop.aspect.ServiceAspect:74] afterReturn execution(User cn.ysh.studio.spring.aop.service.UserService.get(long))
INFO [spring.aop.aspect.ServiceAspect:40] before execution(void cn.ysh.studio.spring.aop.service.UserService.save(User))
INFO [spring.aop.service.UserService:26] saveUser method . . .
INFO [spring.aop.aspect.ServiceAspect:60] around execution(void cn.ysh.studio.spring.aop.service.UserService.save(User)) Use time : 2 ms!
INFO [spring.aop.aspect.ServiceAspect:48] after execution(void cn.ysh.studio.spring.aop.service.UserService.save(User))
INFO [spring.aop.aspect.ServiceAspect:74] afterReturn execution(void cn.ysh.studio.spring.aop.service.UserService.save(User))
INFO [spring.aop.aspect.ServiceAspect:40] before execution(boolean cn.ysh.studio.spring.aop.service.UserService.delete(long))
INFO [spring.aop.service.UserService:32] delete method . . .
INFO [spring.aop.aspect.ServiceAspect:65] around execution(boolean cn.ysh.studio.spring.aop.service.UserService.delete(long)) Use time : 5 ms with exception : spring aop ThrowAdvice演示
INFO [spring.aop.aspect.ServiceAspect:48] after execution(boolean cn.ysh.studio.spring.aop.service.UserService.delete(long))
INFO [spring.aop.aspect.ServiceAspect:74] afterReturn execution(boolean cn.ysh.studio.spring.aop.service.UserService.delete(long))
WARN [studio.spring.aop.Tester:32] Delete user : Null return value from advice does not match primitive return type for: public boolean cn.ysh.studio.spring.aop.service.UserService.delete(long) throws java.lang.Exception
可以看到,正如我們預(yù)期的那樣,雖然我們并沒有對(duì)UserSerivce類包括其調(diào)用方式做任何改變,但是Spring仍然攔截到aspect外呼系統(tǒng)了其中方法的調(diào)用,或許這正是AOP的魔力所在。
再簡(jiǎn)單說(shuō)一下xml配置方式,其實(shí)也一樣簡(jiǎn)單:
?xml version="1.0" encoding="UTF-8"?
beans xmlns=""
xmlns:xsi=""
xmlns:context=""
xmlns:aop=""
xsi:schemaLocation="
"
!-- 系統(tǒng)服務(wù)組件的切面Bean --
bean id="serviceAspect" class="cn.ysh.studio.spring.aop.aspect.ServiceAspect"/
!-- AOP配置 --
aop:config
!-- 聲明一個(gè)切面,并注入切面Bean,相當(dāng)于@Aspect --
aop:aspect id="simpleAspect" ref="serviceAspect"
!-- 配置一個(gè)切入點(diǎn),相當(dāng)于@Pointcut --
aop:pointcut expression="execution(* cn.ysh.studio.spring.aop.service..*(..))" id="simplePointcut"/
!-- 配置通知,相當(dāng)于@Before、@After、@AfterReturn、@Around、@AfterThrowing --
aop:before pointcut-ref="simplePointcut" method="before"/
aop:after pointcut-ref="simplePointcut" method="after"/
aop:after-returning pointcut-ref="simplePointcut" method="afterReturn"/
aop:after-throwing pointcut-ref="simplePointcut" method="afterThrow" throwing="ex"/
/aop:aspect
/aop:config
/beans
個(gè)人覺得不如注解靈活和強(qiáng)大,aspect外呼系統(tǒng)你可以不同意這個(gè)觀點(diǎn),但是不知道如下的代碼會(huì)不會(huì)讓aspect外呼系統(tǒng)你的想法有所改善:
//配置前置通知,攔截返回值為cn.ysh.studio.spring.mvc.bean.User的方法
@Before("execution(cn.ysh.studio.spring.mvc.bean.User cn.ysh.studio.spring.aop.service..*(..))")
public void beforeReturnUser(JoinPoint joinPoint){
if(log.isInfoEnabled()){
log.info("beforeReturnUser " + joinPoint);
}
}
//配置前置通知,攔截參數(shù)為cn.ysh.studio.spring.mvc.bean.User的方法
@Before("execution(* cn.ysh.studio.spring.aop.service..*(cn.ysh.studio.spring.mvc.bean.User))")
public void beforeArgUser(JoinPoint joinPoint){
if(log.isInfoEnabled()){
log.info("beforeArgUser " + joinPoint);
}
}
//配置前置通知,攔截含有l(wèi)ong類型參數(shù)的方法,并將參數(shù)值注入到當(dāng)前方法的形參id中
@Before("aspect()args(id)")
public void beforeArgId(JoinPoint joinPoint, long id){
if(log.isInfoEnabled()){
log.info("beforeArgId " + joinPoint + "\tID:" + id);
}
}
附上UserService的代碼(其實(shí)很簡(jiǎn)單):
package cn.ysh.studio.spring.aop.service;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import cn.ysh.studio.spring.mvc.bean.User;
/**
* 用戶服務(wù)模型
* @author Shenghany
* @date 2013-5-28
*/
public class UserService {
private final static Log log = LogFactory.getLog(UserService.class);
public User get(long id){
if(log.isInfoEnabled()){
log.info("getUser method . . .");
}
return new User();
}
public void save(User user){
if(log.isInfoEnabled()){
log.info("saveUser method . . .");
}
}
public boolean delete(long id) throws Exception{
if(log.isInfoEnabled()){
log.info("delete method . . .");
throw new Exception("spring aop ThrowAdvice演示");
}
return false;
}
}
應(yīng)該說(shuō)學(xué)習(xí)Spring AOP有兩個(gè)難點(diǎn),第一點(diǎn)在于理解AOP的理念和相關(guān)概念,第二點(diǎn)在于靈活掌握和使用切入點(diǎn)表達(dá)式。概念的理解通常不在一朝一夕,慢慢浸泡的時(shí)間長(zhǎng)aspect外呼系統(tǒng)了,自然就明白了,下面我們簡(jiǎn)單地介紹一下切入點(diǎn)表達(dá)式的配置規(guī)則吧。
通常情況下,表達(dá)式中使用”execution“就可以滿足大部分的要求。表達(dá)式格式如下:
execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-pattern) throws-pattern?)
modifiers-pattern:方法的操作權(quán)限
ret-type-pattern:返回值
declaring-type-pattern:方法所在的包
name-pattern:方法名
parm-pattern:參數(shù)名
throws-pattern:異常
其中,除ret-type-pattern和name-pattern之外,其他都是可選的。上例中,execution(* com.spring.service.*.*(..))表示com.spring.service包下,返回值為任意類型;方法名任意;參數(shù)不作限制的所有方法。
最后說(shuō)一下通知參數(shù)
可以通過(guò)args來(lái)綁定參數(shù),這樣就可以在通知(Advice)中訪問具體參數(shù)了。例如,aop:aspect配置如下:
aop:config
aop:aspect id="TestAspect" ref="aspectBean"
aop:pointcut id="businessService"
expression="execution(* com.spring.service.*.*(String,..)) and args(msg,..)" /
aop:after pointcut-ref="businessService" method="doAfter"/
/aop:aspect
/aop:config上面的代碼args(msg,..)是指將切入點(diǎn)方法上的第一個(gè)String類型參數(shù)添加到參數(shù)名為msg的通知的入?yún)⑸?,這樣就可以直接使用該參數(shù)啦。
BIS是什么?
BIS認(rèn)證是ISI認(rèn)證發(fā)證機(jī)構(gòu)印度標(biāo)準(zhǔn)局(The Bureau of Indian Standards),簡(jiǎn)稱BIS,具體負(fù)責(zé)產(chǎn)品認(rèn)證工作。
按《1986 年印度標(biāo)準(zhǔn)局法》(The BIS Act, 1986),印度標(biāo)準(zhǔn)局(BIS)具體負(fù)責(zé)產(chǎn)品認(rèn)證工作,它也是印度唯一的產(chǎn)品認(rèn)證機(jī)構(gòu)。BIS下設(shè)5個(gè)地區(qū)局和19個(gè)分局。正式成立于1987年,以取代1946年成立的印度標(biāo)準(zhǔn)學(xué)會(huì)。
地區(qū)局監(jiān)管對(duì)應(yīng)分局。BIS所屬的8個(gè)實(shí)驗(yàn)室和一些獨(dú)立實(shí)驗(yàn)室負(fù)責(zé)產(chǎn)品認(rèn)證過(guò)程抽取樣品的檢驗(yàn)。這些實(shí)驗(yàn)室均按ISO/IEC17025:1999執(zhí)行。
印度標(biāo)準(zhǔn)局(BIS)隸屬于消費(fèi)者事務(wù)及公共分配部,它雖為社會(huì)法人團(tuán)體,卻行使政府職能,其主要任務(wù)是制定推行國(guó)家標(biāo)準(zhǔn);實(shí)施合格評(píng)定制度;代表國(guó)家參與ISO,IEC等國(guó)際標(biāo)準(zhǔn)化活動(dòng)。
自BIS的前身印度標(biāo)準(zhǔn)協(xié)會(huì)于1955年開始進(jìn)行產(chǎn)品認(rèn)證以來(lái),迄今印度產(chǎn)品認(rèn)證已有50年歷史。目前,BIS已頒發(fā)產(chǎn)品認(rèn)證證書3萬(wàn)多份,涵蓋農(nóng)產(chǎn)品、紡織品、電子等幾乎每一個(gè)工業(yè)領(lǐng)域。
擴(kuò)展資料:
認(rèn)證流程:
1、申請(qǐng)。欲獲得BIS認(rèn)證的國(guó)外生產(chǎn)商一般需使用專用的申請(qǐng)書,并準(zhǔn)備相關(guān)文件向BIS新德里總部申請(qǐng)。
2、記錄。BIS對(duì)查申請(qǐng)者提交的申請(qǐng)文件和資料進(jìn)行審查,如手續(xù)完備,將申請(qǐng)記錄在案。申請(qǐng)者須交納相應(yīng)的處理費(fèi)。
3、初次工廠檢驗(yàn)。BIS將指派不超過(guò)2人的官員團(tuán)赴工廠檢驗(yàn)。申請(qǐng)者須承擔(dān)官員團(tuán)赴工廠檢驗(yàn)的差旅、簽證費(fèi)用等開支及相應(yīng)的檢驗(yàn)費(fèi)用。
4、頒發(fā)證書。如果初次檢驗(yàn)和測(cè)試結(jié)果合格,且申請(qǐng)者同意認(rèn)證后執(zhí)行BIS認(rèn)可的檢驗(yàn)測(cè)試方案并支付BIS標(biāo)識(shí)費(fèi),可向申請(qǐng)者頒發(fā)證書。證書有效期為1年。證書授予后,執(zhí)證者每年要支付標(biāo)識(shí)費(fèi)以及證書年費(fèi)。
5、認(rèn)證后監(jiān)督。BIS通過(guò)對(duì)執(zhí)證人的常規(guī)監(jiān)督和對(duì)工廠、市場(chǎng)上的樣品進(jìn)行突擊檢查和測(cè)試,監(jiān)督其認(rèn)證產(chǎn)品的質(zhì)量。如果定期檢查,從工廠或市場(chǎng)抽取的試樣經(jīng)該工廠檢驗(yàn)和獨(dú)立檢測(cè)結(jié)果滿足要求,證書可予以更新。執(zhí)證者通過(guò)提交指定表格向BIS提出更新申請(qǐng),證書更新費(fèi)為500盧比。執(zhí)證者還需承擔(dān)樣品檢驗(yàn)費(fèi)用。
參考資料來(lái)源:百度百科-BIS認(rèn)證
BIS的腦電雙頻指數(shù)
腦電雙頻指數(shù)(bispectral index,BIS):美國(guó)Aspect醫(yī)學(xué)系統(tǒng)公司二十余年來(lái)專注于麻醉意識(shí)深度監(jiān)測(cè)aspect外呼系統(tǒng)的研究與產(chǎn)品開發(fā)aspect外呼系統(tǒng),其開發(fā)aspect外呼系統(tǒng)的BIS指數(shù)aspect外呼系統(tǒng),又稱腦電雙頻譜指數(shù),擁有國(guó)際專利,并已通過(guò)美國(guó)FDA認(rèn)證。
犬賽中的BIS
在所有大大小小的犬賽中都可以看到BIS,意思是“展示的全場(chǎng)總冠軍”。
BIS就是BEST IN SHOW的縮寫。
而BISS是BEST IN SPECIALTY SHOW的縮寫。
單獨(dú)展實(shí)際上就是單犬種的冠軍賽。
在單獨(dú)展中由于一些犬種的體型顏色和毛種的不同,在單獨(dú)展中會(huì)被分別在獨(dú)立比賽。與全犬種的Dog Show相同,單獨(dú)展的分組也是根據(jù)性別和年齡進(jìn)行的。通常情況下根據(jù)年齡可以分為4個(gè)組,6-9月齡為一組,9-12月齡為一組,12-18月齡為以組,18月齡以上為一組。在根據(jù)性別,所選出的優(yōu)勝者會(huì)授予最佳犬種(Best Of Variety,簡(jiǎn)稱BOV),最終所有獲得BOV(不分性別)的參賽犬共同角逐出的獲勝者就是單獨(dú)展的全場(chǎng)總冠軍(Best In Specialty Show,簡(jiǎn)稱BISS)
BIS的化學(xué)藥品名稱
Bis即甲叉丙烯酰胺。
arc——丙烯酰胺,bis——甲叉丙烯酰胺,arc-bis也就是丙烯酰胺單體貯液,形成的聚丙烯酰胺則是一種網(wǎng)狀結(jié)構(gòu),可以做PAGE類的電泳,用來(lái)分離大分子。
無(wú)論是濃縮膠還是分離膠中這兩種物質(zhì)都是有的,只是濃度不一樣而已。一般分離膠濃度7-15%,濃縮膠4-5%。
擴(kuò)展資料:
BIS的其他含義:
(1)BIS的全稱是BlackBerry Internet Service,即黑莓網(wǎng)絡(luò)服務(wù),是RIM公司針對(duì)于個(gè)人用戶或不能部署B(yǎng)ES服務(wù)器的企業(yè)開展的郵件推入服務(wù)(Push-Mail)。不同于BES由企業(yè)提供電子郵件服務(wù),BIS由電信供應(yīng)商提供電子郵件服務(wù)。
(2)Bank for International Settlements的縮寫,即國(guó)際清算銀行。根據(jù)1930年1月20日簽訂的海牙國(guó)際協(xié)定,于同年5月,成立了由英國(guó)、法國(guó)、意大利、德國(guó)、比利時(shí)、日本6國(guó)的中央銀行,以及美國(guó)的3家大商業(yè)銀行組成的銀行集團(tuán)聯(lián)合成立于瑞士的巴塞爾。其領(lǐng)導(dǎo)機(jī)構(gòu)為董事會(huì),其成員大都是西方中央銀行行長(zhǎng)。
(3)腦電雙頻指數(shù)(bispectral index,BIS):美國(guó)Aspect醫(yī)學(xué)系統(tǒng)公司二十余年來(lái)專注于麻醉意識(shí)深度監(jiān)測(cè)的研究與產(chǎn)品開發(fā),其開發(fā)的BIS指數(shù),又稱腦電雙頻譜指數(shù),擁有國(guó)際專利,并已通過(guò)美國(guó)FDA認(rèn)證。
參考資料:百度百科-bis
aspect外呼系統(tǒng)的介紹就聊到這里吧,感謝你花時(shí)間閱讀本站內(nèi)容,更多關(guān)于、aspect外呼系統(tǒng)的信息別忘了在本站進(jìn)行查找喔。