activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1034513 - in /activemq/activemq-apollo/trunk: apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/ apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/ apollo-cassandra/src/main/resources/org/ apollo...
Date Fri, 12 Nov 2010 18:55:26 GMT
Author: chirino
Date: Fri Nov 12 18:55:24 2010
New Revision: 1034513

URL: http://svn.apache.org/viewvc?rev=1034513&view=rev
Log:
Moved all the cassandra dto bits into the cassandra module.

Added:
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/xml-packages.index
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index
      - copied, changed from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/package-info.java
      - copied, changed from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/dto/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/dto/CassandraStoreDTO.java
      - copied, changed from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/store/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/store/cassandra/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/store/cassandra/dto/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index
      - copied, changed from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
    activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/store/cassandra/dto/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/store/cassandra/dto/simple.xml
    activemq/activemq-apollo/trunk/apollo-cassandra/src/test/scala/org/apache/activemq/apollo/store/cassandra/dto/
    activemq/activemq-apollo/trunk/apollo-cassandra/src/test/scala/org/apache/activemq/apollo/store/cassandra/dto/XmlCodecTest.java
      - copied, changed from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java
      - copied, changed from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/SimpleStoreStatusDTO.java
      - copied, changed from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
Removed:
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
Modified:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBClient.scala
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBClient.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBClient.scala?rev=1034513&r1=1034512&r2=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBClient.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBClient.scala
Fri Nov 12 18:55:24 2010
@@ -20,7 +20,6 @@ import dto.BDBStoreDTO
 import java.{lang=>jl}
 import java.{util=>ju}
 
-import org.apache.activemq.apollo.dto.HawtDBStoreDTO
 import java.util.concurrent.atomic.AtomicInteger
 import collection.mutable.ListBuffer
 import org.apache.activemq.apollo.store._

Added: activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/xml-packages.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/xml-packages.index?rev=1034513&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/xml-packages.index
(added)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/xml-packages.index
Fri Nov 12 18:55:24 2010
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+org.apache.activemq.apollo.store.cassandra.dto
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index
(from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index?p2=activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index&r1=1034511&r2=1034513&rev=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index
Fri Nov 12 18:55:24 2010
@@ -14,29 +14,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # ------------------------------------------------------------------------
-BrokerDTO
-BrokerStatusDTO
-BrokerSummaryDTO
-CassandraStoreDTO
-ConnectionStatusDTO
-ConnectorDTO
-ConnectorStatusDTO
-DestinationStatusDTO
-EntryStatusDTO
-IntMetricDTO
-LongIdDTO
-LongIdLabeledDTO
-LongIdListDTO
-QueueStatusDTO
-ServiceDTO
-ServiceStatusDTO
-StoreDTO
-StoreStatusDTO
-StringIdDTO
-StringIdLabeledDTO
-StringIdListDTO
-TimeMetricDTO
-VirtualHostDTO
-VirtualHostStatusDTO
-StompConnectionStatusDTO
-KeyStorageDTO
\ No newline at end of file
+CassandraStoreDTO
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/package-info.java
(from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/package-info.java?p2=activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/package-info.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java&r1=1034511&r2=1034513&rev=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/org/apache/activemq/apollo/store/cassandra/dto/package-info.java
Fri Nov 12 18:55:24 2010
@@ -14,26 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.dto;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import javax.xml.bind.annotation.*;
-import java.util.ArrayList;
 
 /**
- * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ * The JAXB POJOs for the
+ * The JAXB POJOs for the
+ * <a href="http://activemq.apache.org/schema/activemq/apollo/xml-configuration.html">XML
Configuration</a>
+ * of the ActiveMQ Broker.
  */
-@XmlRootElement(name="cassandra-store")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CassandraStoreDTO extends StoreDTO {
-
-    @JsonProperty
-    @XmlAttribute
-    public String keyspace;
-
-    @JsonProperty
-    @XmlElement(required=true)
-    public ArrayList<String> hosts = new ArrayList<String>();    
-
-}
+@javax.xml.bind.annotation.XmlSchema(
+        namespace = "http://activemq.apache.org/schema/activemq/apollo",
+        elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.activemq.apollo.store.cassandra.dto;
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala?rev=1034513&r1=1034512&r2=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala
Fri Nov 12 18:55:24 2010
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.apollo.store.cassandra
 
+import dto.CassandraStoreDTO
+import org.apache.activemq.apollo.dto._
 import org.fusesource.hawtdispatch.BaseRetained
 import com.shorrockin.cascal.session._
 import java.util.concurrent.atomic.AtomicLong
@@ -26,7 +28,6 @@ import com.shorrockin.cascal.utils.Conve
 import org.fusesource.hawtdispatch._
 import org.fusesource.hawtdispatch.ListEventAggregator
 import java.util.concurrent._
-import org.apache.activemq.apollo.dto._
 import org.apache.activemq.apollo.store._
 import org.apache.activemq.apollo.util._
 import ReporterLevel._
@@ -88,7 +89,7 @@ class CassandraStore extends DelayingSto
 
 
   def storeStatusDTO(callback:(StoreStatusDTO)=>Unit) = dispatchQueue {
-    val rc = new StoreStatusDTO
+    val rc = new SimpleStoreStatusDTO
     rc.state = serviceState.toString
     rc.state_since = serviceState.since
     callback(rc)

Modified: activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStoreFactory.scala?rev=1034513&r1=1034512&r2=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStoreFactory.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStoreFactory.scala
Fri Nov 12 18:55:24 2010
@@ -16,10 +16,11 @@
  */
 package org.apache.activemq.apollo.store.cassandra
 
+import dto.CassandraStoreDTO
 import org.apache.activemq.apollo.store.StoreFactory
-import org.apache.activemq.apollo.dto.{CassandraStoreDTO, StoreDTO}
 import org.apache.activemq.apollo.util._
 import ReporterLevel._
+import org.apache.activemq.apollo.dto.StoreDTO
 
 /**
  * <p>

Copied: activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/dto/CassandraStoreDTO.java
(from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/dto/CassandraStoreDTO.java?p2=activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/dto/CassandraStoreDTO.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java&r1=1034511&r2=1034513&rev=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/dto/CassandraStoreDTO.java
Fri Nov 12 18:55:24 2010
@@ -14,8 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.dto;
+package org.apache.activemq.apollo.store.cassandra.dto;
 
+import org.apache.activemq.apollo.dto.StoreDTO;
 import org.codehaus.jackson.annotate.JsonProperty;
 
 import javax.xml.bind.annotation.*;

Copied: activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index
(from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index?p2=activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index&r1=1034511&r2=1034513&rev=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/resources/scala/org/apache/activemq/apollo/store/cassandra/dto/jaxb.index
Fri Nov 12 18:55:24 2010
@@ -14,29 +14,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # ------------------------------------------------------------------------
-BrokerDTO
-BrokerStatusDTO
-BrokerSummaryDTO
-CassandraStoreDTO
-ConnectionStatusDTO
-ConnectorDTO
-ConnectorStatusDTO
-DestinationStatusDTO
-EntryStatusDTO
-IntMetricDTO
-LongIdDTO
-LongIdLabeledDTO
-LongIdListDTO
-QueueStatusDTO
-ServiceDTO
-ServiceStatusDTO
-StoreDTO
-StoreStatusDTO
-StringIdDTO
-StringIdLabeledDTO
-StringIdListDTO
-TimeMetricDTO
-VirtualHostDTO
-VirtualHostStatusDTO
-StompConnectionStatusDTO
-KeyStorageDTO
\ No newline at end of file
+BDBStoreDTO
+BDBStoreStatusDTO

Added: activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/store/cassandra/dto/simple.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/store/cassandra/dto/simple.xml?rev=1034513&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/store/cassandra/dto/simple.xml
(added)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/store/cassandra/dto/simple.xml
Fri Nov 12 18:55:24 2010
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<broker basedir="./activemq-data/default" id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+    <virtual-host enabled="true" id="vh-local">
+        <host-name>localhost</host-name>
+        <cassandra-store keyspace="vh-local"/>
+    </virtual-host>
+</broker>

Copied: activemq/activemq-apollo/trunk/apollo-cassandra/src/test/scala/org/apache/activemq/apollo/store/cassandra/dto/XmlCodecTest.java
(from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/test/scala/org/apache/activemq/apollo/store/cassandra/dto/XmlCodecTest.java?p2=activemq/activemq-apollo/trunk/apollo-cassandra/src/test/scala/org/apache/activemq/apollo/store/cassandra/dto/XmlCodecTest.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java&r1=1034511&r2=1034513&rev=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/test/scala/org/apache/activemq/apollo/store/cassandra/dto/XmlCodecTest.java
Fri Nov 12 18:55:24 2010
@@ -14,30 +14,40 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.dto;
+package org.apache.activemq.apollo.store.cassandra.dto;
 
-import org.codehaus.jackson.annotate.JsonTypeInfo;
+import org.apache.activemq.apollo.dto.BrokerDTO;
+import org.apache.activemq.apollo.dto.VirtualHostDTO;
+import org.apache.activemq.apollo.dto.XmlCodec;
+import org.junit.Test;
+
+import java.io.InputStream;
+
+import static junit.framework.Assert.*;
 
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@XmlType(name = "store-type")
-// @XmlSeeAlso({CassandraStoreDTO.class, HawtDBStoreDTO.class})
-@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
-public abstract class StoreDTO {
-
-    /**
-     * The flush delay is the amount of time in milliseconds that a store
-     * will delay persisting a messaging unit of work in hopes that it will
-     * be invalidated shortly thereafter by another unit of work which
-     * would negate the operation.
-     */
-    @XmlAttribute(name="flush-delay", required=false)
-    public Long flush_delay;
+
+public class XmlCodecTest {
+
+    private InputStream resource(String path) {
+        return getClass().getResourceAsStream(path);
+    }
+
+    @Test
+    public void unmarshalling() throws Exception {
+        BrokerDTO dto = XmlCodec.unmarshalBrokerDTO(resource("simple.xml"));
+        assertNotNull(dto);
+        VirtualHostDTO host = dto.virtual_hosts.get(0);
+        assertEquals("vh-local", host.id);
+        assertEquals("localhost", host.host_names.get(0));
+
+        assertNotNull(host.store);
+        assertTrue( host.store instanceof CassandraStoreDTO);
+
+    }
 
 
 }

Copied: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java
(from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java?p2=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java&r1=1034511&r2=1034513&rev=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/NullStoreDTO.java
Fri Nov 12 18:55:24 2010
@@ -16,24 +16,18 @@
  */
 package org.apache.activemq.apollo.dto;
 
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import javax.xml.bind.annotation.*;
-import java.util.ArrayList;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
 
 /**
+ * Placeholder implementation fo a StoreDTO since JAXB
+ * seems to fail with:
+ * "Type <...> or any of its subclasses are not known to this context."
+ *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@XmlRootElement(name="cassandra-store")
+@XmlRootElement(name="null-store")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class CassandraStoreDTO extends StoreDTO {
-
-    @JsonProperty
-    @XmlAttribute
-    public String keyspace;
-
-    @JsonProperty
-    @XmlElement(required=true)
-    public ArrayList<String> hosts = new ArrayList<String>();    
-
+public class NullStoreDTO extends StoreDTO {
 }

Copied: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/SimpleStoreStatusDTO.java
(from r1034511, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/SimpleStoreStatusDTO.java?p2=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/SimpleStoreStatusDTO.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java&r1=1034511&r2=1034513&rev=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/CassandraStoreDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/SimpleStoreStatusDTO.java
Fri Nov 12 18:55:24 2010
@@ -16,24 +16,18 @@
  */
 package org.apache.activemq.apollo.dto;
 
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import javax.xml.bind.annotation.*;
-import java.util.ArrayList;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
 
 /**
+ * Placeholder implementation fo a StoreStatusDTO since JAXB
+ * seems to fail with:
+ * "Type <...> or any of its subclasses are not known to this context."
+ *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@XmlRootElement(name="cassandra-store")
+@XmlRootElement(name="simple-store-status")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class CassandraStoreDTO extends StoreDTO {
-
-    @JsonProperty
-    @XmlAttribute
-    public String keyspace;
-
-    @JsonProperty
-    @XmlElement(required=true)
-    public ArrayList<String> hosts = new ArrayList<String>();    
-
+public class SimpleStoreStatusDTO extends StoreStatusDTO {
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java?rev=1034513&r1=1034512&r2=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
Fri Nov 12 18:55:24 2010
@@ -25,8 +25,7 @@ import javax.xml.bind.annotation.XmlType
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@XmlType(name = "store-type")
-// @XmlSeeAlso({CassandraStoreDTO.class, HawtDBStoreDTO.class})
+@XmlType (name = "store-type")
 @JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
 public abstract class StoreDTO {
 

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java?rev=1034513&r1=1034512&r2=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
Fri Nov 12 18:55:24 2010
@@ -27,9 +27,8 @@ import javax.xml.bind.annotation.XmlType
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 @XmlType(name = "store-status-type")
-// @XmlSeeAlso({HawtDBStoreStatusDTO.class})
 @JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
-public class StoreStatusDTO {
+public abstract class StoreStatusDTO {
 
     /**
      * The state of the service.

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index?rev=1034513&r1=1034512&r2=1034513&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
Fri Nov 12 18:55:24 2010
@@ -17,7 +17,6 @@
 BrokerDTO
 BrokerStatusDTO
 BrokerSummaryDTO
-CassandraStoreDTO
 ConnectionStatusDTO
 ConnectorDTO
 ConnectorStatusDTO
@@ -39,4 +38,6 @@ TimeMetricDTO
 VirtualHostDTO
 VirtualHostStatusDTO
 StompConnectionStatusDTO
-KeyStorageDTO
\ No newline at end of file
+KeyStorageDTO
+SimpleStoreStatusDTO
+NullStoreDTO
\ No newline at end of file



Mime
View raw message