X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=test%2Feclipselink%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsupport%2Fpersistence%2Feclipselink%2FJndiSessionCustomizer.java;h=ca74ec5cebc45c908098524540171e1e0eff44eb;hb=96c8961955a306314dfe0cf9ca192252de39fc1c;hp=db0b6487a18951af459ebd9b5db0100a072a258c;hpb=539c6d91b7a34e32c6669445d00e9275c337530a;p=utils diff --git a/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/JndiSessionCustomizer.java b/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/JndiSessionCustomizer.java index db0b6487..ca74ec5c 100644 --- a/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/JndiSessionCustomizer.java +++ b/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/JndiSessionCustomizer.java @@ -1,7 +1,18 @@ /* - * SCJD assignment, URLyBird, Erik Brakkee. - * Candidate ID: sr1399267. - */ + * Copyright 2005-2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wamblee.support.persistence.eclipselink; import org.eclipse.persistence.config.SessionCustomizer; @@ -34,7 +45,7 @@ public class JndiSessionCustomizer implements SessionCustomizer { * * */ - public void customize(Session session) throws Exception { + public void customize(Session aSession) throws Exception { JNDIConnector connector = null; Context context = null; @@ -42,7 +53,7 @@ public class JndiSessionCustomizer implements SessionCustomizer { context = new InitialContext(); if (null != context) { - connector = (JNDIConnector) session.getLogin().getConnector(); // possible + connector = (JNDIConnector) aSession.getLogin().getConnector(); // possible // CCE // Change from COMPOSITE_NAME_LOOKUP to STRING_LOOKUP // Note: if both jta and non-jta elements exist this will only @@ -55,11 +66,11 @@ public class JndiSessionCustomizer implements SessionCustomizer { // Or, if you are specifying both JTA and non-JTA in your // persistence.xml then set both connectors to be safe - JNDIConnector writeConnector = (JNDIConnector) session + JNDIConnector writeConnector = (JNDIConnector) aSession .getLogin().getConnector(); writeConnector.setLookupType(JNDIConnector.STRING_LOOKUP); - JNDIConnector readConnector = (JNDIConnector) ((DatabaseLogin) ((ServerSession) session) + JNDIConnector readConnector = (JNDIConnector) ((DatabaseLogin) ((ServerSession) aSession) .getReadConnectionPool().getLogin()).getConnector(); readConnector.setLookupType(JNDIConnector.STRING_LOOKUP);