[jboss-cvs] JBossAS SVN: r94882 - in projects/jboss-jca/trunk/api/src/main/java/javax/resource: cci and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 14 13:25:32 EDT 2009
Author: jesper.pedersen
Date: 2009-10-14 13:25:31 -0400 (Wed, 14 Oct 2009)
New Revision: 94882
Modified:
projects/jboss-jca/trunk/api/src/main/java/javax/resource/NotSupportedException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/ResourceException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/cci/ResourceWarning.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ApplicationServerInternalException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/CommException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ConnectionEvent.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/EISSystemException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/IllegalStateException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/InvalidPropertyException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/LocalTransactionException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ResourceAdapterInternalException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ResourceAllocationException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/SecurityException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/SharingViolationException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/UnavailableException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/security/PasswordCredential.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkCompletedException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkEvent.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkException.java
projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkRejectedException.java
Log:
[JBJCA-194] Add SerialVersionUID in the javax.resource API
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/NotSupportedException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/NotSupportedException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/NotSupportedException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* A <code>NotSupportedException</code> is thrown to indicate that
* callee (resource adapter
@@ -39,6 +42,37 @@
public class NotSupportedException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 1510031578141681454L;
+ }
+ else
+ {
+ serialVersionUID = -5433838894743521833L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/ResourceException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/ResourceException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/ResourceException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* This is the root interface of the exception hierarchy defined
* for the Connector architecture.
@@ -46,6 +49,38 @@
public class ResourceException extends Exception
{
+ /** Serial version UID */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 4770679801401540475L;
+ }
+ else
+ {
+ serialVersionUID = 547071213627824490L;
+ }
+ }
+
/** Vendor specific error code */
private String errorCode;
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/cci/ResourceWarning.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/cci/ResourceWarning.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/cci/ResourceWarning.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.cci;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* A <code>ResourceWarning</code> provides information on warnings related to
* execution of an interaction with an EIS. Warnings are silently
@@ -31,7 +34,38 @@
*/
public class ResourceWarning extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 4883365394555743885L;
+ }
+ else
+ {
+ serialVersionUID = 1233859030030360576L;
+ }
+ }
+
/**
* Constructs a new instance with null as its detail message.
*/
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ApplicationServerInternalException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ApplicationServerInternalException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ApplicationServerInternalException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.spi;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* An <code>ApplicationServerInternalException</code> is thrown
* by an application
@@ -37,6 +40,37 @@
public class ApplicationServerInternalException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = -7496452174776833078L;
+ }
+ else
+ {
+ serialVersionUID = -7784532393279374430L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/CommException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/CommException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/CommException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.spi;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* This indicates errors related to failed or interrupted
* communication with an EIS instance. Examples of common error conditions
@@ -34,6 +37,37 @@
*/
public class CommException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = -4522218827155509206L;
+ }
+ else
+ {
+ serialVersionUID = 5000980212339163591L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ConnectionEvent.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ConnectionEvent.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ConnectionEvent.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,12 @@
package javax.resource.spi;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.EventObject;
/** The ConnectionEvent class provides information about the source of
@@ -55,7 +61,15 @@
public class ConnectionEvent extends EventObject
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+ /** Persistence field information */
+ private static final ObjectStreamField[] serialPersistentFields;
+ private static final int ID_IDX = 0;
+ private static final int EXCEPTION_IDX = 1;
+ private static final int CONN_HANDLE_IDX = 2;
+
/** Event notification that an application component has closed the
* connection
**/
@@ -87,13 +101,58 @@
*
* @serial
**/
- private Exception exception;
+ private Exception e;
/** Type of the event
**/
protected int id;
private Object connectionHandle;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 2776168349823367611L;
+ serialPersistentFields = new ObjectStreamField[] {
+ /** @serialField id int */
+ new ObjectStreamField("id", int.class),
+ /** @serialField e Exception */
+ new ObjectStreamField("e", Exception.class),
+ /** @serialField connectionHandle Object */
+ new ObjectStreamField("connectionHandle", Object.class)
+ };
+ }
+ else
+ {
+ serialVersionUID = 5611772461379563249L;
+ serialPersistentFields = new ObjectStreamField[] {
+ /** @serialField id int */
+ new ObjectStreamField("id", int.class),
+ /** @serialField exception Exception */
+ new ObjectStreamField("exception", Exception.class),
+ /** @serialField connectionHandle Object */
+ new ObjectStreamField("connectionHandle", Object.class)
+ };
+ }
+ }
/**
* Construct a ConnectionEvent object. Exception defaults to null.
@@ -121,7 +180,7 @@
Exception exception)
{
super(source);
- this.exception = exception;
+ this.e = exception;
this.id = eid;
}
@@ -151,7 +210,7 @@
*/
public Exception getException()
{
- return exception;
+ return e;
}
/**
@@ -162,4 +221,38 @@
{
return id;
}
+
+ /**
+ * Read object
+ * @param ois The object input stream
+ * @exception ClassNotFoundException If a class can not be found
+ * @exception IOException Thrown if an error occurs
+ */
+ private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
+ {
+ ObjectInputStream.GetField fields = ois.readFields();
+ String name = serialPersistentFields[ID_IDX].getName();
+ this.id = fields.get(name, CONNECTION_ERROR_OCCURRED);
+ name = serialPersistentFields[EXCEPTION_IDX].getName();
+ this.e = (Exception) fields.get(name, null);
+ name = serialPersistentFields[CONN_HANDLE_IDX].getName();
+ this.connectionHandle = fields.get(name, null);
+ }
+
+ /**
+ * Write object
+ * @param oos The object output stream
+ * @exception IOException Thrown if an error occurs
+ */
+ private void writeObject(ObjectOutputStream oos) throws IOException
+ {
+ ObjectOutputStream.PutField fields = oos.putFields();
+ String name = serialPersistentFields[ID_IDX].getName();
+ fields.put(name, id);
+ name = serialPersistentFields[EXCEPTION_IDX].getName();
+ fields.put(name, e);
+ name = serialPersistentFields[CONN_HANDLE_IDX].getName();
+ fields.put(name, connectionHandle);
+ oos.writeFields();
+ }
}
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/EISSystemException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/EISSystemException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/EISSystemException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.spi;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* An <code>EISSystemException</code> is used to indicate any EIS
* specific system-level
@@ -36,6 +39,37 @@
public class EISSystemException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 5912222091656752433L;
+ }
+ else
+ {
+ serialVersionUID = 5753172122428814004L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/IllegalStateException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/IllegalStateException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/IllegalStateException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.spi;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* An <code>IllegalStateException</code>
* is thrown from a method if the callee (resource
@@ -35,6 +38,37 @@
public class IllegalStateException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = -150139934550438352L;
+ }
+ else
+ {
+ serialVersionUID = 3473092818417322126L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/InvalidPropertyException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/InvalidPropertyException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/InvalidPropertyException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -23,6 +23,8 @@
package javax.resource.spi;
import java.beans.PropertyDescriptor;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
/**
* This exception is thrown to indicate invalid configuration
@@ -33,7 +35,39 @@
*/
public class InvalidPropertyException extends javax.resource.ResourceException
{
- /*
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = -2395559483586818078L;
+ }
+ else
+ {
+ serialVersionUID = -485903720300735741L;
+ }
+ }
+
+ /**
* Holder for invalid properties.
*/
private PropertyDescriptor[] invalidProperties;
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/LocalTransactionException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/LocalTransactionException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/LocalTransactionException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.spi;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* A <code>LocalTransactionException</code> represents various
* error conditions related to the local transaction management contract.
@@ -57,6 +60,37 @@
public class LocalTransactionException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 4704131764458675746L;
+ }
+ else
+ {
+ serialVersionUID = 7495828853103281459L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ResourceAdapterInternalException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ResourceAdapterInternalException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ResourceAdapterInternalException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.spi;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* A <code>ResourceAdapterInternalException</code> indicates any
* system-level error conditions related to a resource adapter.
@@ -42,6 +45,37 @@
public class ResourceAdapterInternalException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 7184712099852216323L;
+ }
+ else
+ {
+ serialVersionUID = -1666678251804763325L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ResourceAllocationException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ResourceAllocationException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/ResourceAllocationException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.spi;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* A <code>ResourceAllocationException</code> can be thrown by an
* application server or
@@ -38,6 +41,37 @@
public class ResourceAllocationException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = -2680085755660844424L;
+ }
+ else
+ {
+ serialVersionUID = -9036793565852998502L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/SecurityException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/SecurityException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/SecurityException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,9 @@
package javax.resource.spi;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* A <code>SecurityException</code> indicates error conditions
* related to the security
@@ -49,6 +52,37 @@
public class SecurityException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 5003890345420586914L;
+ }
+ else
+ {
+ serialVersionUID = -7609456980660658364L;
+ }
+ }
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/SharingViolationException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/SharingViolationException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/SharingViolationException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -33,6 +33,8 @@
*/
public class SharingViolationException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID = -1280304091132682215L;
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/UnavailableException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/UnavailableException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/UnavailableException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -30,6 +30,9 @@
*/
public class UnavailableException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID = -2495485036033570467L;
+
/**
* Constructs a new instance with null as its detail message.
*/
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/security/PasswordCredential.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/security/PasswordCredential.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/security/PasswordCredential.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -37,6 +37,9 @@
public final class PasswordCredential implements java.io.Serializable
{
+ /** Serial version uid */
+ private static final long serialVersionUID = -1770833344350711674L;
+
private String userName;
private char[] password;
private ManagedConnectionFactory mcf;
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkCompletedException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkCompletedException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkCompletedException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -46,6 +46,8 @@
*/
public class WorkCompletedException extends WorkException
{
+ /** Serial version uid */
+ private static final long serialVersionUID = -229158982387790244L;
/**
* Constructs a new instance with null as its detail message.
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkEvent.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkEvent.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkEvent.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -22,6 +22,12 @@
package javax.resource.spi.work;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.EventObject;
/**
@@ -33,6 +39,16 @@
*/
public class WorkEvent extends EventObject
{
+ /** Serial version uid */
+ private static final long serialVersionUID;
+
+ /** Persistence fields information */
+ private static final ObjectStreamField[] serialPersistentFields;
+ private static final int TYPE_IDX = 0;
+ private static final int WORK_IDX = 1;
+ private static final int EXCPEPTION_IDX = 2;
+ private static final int DURATION_IDX = 2;
+
/**
* Indicates <code>Work</code> instance has been accepted.
*/
@@ -66,13 +82,63 @@
/**
* The exception that occured during <code>Work</code> processing.
*/
- private WorkException exc;
+ private WorkException e;
/**
* The start delay duration (in milliseconds).
*/
private long startDuration = WorkManager.UNKNOWN;
+
+ static
+ {
+ Boolean legacy = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Boolean run()
+ {
+ try
+ {
+ if (System.getProperty("org.jboss.j2ee.LegacySerialization") != null)
+ return Boolean.TRUE;
+ }
+ catch (Throwable ignored)
+ {
+ // Ignore
+ }
+ return Boolean.FALSE;
+ }
+ });
+
+ if (Boolean.TRUE.equals(legacy))
+ {
+ serialVersionUID = 6971276136970053051L;
+ serialPersistentFields = new ObjectStreamField[] {
+ /** @serialField type int */
+ new ObjectStreamField("type", int.class),
+ /** @serialField work Work */
+ new ObjectStreamField("work", Work.class),
+ /** @serialField exception WorkException */
+ new ObjectStreamField("e", WorkException.class),
+ /** @serialField startDuration long */
+ new ObjectStreamField("startDuration", long.class)
+ };
+ }
+ else
+ {
+ serialVersionUID = -3063612635015047218L;
+ serialPersistentFields = new ObjectStreamField[] {
+ /** @serialField type int */
+ new ObjectStreamField("type", int.class),
+ /** @serialField work Work */
+ new ObjectStreamField("work", Work.class),
+ /** @serialField exception WorkException */
+ new ObjectStreamField("exception", WorkException.class),
+ /** @serialField startDuration long */
+ new ObjectStreamField("startDuration", long.class)
+ };
+ }
+ }
+
/**
* Constructor.
*
@@ -92,7 +158,7 @@
super(source);
this.type = type;
this.work = work;
- this.exc = exc;
+ this.e = exc;
}
/**
@@ -162,6 +228,44 @@
*/
public WorkException getException()
{
- return this.exc;
+ return this.e;
}
+
+ /**
+ * Read object
+ * @param ois The object input stream
+ * @exception ClassNotFoundException If a class can not be found
+ * @exception IOException Thrown if an error occurs
+ */
+ private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
+ {
+ ObjectInputStream.GetField fields = ois.readFields();
+ String name = serialPersistentFields[TYPE_IDX].getName();
+ this.type = fields.get(name, 0);
+ name = serialPersistentFields[WORK_IDX].getName();
+ this.work = (Work) fields.get(name, null);
+ name = serialPersistentFields[EXCPEPTION_IDX].getName();
+ this.e = (WorkException) fields.get(name, null);
+ name = serialPersistentFields[DURATION_IDX].getName();
+ this.startDuration = fields.get(name, 0L);
+ }
+
+ /**
+ * Write object
+ * @param oos The object output stream
+ * @exception IOException Thrown if an error occurs
+ */
+ private void writeObject(ObjectOutputStream oos) throws IOException
+ {
+ ObjectOutputStream.PutField fields = oos.putFields();
+ String name = serialPersistentFields[TYPE_IDX].getName();
+ fields.put(name, type);
+ name = serialPersistentFields[WORK_IDX].getName();
+ fields.put(name, work);
+ name = serialPersistentFields[EXCPEPTION_IDX].getName();
+ fields.put(name, e);
+ name = serialPersistentFields[DURATION_IDX].getName();
+ fields.put(name, startDuration);
+ oos.writeFields();
+ }
}
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -30,6 +30,9 @@
*/
public class WorkException extends javax.resource.ResourceException
{
+ /** Serial version uid */
+ private static final long serialVersionUID = 6360106395593829940L;
+
/**
* Indicates an internal error condition.
*/
Modified: projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkRejectedException.java
===================================================================
--- projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkRejectedException.java 2009-10-14 17:14:07 UTC (rev 94881)
+++ projects/jboss-jca/trunk/api/src/main/java/javax/resource/spi/work/WorkRejectedException.java 2009-10-14 17:25:31 UTC (rev 94882)
@@ -40,6 +40,8 @@
*/
public class WorkRejectedException extends WorkException
{
+ /** Serial version uid */
+ private static final long serialVersionUID = -687129544691878081L;
/**
* Constructs a new instance with null as its detail message.
More information about the jboss-cvs-commits
mailing list