/** * Connect to the EIS adapter and return the Connection. */ public Object connectToDatasource(Accessor accessor, Session session) { return getConnectionSpec().connectToDataSource((EISAccessor)accessor, getProperties()); }
/** * Return the connector. * The connector defines how the connection is created. */ public EISConnectionSpec getConnectionSpec() { return (EISConnectionSpec)getConnector(); }
/** * PUBLIC: * Set the password. */ public void setPassword(String password) { // Avoid encryption // Bug 4117441 - Secure programming practices, store password in char[] if (password != null) { setProperty("password", password.toCharArray()); } else { // is null so remove the property // respect explicit de-referencing of password removeProperty("password"); } }
/** * INTERNAL: * Wrapped by the getLogin() call, therefore, config can't be null at this * point. */ protected Login buildEISLoginConfig(EISLoginConfig eisLoginConfig) { EISLogin eisLogin = new EISLogin(); // Connection Spec String specClassName = eisLoginConfig.getConnectionSpecClass(); if (specClassName != null) { try { Class specClass = m_classLoader.loadClass(specClassName); EISConnectionSpec spec = null; if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ spec = (EISConnectionSpec)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(specClass)); }else{ spec = (EISConnectionSpec)PrivilegedAccessHelper.newInstanceFromClass(specClass); } eisLogin.setConnectionSpec(spec); } catch (Exception exception) { throw SessionLoaderException.failedToLoadTag("connection-spec-class", specClassName, exception); } } // Connection Factory URL, setConnectionFactoryURL checks for null eisLogin.setConnectionFactoryURL(eisLoginConfig.getConnectionFactoryURL()); // Process the common elements in LoginConfig processLoginConfig(eisLoginConfig, eisLogin); // Finally, return the newly created EISLogin return eisLogin; }
/** * PUBLIC: * Configure the login to connect through a JDNI managed connection factory and the default getConnection(). */ public void configureConnectionSpec(String jndiName) { setConnectionSpec(new EISConnectionSpec(jndiName)); }
method.addLine("login.setConnectionSpec(new " + eisLogin.getConnectionSpec().getClass().getName() + "());"); if (eisLogin.getConnectionFactoryURL() != null) { method.addLine("login.setConnectionFactoryURL(\"" + eisLogin.getConnectionFactoryURL() + "\");");
/** * PUBLIC: * Set the JNDI URL for the managed connection factory for the JCA adapter connecting to. */ public void setConnectionFactoryURL(String url) { if ((url == null) || (url.length() == 0)) { return; } getConnectionSpec().setName(url); }
if (login.getDatasourcePlatform() instanceof EISPlatform) { isEIS = true; EISLogin newLogin = new EISLogin(); newLogin.setDatasourcePlatform(login.getDatasourcePlatform()); this.session.setDatasourceLogin(newLogin); if (this.session.isServerSession()) {
/** * PUBLIC: * Set the EclipseLink connection spec. * The connection spec defines how to connect to the EIS adapter. */ public void setConnectionSpec(EISConnectionSpec connectionSpec) { setConnector(connectionSpec); }
/** * INTERNAL: * Wrapped by the getLogin() call, therefore, config can't be null at this * point. */ protected Login buildEISLoginConfig(EISLoginConfig eisLoginConfig) { EISLogin eisLogin = new EISLogin(); // Connection Spec String specClassName = eisLoginConfig.getConnectionSpecClass(); if (specClassName != null) { try { Class specClass = m_classLoader.loadClass(specClassName); EISConnectionSpec spec = null; if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ spec = (EISConnectionSpec)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(specClass)); }else{ spec = (EISConnectionSpec)PrivilegedAccessHelper.newInstanceFromClass(specClass); } eisLogin.setConnectionSpec(spec); } catch (Exception exception) { throw SessionLoaderException.failedToLoadTag("connection-spec-class", specClassName, exception); } } // Connection Factory URL, setConnectionFactoryURL checks for null eisLogin.setConnectionFactoryURL(eisLoginConfig.getConnectionFactoryURL()); // Process the common elements in LoginConfig processLoginConfig(eisLoginConfig, eisLogin); // Finally, return the newly created EISLogin return eisLogin; }
/** * PUBLIC: * Configure the login to connect through a JDNI managed connection factory and the default getConnection(). */ public void configureConnectionSpec(String jndiName) { setConnectionSpec(new EISConnectionSpec(jndiName)); }
method.addLine("login.setConnectionSpec(new " + eisLogin.getConnectionSpec().getClass().getName() + "());"); if (eisLogin.getConnectionFactoryURL() != null) { method.addLine("login.setConnectionFactoryURL(\"" + eisLogin.getConnectionFactoryURL() + "\");");
/** * PUBLIC: * Set the JNDI URL for the managed connection factory for the JCA adapter connecting to. */ public void setConnectionFactoryURL(String url) { if ((url == null) || (url.length() == 0)) { return; } getConnectionSpec().setName(url); }
/** * PUBLIC: * Set the EclipseLink connection spec. * The connection spec defines how to connect to the EIS adapter. */ public void setConnectionSpec(EISConnectionSpec connectionSpec) { setConnector(connectionSpec); }
/** * INTERNAL: * Wrapped by the getLogin() call, therefore, config can't be null at this * point. */ protected Login buildEISLoginConfig(EISLoginConfig eisLoginConfig) { EISLogin eisLogin = new EISLogin(); // Connection Spec String specClassName = eisLoginConfig.getConnectionSpecClass(); if (specClassName != null) { try { Class specClass = m_classLoader.loadClass(specClassName); EISConnectionSpec spec = null; if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ spec = (EISConnectionSpec)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(specClass)); }else{ spec = (EISConnectionSpec)PrivilegedAccessHelper.newInstanceFromClass(specClass); } eisLogin.setConnectionSpec(spec); } catch (Exception exception) { throw SessionLoaderException.failedToLoadTag("connection-spec-class", specClassName, exception); } } // Connection Factory URL, setConnectionFactoryURL checks for null eisLogin.setConnectionFactoryURL(eisLoginConfig.getConnectionFactoryURL()); // Process the common elements in LoginConfig processLoginConfig(eisLoginConfig, eisLogin); // Finally, return the newly created EISLogin return eisLogin; }
/** * PUBLIC: * Configure the login to connect through a JDNI managed connection factory and the default getConnection(). */ public void configureConnectionSpec(String jndiName) { setConnectionSpec(new EISConnectionSpec(jndiName)); }
/** * Connect to the EIS adapter and return the Connection. */ public Object connectToDatasource(Accessor accessor, Session session) { return getConnectionSpec().connectToDataSource((EISAccessor)accessor, getProperties()); }
/** * PUBLIC: * Set the password. */ public void setPassword(String password) { // Avoid encryption // Bug 4117441 - Secure programming practices, store password in char[] if (password != null) { setProperty("password", password.toCharArray()); } else { // is null so remove the property // respect explicit de-referencing of password removeProperty("password"); } }
method.addLine("login.setConnectionSpec(new " + eisLogin.getConnectionSpec().getClass().getName() + "());"); if (eisLogin.getConnectionFactoryURL() != null) { method.addLine("login.setConnectionFactoryURL(\"" + eisLogin.getConnectionFactoryURL() + "\");");
/** * PUBLIC: * Set the JNDI URL for the managed connection factory for the JCA adapter connecting to. */ public void setConnectionFactoryURL(String url) { if ((url == null) || (url.length() == 0)) { return; } getConnectionSpec().setName(url); }