Author: steve.ebersole(a)jboss.com
Date: 2008-03-18 01:54:15 -0400 (Tue, 18 Mar 2008)
New Revision: 14450
Modified:
core/trunk/core/src/main/java/org/hibernate/context/CurrentSessionContext.java
core/trunk/core/src/main/java/org/hibernate/context/JTASessionContext.java
core/trunk/core/src/main/java/org/hibernate/context/ManagedSessionContext.java
core/trunk/core/src/main/java/org/hibernate/context/ThreadLocalSessionContext.java
Log:
copyright headers
Modified: core/trunk/core/src/main/java/org/hibernate/context/CurrentSessionContext.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/context/CurrentSessionContext.java 2008-03-18
05:48:53 UTC (rev 14449)
+++
core/trunk/core/src/main/java/org/hibernate/context/CurrentSessionContext.java 2008-03-18
05:54:15 UTC (rev 14450)
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
package org.hibernate.context;
import org.hibernate.HibernateException;
@@ -5,8 +28,8 @@
import java.io.Serializable;
/**
- * Defines the contract for implementations which know how to
- * scope the notion of a {@link org.hibernate.SessionFactory#getCurrentSession() current
session}.
+ * Defines the contract for implementations which know how to scope the notion
+ * of a {@link org.hibernate.SessionFactory#getCurrentSession() current session}.
* <p/>
* Implementations should adhere to the following:
* <ul>
@@ -22,7 +45,7 @@
* Note that there will be exactly one instance of the configured
* CurrentSessionContext implementation per {@link org.hibernate.SessionFactory}.
*
- * @author <a href="mailto:steve@hibernate.org">Steve Ebersole
</a>
+ * @author Steve Ebersole
*/
public interface CurrentSessionContext extends Serializable {
/**
@@ -30,7 +53,7 @@
* by this implementation.
*
* @return The current session.
- * @throws org.hibernate.HibernateException Typically indicates an issue
+ * @throws HibernateException Typically indicates an issue
* locating or creating the current session.
*/
public org.hibernate.classic.Session currentSession() throws HibernateException;
Modified: core/trunk/core/src/main/java/org/hibernate/context/JTASessionContext.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/context/JTASessionContext.java 2008-03-18
05:48:53 UTC (rev 14449)
+++ core/trunk/core/src/main/java/org/hibernate/context/JTASessionContext.java 2008-03-18
05:54:15 UTC (rev 14450)
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
package org.hibernate.context;
import org.hibernate.HibernateException;
@@ -48,13 +71,16 @@
this.factory = factory;
}
+ /**
+ * {@inheritDoc}
+ */
public Session currentSession() throws HibernateException {
TransactionManager transactionManager = factory.getTransactionManager();
if ( transactionManager == null ) {
throw new HibernateException( "No TransactionManagerLookup specified" );
}
- Transaction txn = null;
+ Transaction txn;
try {
txn = transactionManager.getTransaction();
if ( txn == null ) {
@@ -158,9 +184,15 @@
this.context = context;
}
+ /**
+ * {@inheritDoc}
+ */
public void beforeCompletion() {
}
+ /**
+ * {@inheritDoc}
+ */
public void afterCompletion(int i) {
context.currentSessionMap.remove( txn );
}
Modified: core/trunk/core/src/main/java/org/hibernate/context/ManagedSessionContext.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/context/ManagedSessionContext.java 2008-03-18
05:48:53 UTC (rev 14449)
+++
core/trunk/core/src/main/java/org/hibernate/context/ManagedSessionContext.java 2008-03-18
05:54:15 UTC (rev 14450)
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
package org.hibernate.context;
import org.hibernate.classic.Session;
@@ -42,7 +65,7 @@
}
/**
- * @see CurrentSessionContext#currentSession
+ * {@inheritDoc}
*/
public Session currentSession() {
Session current = existingSession( factory );
Modified:
core/trunk/core/src/main/java/org/hibernate/context/ThreadLocalSessionContext.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/context/ThreadLocalSessionContext.java 2008-03-18
05:48:53 UTC (rev 14449)
+++
core/trunk/core/src/main/java/org/hibernate/context/ThreadLocalSessionContext.java 2008-03-18
05:54:15 UTC (rev 14450)
@@ -42,9 +42,9 @@
* The {@link #buildOrObtainSession}, {@link #isAutoCloseEnabled},
* {@link #isAutoFlushEnabled}, {@link #getConnectionReleaseMode}, and
* {@link #buildCleanupSynch} methods are all provided to allow easy
- * subclassing (for long- running session scenarios, for example).
+ * subclassing (for long-running session scenarios, for example).
*
- * @author <a href="mailto:steve@hibernate.org">Steve Ebersole
</a>
+ * @author Steve Ebersole
*/
public class ThreadLocalSessionContext implements CurrentSessionContext {
@@ -70,6 +70,9 @@
this.factory = factory;
}
+ /**
+ * {@inheritDoc}
+ */
public final Session currentSession() throws HibernateException {
Session current = existingSession( factory );
if (current == null) {
@@ -94,6 +97,11 @@
&& ! ( Proxy.getInvocationHandler( session ) instanceof
TransactionProtectionWrapper ) );
}
+ /**
+ * Getter for property 'factory'.
+ *
+ * @return Value for property 'factory'.
+ */
protected SessionFactoryImplementor getFactory() {
return factory;
}
@@ -244,9 +252,15 @@
this.factory = factory;
}
+ /**
+ * {@inheritDoc}
+ */
public void beforeCompletion() {
}
+ /**
+ * {@inheritDoc}
+ */
public void afterCompletion(int i) {
unbind( factory );
}
@@ -260,6 +274,9 @@
this.realSession = realSession;
}
+ /**
+ * {@inheritDoc}
+ */
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
try {
// If close() is called, guarantee unbind()
@@ -310,6 +327,11 @@
}
}
+ /**
+ * Setter for property 'wrapped'.
+ *
+ * @param wrapped Value to set for property 'wrapped'.
+ */
public void setWrapped(Session wrapped) {
this.wrappedSession = wrapped;
}