Creating the server-side session bean public void ejbActivate() (Paypal web hosting)

Creating the server-side session bean public void ejbActivate() throws RemoteException { } public void ejbPassivate() throws RemoteException { } public void setSessionContext(SessionContext sessionContext) throws RemoteException { this.sessionContext = sessionContext; } } Click the Design tab to display the UI designer. Adding provider and resolver components to the session bean From the EJB page of the component palette, add an EntityBeanProvider and an EntityBeanResolver to the session bean. If you are working with an 2.0 enterprise bean, add a LocalEntityBeanProvider and a LocalEntityBeanResolver instead. You must also add a dataset component to hold the data gathered from the entity beans before it is sent to the client and the data that the client sends back. From the DataExpress page of the component palette, add a TableDataSet component and rename TableDataSet to some appropriate name. This is how the top of PersonnelBean would look; the TableDataSet has been renamed to employeeDataSet: public class PersonnelBean implements SessionBean { private SessionContext sessionContext; EntityBeanProvider entityBeanProvider = new EntityBeanProvider(); EntityBeanResolver entityBeanResolver = new EntityBeanResolver(); TableDataSet employeeDataSet = new TableDataSet(); … Using the Inspector, set the provider and resolver properties of the TableDataSet to the newly added EntityBeanProvider and EntityBeanResolver components, respectively. The result is two new methods in the jbInit() method: employeeDataSet.setProvider(entityBeanProvider); employeeDataSet.setResolver(entityBeanResolver); To the members of this class, add a reference to the home interface of the entity bean that contains the data you want to access. For this example, the reference is to the home interface of the Employee entity bean as shown here in bold. public class PersonnelBean implements SessionBean { private SessionContext sessionContext; EntityBeanProvider entityBeanProvider = new EntityBeanProvider(); EntityBeanResolver entityBeanResolver = new EntityBeanResolver(); TableDataSet employeeDataSet = new TableDataSet(); EmployeeHome employeeHome; … Writing the setSessionContext() method In the session bean s sessionContext() method add a try block. Modify the method so that it looks like this: public void setSessionContext(SessionContext sessionContext) throws RemoteException { this.sessionContext = sessionContext; try { Context context = new InitialContext(); Object object = context.lookup(”java:comp/env/ejb/Employee”); employeeHome = (EmployeeHome) PortableRemoteObject.narrow(object, Chapter 14: Using the DataExpress for EJB components 143
As web cam capabilities have been added to instant messaging text chat services such as Yahoo Messenger, AOL Instant Messenger (AIM), MSN Messenger and Skype, one-to-one live video communication over the internet has now reached millions of mainstream PC users worldwide.You can see details on web cam web hosting section.

Leave a Reply