[Ejtools-cvs] applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/sql DataSourceProxy.
Brought to you by:
letiemble
|
From: <let...@us...> - 2003-11-27 01:30:33
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/sql In directory sc8-pr-cvs1:/tmp/cvs-serv17169/jndi.browser/src/main/org/ejtools/jndi/browser/model/sql Modified Files: DataSourceProxy.java Log Message: Address Todo #755528 Address Todo #800902 Index: DataSourceProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/sql/DataSourceProxy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DataSourceProxy.java 10 Feb 2003 21:17:02 -0000 1.1 --- DataSourceProxy.java 27 Nov 2003 01:30:29 -0000 1.2 *************** *** 1,81 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.sql; ! ! import java.sql.SQLException; ! ! import javax.naming.Context; ! import javax.rmi.PortableRemoteObject; ! import javax.sql.DataSource; ! ! import org.ejtools.jndi.browser.model.JNDIContext; ! ! /** ! * Describe a mail session. ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="Data Source" ! * shortDescription="Data Source" ! * @javabean:icons color16="/toolbarButtonGraphics/development/JDBCDataSource16.gif" ! * @javabean:property name="name" ! * class="java.lang.String" ! * displayName="Name" ! * shortDescription="Name of the entry" ! * @javabean:property name="className" ! * class="java.lang.String" ! * displayName="Class" ! * shortDescription="Class of the entry" ! * @javabean:property name="loginTimeout" ! * class="int" ! * displayName="Login Timeout" ! * shortDescription="Login Timeout of the DataSource" ! */ ! public class DataSourceProxy extends JNDIContext ! { ! /** Description of the Field */ ! protected DataSource source; ! ! ! /** ! * Constructor for the SessionProxy object ! * ! * @param context Description of the Parameter ! * @param jndiName Description of the Parameter ! * @exception Exception Description of the Exception ! */ ! public DataSourceProxy(Context context, String jndiName) ! throws Exception ! { ! // Try to narrow to an EJBHome class ! Object o = context.lookup(jndiName); ! source = (DataSource) PortableRemoteObject.narrow(o, DataSource.class); ! ! this.setName(jndiName); ! this.setClassName(source.getClass().getName()); ! } ! ! ! /** ! * Gets the loginTimeout attribute of the DataSourceProxy object ! * ! * @return The loginTimeout value ! */ ! public int getLoginTimeout() ! { ! try ! { ! return this.source.getLoginTimeout(); ! } ! catch (SQLException sqle) ! { ! } ! return -1; ! } ! } --- 1,81 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.sql; ! ! import java.sql.SQLException; ! ! import javax.naming.Context; ! import javax.rmi.PortableRemoteObject; ! import javax.sql.DataSource; ! ! import org.ejtools.jndi.browser.model.JNDIContext; ! ! /** ! * Describe a mail session. ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="Data Source" ! * shortDescription="Data Source" ! * @javabean:icons color16="/toolbarButtonGraphics/development/JDBCDataSource16.gif" ! * @javabean:property name="name" ! * class="java.lang.String" ! * displayName="Name" ! * shortDescription="Name of the entry" ! * @javabean:property name="className" ! * class="java.lang.String" ! * displayName="Class" ! * shortDescription="Class of the entry" ! * @javabean:property name="loginTimeout" ! * class="int" ! * displayName="Login Timeout" ! * shortDescription="Login Timeout of the DataSource" ! */ ! public class DataSourceProxy extends JNDIContext ! { ! /** Description of the Field */ ! protected DataSource source; ! ! ! /** ! * Constructor for the SessionProxy object ! * ! * @param context Description of the Parameter ! * @param jndiName Description of the Parameter ! * @exception Exception Description of the Exception ! */ ! public DataSourceProxy(Context context, String jndiName) ! throws Exception ! { ! // Try to narrow to an EJBHome class ! Object o = context.lookup(jndiName); ! source = (DataSource) PortableRemoteObject.narrow(o, DataSource.class); ! ! this.setName(jndiName); ! this.setClassName(source.getClass().getName()); ! } ! ! ! /** ! * Gets the loginTimeout attribute of the DataSourceProxy object ! * ! * @return The loginTimeout value ! */ ! public int getLoginTimeout() ! { ! try ! { ! return this.source.getLoginTimeout(); ! } ! catch (SQLException sqle) ! { ! } ! return -1; ! } ! } |