Author: veithen
Date: Fri Jan 12 00:55:54 2018
New Revision: 1820941
URL: http://svn.apache.org/viewvc?rev=1820941&view=rev
Log:
Tentative solution for AXIS2-5904.
Added:
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/OpaqueInstant.java
(with props)
Modified:
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/PolicySubject.java
Modified:
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java?rev=1820941&r1=1820940&r2=1820941&view=diff
==============================================================================
---
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
(original)
+++
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
Fri Jan 12 00:55:54 2018
@@ -53,7 +53,7 @@ public class AxisBindingMessage extends
private boolean fault = false;
private volatile Policy effectivePolicy = null;
- private volatile Date lastPolicyCalculatedTime = null;
+ private volatile OpaqueInstant lastPolicyCalculatedTime = null;
public boolean isFault() {
return fault;
@@ -225,7 +225,7 @@ public class AxisBindingMessage extends
synchronized (this) {
if (lastPolicyCalculatedTime == null || isPolicyUpdated()) {
effectivePolicy = calculateEffectivePolicy();
- lastPolicyCalculatedTime = new Date();
+ lastPolicyCalculatedTime = new OpaqueInstant();
}
}
}
Modified:
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisMessage.java?rev=1820941&r1=1820940&r2=1820941&view=diff
==============================================================================
---
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
(original)
+++
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
Fri Jan 12 00:55:54 2018
@@ -37,7 +37,6 @@ import org.apache.ws.commons.schema.XmlS
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Date;
import java.util.List;
@@ -67,7 +66,7 @@ public class AxisMessage extends AxisDes
private boolean wrapped = true;
private volatile Policy effectivePolicy = null;
- private volatile Date lastPolicyCalculatedTime = null;
+ private volatile OpaqueInstant lastPolicyCalculatedTime = null;
public String getMessagePartName() {
return messagePartName;
@@ -241,7 +240,7 @@ public class AxisMessage extends AxisDes
synchronized (this) {
if (lastPolicyCalculatedTime == null || isPolicyUpdated()) {
effectivePolicy = calculateEffectivePolicy();
- lastPolicyCalculatedTime = new Date();
+ lastPolicyCalculatedTime = new OpaqueInstant();
}
}
}
Added:
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/OpaqueInstant.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/OpaqueInstant.java?rev=1820941&view=auto
==============================================================================
---
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/OpaqueInstant.java
(added)
+++
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/OpaqueInstant.java
Fri Jan 12 00:55:54 2018
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.axis2.description;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+public final class OpaqueInstant {
+ private static final AtomicInteger nextSequence = new AtomicInteger();
+
+ private final int sequence;
+
+ public OpaqueInstant() {
+ sequence = nextSequence.getAndIncrement();
+ }
+
+ public boolean after(OpaqueInstant when) {
+ return sequence > when.sequence;
+ }
+}
Propchange:
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/OpaqueInstant.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/PolicySubject.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/PolicySubject.java?rev=1820941&r1=1820940&r2=1820941&view=diff
==============================================================================
---
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/PolicySubject.java
(original)
+++
axis/axis2/java/core/branches/AXIS2-5904/modules/kernel/src/org/apache/axis2/description/PolicySubject.java
Fri Jan 12 00:55:54 2018
@@ -25,13 +25,12 @@ import org.apache.neethi.PolicyComponent
import org.apache.neethi.PolicyReference;
import java.util.Collection;
-import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
public class PolicySubject {
- private Date lastUpdatedTime = new Date();
+ private OpaqueInstant lastUpdatedTime = new OpaqueInstant();
private ConcurrentHashMap<String, PolicyComponent>
attachedPolicyComponents = new ConcurrentHashMap<String, PolicyComponent>();
@@ -49,7 +48,7 @@ public class PolicySubject {
public void attachPolicyReference(PolicyReference reference) {
attachedPolicyComponents.put(reference.getURI(), reference);
- setLastUpdatedTime(new Date());
+ setLastUpdatedTime(new OpaqueInstant());
}
public void attachPolicyComponents(List<PolicyComponent> policyComponents)
{
@@ -74,7 +73,7 @@ public class PolicySubject {
public void attachPolicyComponent(String key,
PolicyComponent policyComponent) {
attachedPolicyComponents.put(key, policyComponent);
- setLastUpdatedTime(new Date());
+ setLastUpdatedTime(new OpaqueInstant());
}
public PolicyComponent getAttachedPolicyComponent(String key) {
@@ -94,24 +93,24 @@ public class PolicySubject {
"policy doesn't have a name or an id ");
}
attachedPolicyComponents.put(key, policy);
- setLastUpdatedTime(new Date());
+ setLastUpdatedTime(new OpaqueInstant());
}
public void detachPolicyComponent(String key) {
attachedPolicyComponents.remove(key);
- setLastUpdatedTime(new Date());
+ setLastUpdatedTime(new OpaqueInstant());
}
public void clear() {
attachedPolicyComponents.clear();
- setLastUpdatedTime(new Date());
+ setLastUpdatedTime(new OpaqueInstant());
}
- public Date getLastUpdatedTime() {
+ public OpaqueInstant getLastUpdatedTime() {
return lastUpdatedTime;
}
- public void setLastUpdatedTime(Date lastUpdatedTime) {
+ public void setLastUpdatedTime(OpaqueInstant lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}
}