Author: struberg
Date: Wed Feb 20 09:05:08 2013
New Revision: 1448044
URL: http://svn.apache.org/r1448044
Log:
OWB-781 remove javassist from failover and fix broken tests
Added:
openwebbeans/trunk/webbeans-clustering/src/test/resources/
openwebbeans/trunk/webbeans-clustering/src/test/resources/META-INF/
openwebbeans/trunk/webbeans-clustering/src/test/resources/META-INF/openwebbeans/
openwebbeans/trunk/webbeans-clustering/src/test/resources/META-INF/openwebbeans/openwebbeans.properties
Removed:
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/OwbProxyObjectInputStream.java
Modified:
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/FailOverBag.java
openwebbeans/trunk/webbeans-clustering/src/test/java/org/apache/webbeans/web/failover/tests/MockConversationService.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java
openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/FailOverService.java
Modified:
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java?rev=1448044&r1=1448043&r2=1448044&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
(original)
+++
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
Wed Feb 20 09:05:08 2013
@@ -31,8 +31,6 @@ import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
-import javassist.util.proxy.ProxyObjectOutputStream;
-
import javax.enterprise.context.Conversation;
import javax.enterprise.inject.spi.Bean;
import javax.servlet.http.HttpSession;
@@ -327,18 +325,20 @@ public class DefaultOwbFailOverService i
*/
public ObjectInputStream getObjectInputStream(InputStream in) throws
IOException
{
- return new OwbProxyObjectInputStream(in);
+ return new ObjectInputStream(in);
}
/**
* Get object output stream. Note, the stream should support deserialize
* javassist objects.
- *
+ *
+ * @deprecated as we do not use Javassist anymore this is not needed
anymore!
+ *
* @return custom object output stream.
*/
public ObjectOutputStream getObjectOutputStream(OutputStream out) throws
IOException
{
- return new ProxyObjectOutputStream(out);
+ return new ObjectOutputStream(out);
}
public String getJvmId()
Modified:
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/FailOverBag.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/FailOverBag.java?rev=1448044&r1=1448043&r2=1448044&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/FailOverBag.java
(original)
+++
openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/FailOverBag.java
Wed Feb 20 09:05:08 2013
@@ -126,8 +126,9 @@ public class FailOverBag implements Seri
return;
}
- // We could not directly use java object stream since we are using
javassist.
- // Serialize the bag by use javassist object stream.
+ // In old times (< OWB-1.2.0) We could not directly use java object
stream since we were using javassist.
+ // Thus we had to serialize the bag by use javassist object stream.
+ // this is needed anymore since owb-1.2.0!
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = failOverService.getObjectOutputStream(baos);
oos.writeObject(items);
Modified:
openwebbeans/trunk/webbeans-clustering/src/test/java/org/apache/webbeans/web/failover/tests/MockConversationService.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-clustering/src/test/java/org/apache/webbeans/web/failover/tests/MockConversationService.java?rev=1448044&r1=1448043&r2=1448044&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-clustering/src/test/java/org/apache/webbeans/web/failover/tests/MockConversationService.java
(original)
+++
openwebbeans/trunk/webbeans-clustering/src/test/java/org/apache/webbeans/web/failover/tests/MockConversationService.java
Wed Feb 20 09:05:08 2013
@@ -25,8 +25,14 @@ import org.apache.webbeans.spi.Conversat
public class MockConversationService implements ConversationService
{
- private String conversationId;
- private String sessionId;
+ private final String conversationId;
+ private final String sessionId;
+
+
+ public MockConversationService() {
+ this.conversationId = "0815";
+ this.sessionId = "dummySession";
+ }
public MockConversationService(HttpSession session, Conversation
conversation)
{
Added:
openwebbeans/trunk/webbeans-clustering/src/test/resources/META-INF/openwebbeans/openwebbeans.properties
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-clustering/src/test/resources/META-INF/openwebbeans/openwebbeans.properties?rev=1448044&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-clustering/src/test/resources/META-INF/openwebbeans/openwebbeans.properties
(added)
+++
openwebbeans/trunk/webbeans-clustering/src/test/resources/META-INF/openwebbeans/openwebbeans.properties
Wed Feb 20 09:05:08 2013
@@ -0,0 +1,27 @@
+#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.
+#---------------------------------------------------------------
+# The Clustering TEST configuration for OpenWebBeans
+#
+#---------------------------------------------------------------
+configuration.ordinal=120
+
+################################### Default Conversation Service
###############################
+#Default implementation of org.apache.webbeans.corespi.ConversationService.
+org.apache.webbeans.spi.ConversationService=org.apache.webbeans.web.failover.tests.MockConversationService
+################################################################################################
+
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java?rev=1448044&r1=1448043&r2=1448044&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java
Wed Feb 20 09:05:08 2013
@@ -58,7 +58,7 @@ public class ConversationProducer extend
if (conversationId != null)
{
//Gets propogated conversation
- conversation =
webBeansContext.getConversationManager().getPropogatedConversation(conversationId,sessionId);
+ conversation =
webBeansContext.getConversationManager().getPropogatedConversation(conversationId,
sessionId);
}
if (conversation == null)
Modified:
openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/FailOverService.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/FailOverService.java?rev=1448044&r1=1448043&r2=1448044&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/FailOverService.java
(original)
+++
openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/FailOverService.java
Wed Feb 20 09:05:08 2013
@@ -98,7 +98,10 @@ public interface FailOverService
* Container provided object input stream.
*
* Note, the stream should support deserializing javassist objects.
- *
+ *
+ * @deprecated we do not use javassist anymore since owb-1.2.0, thus no
special handling is needed!
+ *
+ *
* @return custom object input stream.
*/
public ObjectInputStream getObjectInputStream(InputStream in) throws
IOException;
@@ -107,7 +110,9 @@ public interface FailOverService
* Container provided object output stream.
*
* Note, the stream should support serializing javassist objects.
- *
+ *
+ * @deprecated as we do not use Javassist anymore this is not needed
anymore!
+ *
* @return custom object output stream.
*/
public ObjectOutputStream getObjectOutputStream(OutputStream out) throws
IOException;