1 22 package com.cluster.simple.sessionbeans; 23 24 import com.cluster.simple.util.TestUtil; 25 26 import javax.ejb.SessionBean ; 27 import javax.ejb.SessionContext ; 28 import java.net.InetAddress ; 29 import java.rmi.RemoteException ; 30 31 public class SimpleSessionBean implements SessionBean 32 { 33 public String processRequest(String msg) 34 throws RemoteException 35 { 36 System.out.println("SimpleSessionBean:processRequest"); 37 String res = null; 38 try 39 { 40 TestUtil util = new TestUtil(); 41 String hostName = null; 42 try 43 { 44 hostName = InetAddress.getLocalHost().getHostName(); 45 } 46 catch (Exception e) 47 { 48 hostName = e.getMessage(); 49 } 50 res = "\n" + "Got A Request For A SimpleSessionBean on Host : " + hostName + " Invoked Util " + util.testUtilClass() + "\n"; 51 52 } 53 catch (Exception ex) 54 { 55 res = res + ex.getMessage(); 56 } 57 return res; 58 } 59 60 public void ejbCreate() 61 { 62 } 63 64 public void ejbRemove() 65 { 66 } 67 68 public void ejbActivate() 69 { 70 } 71 72 public void ejbPassivate() 73 { 74 } 75 76 public void setSessionContext(SessionContext sc) 77 { 78 } 79 80 81 } 82 83 | Popular Tags |