You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/09/05 17:11:37 UTC
svn commit: r1165318 - in /incubator/jena:
Experimental/TxTDB/trunk/src-dev/tx/api/LockTx.java Jena2/Fuseki/trunk/soh
Jena2/Fuseki/trunk/src-dev/dev/DevFuseki.java
Author: andy
Date: Mon Sep 5 15:11:36 2011
New Revision: 1165318
URL: http://svn.apache.org/viewvc?rev=1165318&view=rev
Log: (empty)
Added:
incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/api/LockTx.java (with props)
Modified:
incubator/jena/Jena2/Fuseki/trunk/soh
incubator/jena/Jena2/Fuseki/trunk/src-dev/dev/DevFuseki.java
Added: incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/api/LockTx.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/api/LockTx.java?rev=1165318&view=auto
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/api/LockTx.java (added)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/api/LockTx.java Mon Sep 5 15:11:36 2011
@@ -0,0 +1,78 @@
+/**
+ * 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 tx.api;
+
+import com.hp.hpl.jena.shared.Lock ;
+import com.hp.hpl.jena.tdb.transaction.TDBTransactionException ;
+
+import static tx.api.LockTx.LockTxState.* ;
+
+/** Lock that provides transactions
+ * Not reentrant.
+ * */
+
+public class LockTx implements Lock
+{
+ // Lock state.
+ // Either entrant
+
+ //public LockTx(Store)
+
+ static enum LockTxState { TxNONE, TxREAD, TxWRITE }
+
+ private LockTxState state = TxNONE ;
+
+ @Override
+ public void enterCriticalSection(boolean readLockRequested)
+ {
+ if ( state != TxNONE )
+ throw new TDBTransactionException("Illegal state: "+state) ;
+
+ if ( readLockRequested )
+ {
+ state = TxREAD ;
+ // begin read
+ // switch dataset to tx-read one
+ }
+ else
+ {
+ state = TxWRITE ;
+ // begin write
+ // switch dataset to tx-write one
+ }
+ }
+
+ @Override
+ public void leaveCriticalSection()
+ {
+ switch (state)
+ {
+ case TxNONE : throw new TDBTransactionException("Illegal state: "+state) ;
+ case TxREAD :
+ // close
+ break ;
+ case TxWRITE :
+ // commit
+ break ;
+ }
+ state = TxNONE ;
+ }
+
+}
+
Propchange: incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/api/LockTx.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/jena/Jena2/Fuseki/trunk/soh
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/Fuseki/trunk/soh?rev=1165318&r1=1165317&r2=1165318&view=diff
==============================================================================
--- incubator/jena/Jena2/Fuseki/trunk/soh (original)
+++ incubator/jena/Jena2/Fuseki/trunk/soh Mon Sep 5 15:11:36 2011
@@ -26,13 +26,17 @@ $proxy = ENV['http_proxy'] ? URI.parse(E
# What about direct naming?
# Names
-$mtTurtle = 'application/turtle'
+$mtTurtle = 'text/turtle;charset=utf-8'
$mtRDF = 'application/rdf+xml'
$mtText = 'text/plain'
$mtNQuads = 'text/n-quads'
$mtTriG = 'application/trig'
$mtSparqlResultsX = 'application/sparql-results+xml'
$mtSparqlResultsJ = 'application/sparql-results+json'
+$mtAppJSON = 'application/json'
+$mtAppXML = 'application/xml'
+$mtSparqlResultsTSV = 'application/sparql-results+tsv'
+$mtSparqlResultsCSV = 'application/sparql-results+csv'
$mtSparqlUpdate = 'application/sparql-update'
$mtWWWForm = 'application/x-www-form-urlencoded'
# $mtSparqlQuery = "application/sparql-query" ;
@@ -73,7 +77,7 @@ $print_http = false
# Default for GET
# At least allow anythign (and hope!)
-$accept_rdf="#{$mtRDF} , #{$mtTurtle};q=0.9"
+$accept_rdf="#{$mtRDF};q=0.9 , #{$mtTurtle}"
# For SPARQL query
$accept_results="#{$mtSparqlResultsJ} , #{$mtSparqlResultsX};q=0.9 , #{$accept_rdf}"
Modified: incubator/jena/Jena2/Fuseki/trunk/src-dev/dev/DevFuseki.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/Fuseki/trunk/src-dev/dev/DevFuseki.java?rev=1165318&r1=1165317&r2=1165318&view=diff
==============================================================================
--- incubator/jena/Jena2/Fuseki/trunk/src-dev/dev/DevFuseki.java (original)
+++ incubator/jena/Jena2/Fuseki/trunk/src-dev/dev/DevFuseki.java Mon Sep 5 15:11:36 2011
@@ -20,9 +20,7 @@ package dev;
public class DevFuseki
{
- // Configuration:
- // 1 - Custom code - server init by reflection.
- // 2 -
+ // --accept for to soh for construct queries (check can get CONSTRUCT in TTL).
// application/json for application/sparql-results+json.
// application/xml for application/sparql-results+xml.
@@ -47,7 +45,7 @@ public class DevFuseki
// Multiple Accept headers
// WebContent and ContentType clean up.
- // SOH defualt to not needing 'default'
+ // SOH default to not needing 'default'
// More error handling.
// Migrate ContentType to RIOT