Package com.hp.hpl.jena.sparql.util

Examples of com.hp.hpl.jena.sparql.util.Context


    {
        this.query = query ;
        this.queryString = queryString ;
        this.service = serviceURI ;
        // Copy the global context to freeze it.
        this.context = new Context(ARQ.getContext()) ;
    }
View Full Code Here


    // Force a call
    static { init() ; }
   
    private static Context defaultSettings()   
    {
        Context context = new Context() ;
        setNormalMode(context) ;
        return context ;
    }
View Full Code Here

        StreamManager.setGlobal(streamMgrStd) ;
    }
   
    private static Context context(StreamManager streamMgr)
    {
        Context context = new Context() ;
        context.put(RDFDataMgr.streamManagerSymbol, streamMgr) ;
        return context ;
    }
View Full Code Here

    private boolean closed  = false ;
    private boolean active  = false ;   // In a transaction, or preparing.
   
    public BlockMgrJournal(Transaction txn, FileRef fileRef, BlockMgr underlyingBlockMgr)
    {
        Context context = txn.getBaseDataset().getContext() ;
        String mode = (null != context) ? (String) context.get(TDB.transactionJournalWriteBlockMode, "") : "" ;
        if ("direct".equalsIgnoreCase(mode))
        {
            writeBlockBufferAllocator = new BufferAllocatorDirect() ;
        }
        else if ("mapped".equalsIgnoreCase(mode))
View Full Code Here

        StreamManager.setGlobal(streamMgrStd) ;
    }
   
    private static Context context(StreamManager streamMgr)
    {
        Context context = new Context() ;
        context.put(RDFDataMgr.streamManagerSymbol, streamMgr) ;
        return context ;
    }
View Full Code Here

     */
    private static void applyServiceConfig(String serviceURI, UpdateProcessRemoteBase engine) {
        @SuppressWarnings("unchecked")
        Map<String, Context> serviceContextMap = (Map<String, Context>) engine.context.get(Service.serviceContext);
        if (serviceContextMap != null && serviceContextMap.containsKey(serviceURI)) {
            Context serviceContext = serviceContextMap.get(serviceURI);
            if (log.isDebugEnabled())
                log.debug("Endpoint URI {} has SERVICE Context: {} ", serviceURI, serviceContext);

            // Apply authentication settings
            String user = serviceContext.getAsString(Service.queryAuthUser);
            String pwd = serviceContext.getAsString(Service.queryAuthPwd);

            if (user != null || pwd != null) {
                user = user == null ? "" : user;
                pwd = pwd == null ? "" : pwd;
                if (log.isDebugEnabled())
View Full Code Here

            printRequest(action) ;
            action.setStartTime() ;
           
            response = action.response ;
            initResponse(request, response) ;
            Context cxt = ARQ.getContext() ;
           
            try {
                execCommonWorker(action) ;
            } catch (QueryCancelledException ex) {
                // Also need the per query info ...
                String message = String.format("The query timed out (restricted to %s ms)", cxt.get(ARQ.queryTimeout));
                // Possibility :: response.setHeader("Retry-after", "600") ;    // 5 minutes
                responseSendError(response, HttpSC.SERVICE_UNAVAILABLE_503, message);
            } catch (ActionErrorException ex) {
                if ( ex.exception != null )
                    ex.exception.printStackTrace(System.err) ;
View Full Code Here

public class TestContext extends BaseTest
{
    static Symbol p1 = Symbol.create("p1") ;
    static Symbol p2 = Symbol.create("p2") ;
   
    @Test public void testCxt1() { Context cxt = new Context(); }
View Full Code Here

   
    @Test public void testCxt1() { Context cxt = new Context(); }
   
    @Test public void testCxt2()
    {
        Context cxt = new Context();
        assertTrue("Defined in empty context", !cxt.isDefined(p1)) ;
        cxt.set(p1, "v") ;
        assertTrue("Not defined after .set", cxt.isDefined(p1)) ;
        Object v = cxt.get(p1) ;
        assertSame("Not the same", "v", v) ;
    }
View Full Code Here

        assertSame("Not the same", "v", v) ;
    }

    @Test public void testCxt3()
    {
        Context cxt = new Context();
        cxt.set(p1, "v") ;
        cxt.setIfUndef(p1, "w") ;
        Object v = cxt.get(p1) ;
        assertSame("Not as first set", "v", v) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.util.Context

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.