freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

分布對(duì)象2-資料下載頁(yè)

2025-07-18 10:57本頁(yè)面
  

【正文】 } } 2022/8/15 Institute of Computer Software Nanjing University 58 EJB接口 ? 接口就是最普通的接口 ?不再需要 extend: EJBObject, EJBHome ? 接口可以是 local或 remote ?注解: @Local, @Remote ?Remote方法不需拋出 RemoteException 2022/8/15 Institute of Computer Software Nanjing University 59 EJB EJB接口 // EJB Stateless Session Bean: Interfaces public interface PayrollHome extends { public Payroll create() throws CreateException。 } public interface Payroll extends { public void setTaxDeductions(int empId, int deductions)。 } 2022/8/15 Institute of Computer Software Nanjing University 60 EJB EJB接口 // Local Interface @Local public interface Payroll { public void setTaxDeductions(int empId, int deductions)。 } // Remote Interface @Remote public interface Payroll { public void setTaxDeductions(int empId, int deductions)。 } 2022/8/15 Institute of Computer Software Nanjing University 61 消息驅(qū)動(dòng) Bean ? 注解 ?@MessageDriven ? 消息驅(qū)動(dòng) Bean需要實(shí)現(xiàn) ?onMessage(Message msg)方法 2022/8/15 Institute of Computer Software Nanjing University 62 消息驅(qū)動(dòng) Bean的例子 // EJB Messagedriven bean: Bean Class @MessageDriven public class PayrollMDB implements { public void onMessage(Message msg) { ... } } 2022/8/15 Institute of Computer Software Nanjing University 63 調(diào)用資源 ? 不再需要繁瑣的 JNDI Lookup。 ? 資源注射 ?注解 Instance variable ?注解 setter方法 ? 動(dòng)態(tài) Lookup ?注解 class 2022/8/15 Institute of Computer Software Nanjing University 64 注解 ? @Resource ?For connection factories, simple environment entries, topics/queues, EJBContext, UserTransaction, etc. ? @PersistenceContext ?容器管理的 EntityManager ? @PersistenceUnit ?EntityManagerFactory:獲取非容器管理的EntityManager 2022/8/15 Institute of Computer Software Nanjing University 65 Dependency Injection ? Bean instance is supplied with references to resources in environment ? Occurs when instance of bean class is created ? No assumptions as to order of injection ? Optional @PostConstruct method is called when injection is plete 2022/8/15 Institute of Computer Software Nanjing University 66 資源注射的例子 // EJB Stateless Session Bean: Bean Class // Data access using injection and Java Persistence API @Stateless public class PayrollBean implements Payroll { @PersistenceContext EntityManager payrollMgr。 public void setTaxDeductions(int empId,int deductions){ (,empId). setTaxDeductions(deductions)。 } } 2022/8/15 Institute of Computer Software Nanjing University 67 動(dòng)態(tài) Lookup的例子 // EJB Stateless Session Bean // Using dynamic lookup @PersistenceContext(name=”payrollMgr”) @Stateless public class PayrollBean implements Payroll { @Resource SessionContext ctx。 public void setTaxDeductions(int empId,int deductions){ EntityManager payrollMgr = (“payrollMgr”)。 (, empId).setDeductions(deductions)。 } } 2022/8/15 Institute of Computer Software Nanjing University 68 Bean Lifecycle Event ? EJB EnterpriseBean接口,并重寫(xiě)Lifecycle相關(guān)的方法 ? EJB ?注解 : ?@PostConstruct ?@PreDestroy ?@PostActivate ?@PrePassivate ? 多個(gè)注解可用于同一個(gè)方法。 2022/8/15 Institute of Computer Software Nanjing University 69 簡(jiǎn)化了 EJB調(diào)用 ? 使用資源注射的方式 ? 不再需要 Home interface ? 不再拋出 RemoteException 2022/8/15 Institute of Computer Software Nanjing University 70 EJB // EJB : Client View ... Context initialContext = new InitialContext()。 PayrollHome payrollHome = (PayrollHome) (“java:p/env/ejb/payroll”)。 Payroll payroll = ()。 ... // Use the bean (1234, 3)。 2022/8/15 Institute of Computer Software Nanjing University 71 EJB // EJB : Client View @EJB Payroll payroll。 // Use the bean (1234, 3)。 2022/8/15 Institute of Computer Software Nanjing University 72 EJB Summary ? Major simplification of EJB technology for developers ? Beans are plain Java classes with plain Java interfaces ? APIs refocused on ease of use for developer ? Easy access to container services and environment ? Deployment descriptors available, but generally unneeded ? EJB ponents interoperate with existing ponents/applications ? Gives developer powerful and easytouse functionality 2022/8/15 Institute of Computer Software Nanjing University 73 作業(yè) (本次作業(yè)不用提交 ) ? Java RMI做了哪些改進(jìn)? ? EJB EJB ? 2022/8/15 Institute of Computer Software Nanjing University 74
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1