 (ns
  org.dada.core
  (:use org.dada.core.UnionModel)
- (:import (clojure.lang
-	   DynamicClassLoader
-	   ISeq
-	   Keyword
-	   )
-	  (java.sql
-	   Connection
-	   ResultSet
-	   ResultSetMetaData
-	   )
-	  (java.util
-	   Collection
-	   Date)
-	  (java.util.concurrent.locks
-	   Lock)
-	  (org.springframework.context.support ClassPathXmlApplicationContext)
-	  (org.springframework.beans.factory BeanFactory)
-	  (org.slf4j Logger LoggerFactory)
-	  (org.dada.asm ClassFactory)
-	  (org.dada.core
-	   AbstractModel
-	   Attribute
-	   Creator
-	   Getter
-	   MetaModel
-	   MetaModelImpl
-	   Metadata
-	   MetadataImpl
-	   Model
-	   ServiceFactory
-	   StringMetadata
-	   UnionModel
-	   Update
-	   View
-	   )
-	  (org.dada.demo Client)
-	  ))
+ (:import
+  (clojure.lang
+   DynamicClassLoader
+   ISeq
+   Keyword
+   )
+  (java.sql
+   Connection
+   ResultSet
+   ResultSetMetaData
+   )
+  (java.util
+   Collection
+   Date)
+  (java.util.concurrent.locks
+   Lock)
+  (org.springframework.context.support ClassPathXmlApplicationContext)
+  (org.springframework.beans.factory BeanFactory)
+  (org.slf4j Logger LoggerFactory)
+  (org.dada.asm ClassFactory)
+  (org.dada.core
+   AbstractModel
+   Attribute
+   Creator
+   DummyLock
+   Getter
+   MetaModel
+   MetaModelImpl
+   Metadata
+   MetadataImpl
+   Model
+   ServiceFactory
+   StringMetadata
+   SynchronousServiceFactory
+   UnionModel
+   Update
+   View
+   )
+  (org.dada.demo Client)
+  ))
 
 ;;--------------------------------------------------------------------------------
 


(defn delete [#^View view value]
  (.update view '() '() (list (Update. value nil))))

;;--------------------------------------------------------------------------------



;; TODO: Spring should look after this - see application-context.xml...
(if (not (System/getProperty "dada.broker.name")) (System/setProperty "dada.broker.name" "DADA"))
(if (not (System/getProperty "dada.broker.uri")) (System/setProperty "dada.broker.uri" "tcp://0.0.0.0:61616"))
(if (not (System/getProperty "dada.broker.uri")) (System/setProperty "dada.client.uri" "tcp://localhost:61616"))

(defn insert [#^View view item]
  (.update view (list (Update. nil item)) '() '())
