Author: richard.opalka(a)jboss.com
Date: 2008-02-27 06:01:42 -0500 (Wed, 27 Feb 2008)
New Revision: 5818
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMDeploymentAspect.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMStore.java
Log:
fix synchronization issue + remove useless code
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMDeploymentAspect.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMDeploymentAspect.java 2008-02-27
10:39:59 UTC (rev 5817)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMDeploymentAspect.java 2008-02-27
11:01:42 UTC (rev 5818)
@@ -52,7 +52,6 @@
{
InvocationHandler origInvHandler = ep.getInvocationHandler();
InvocationHandler wsrmInvHandler = new RMInvocationHandler(origInvHandler,
(ArchiveDeployment)dep);
- // TODO: implement wsrm data dir clean up here
ep.setInvocationHandler(wsrmInvHandler);
RMHelper.setupRMOperations(sepMetaData);
log.info("WS-RM invocation handler associated with endpoint " +
ep.getAddress());
@@ -70,7 +69,7 @@
{
RMInvocationHandler rmInvHandler = (RMInvocationHandler)invHandler;
ep.setInvocationHandler(rmInvHandler.getDelegate());
- log.info("WS-RM invocation handler removed from endpoint " +
ep.getAddress());
+ log.info("WS-RM invocation handler removed for endpoint " +
ep.getAddress());
}
}
}
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java 2008-02-27
10:39:59 UTC (rev 5817)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java 2008-02-27
11:01:42 UTC (rev 5818)
@@ -121,7 +121,7 @@
* @param inv invocation
* @return RM response context to be set after target endpoint invocation
*/
- private synchronized Map<String, Object> prepareResponseContext(Endpoint ep,
Invocation inv)
+ private static synchronized Map<String, Object> prepareResponseContext(Endpoint
ep, Invocation inv, String dataDir)
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
AddressingProperties addrProps =
(AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
@@ -268,7 +268,7 @@
@Override
public final void invoke(Endpoint ep, Invocation inv) throws Exception
{
- Map<String, Object> rmResponseContext = prepareResponseContext(ep, inv);
+ Map<String, Object> rmResponseContext = prepareResponseContext(ep, inv,
this.dataDir);
if (inv.getJavaMethod() != null)
{
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java 2008-02-27
10:39:59 UTC (rev 5817)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMServerSequence.java 2008-02-27
11:01:42 UTC (rev 5818)
@@ -21,18 +21,18 @@
*/
package org.jboss.ws.extensions.wsrm.server;
-import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
+import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.util.Iterator;
+import java.io.ByteArrayOutputStream;
+
import java.util.Set;
import java.util.TreeSet;
+import java.util.Iterator;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.extensions.addressing.AddressingClientUtil;
import org.jboss.ws.extensions.wsrm.RMSequence;
@@ -124,16 +124,6 @@
return this.outboundId;
}
- public void serialize()
- {
- throw new NotImplementedException();
- }
-
- public void deserialize()
- {
- throw new NotImplementedException();
- }
-
public final void addReceivedInboundMessage(long messageId)
{
this.receivedInboundMessages.add(messageId);
@@ -173,6 +163,11 @@
{
return this.receivedInboundMessages;
}
+
+ public long getCreationTime()
+ {
+ return this.creationTime;
+ }
public void close()
{
@@ -211,7 +206,7 @@
public String toString()
{
- return this.inboundId + " - " + this.outboundId;
+ return this.sequenceId + "[" + this.inboundId + " - " +
this.outboundId + "]";
}
}
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMStore.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMStore.java 2008-02-27
10:39:59 UTC (rev 5817)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/server/RMStore.java 2008-02-27
11:01:42 UTC (rev 5818)
@@ -81,6 +81,10 @@
{
return sequence;
}
+ if ((sequence.getCreationTime() + sequence.getDuration()) >=
System.currentTimeMillis())
+ {
+ sequences[i].delete(); // clean up timeouted sequences
+ }
}
catch (IOException ioe)
{
Show replies by date