1 46 package org.bsf.remoteIterator.server; 47 48 import org.bsf.commons.ejb.SessionAdapterBean; 49 50 import javax.ejb.CreateException ; 51 import javax.naming.InitialContext ; 52 import javax.naming.NamingException ; 53 54 79 public class RemoteIteratorServiceBean extends SessionAdapterBean { 80 private RemoteIteratorHome _remoteIteratorHome = null; 81 82 85 public RemoteIterator getRemoteIterator( String p_query ) { 86 RemoteIterator remoteIterator = null; 87 88 try { 89 remoteIterator = _remoteIteratorHome.create( p_query ); 90 } catch( Exception e ) { 91 logError( "Unable to create ri with sql: " + p_query ); 93 94 handleExceptionAsSystemException( e ); 95 } 96 97 return remoteIterator; 98 } 99 100 104 public void ejbCreate() throws CreateException { 105 logDebug( "ejbCreate() -> Retrieving the home(s)..." ); 106 107 try { 109 InitialContext ic = new InitialContext (); 110 _remoteIteratorHome = (RemoteIteratorHome) ic.lookup( "java:comp/env/ejb/RemoteIterator" ); 111 } catch( NamingException e ) { 112 handleExceptionAsSystemException( e ); 113 } 114 } 115 } 116 117 | Popular Tags |