Package org.modeshape.jcr

Examples of org.modeshape.jcr.ExecutionContext


    private RightOuterToLeftOuterJoins rule;
    private QueryContext context;

    @Before
    public void beforeEach() {
        context = new QueryContext(new ExecutionContext(), mock(RepositoryCache.class), Collections.singleton("workspace"),
                                   mock(Schemata.class), mock(RepositoryIndexes.class), mock(NodeTypes.class),
                                   mock(BufferManager.class));
        rule = RightOuterToLeftOuterJoins.INSTANCE;
    }
View Full Code Here


    private AddJoinConditionColumnsToSources rule;
    private QueryContext context;

    @Before
    public void beforeEach() {
        context = new QueryContext(new ExecutionContext(), mock(RepositoryCache.class), Collections.singleton("workspace"),
                                   mock(Schemata.class), mock(RepositoryIndexes.class), mock(NodeTypes.class),
                                   mock(BufferManager.class));
        rule = AddJoinConditionColumnsToSources.INSTANCE;
        context.getHints().hasJoin = true;
    }
View Full Code Here

    private JcrSqlQueryParser parser;
    private Query query;

    @Before
    public void beforeEach() {
        typeSystem = new ExecutionContext().getValueFactories().getTypeSystem();
        parser = new JcrSqlQueryParser();
    }
View Full Code Here

    private boolean print;
    private boolean multipleSelectors = false;

    @Before
    public void beforeEach() {
        ExecutionContext executionContext = new ExecutionContext();
        ImmutableSchemata.Builder builder = ImmutableSchemata.createBuilder(executionContext, mock(NodeTypes.class));
        builder.addTable("t1", "c11", "c12", "c13");
        builder.addTable("t2", "c21", "c22", "c23");
        builder.addTable("all", "a1", "a2", "a3", "a4", "primaryType", "mixins");
        builder.makeSearchable("all", "a2");
View Full Code Here

        protected final JcrValueFactory valueFactory;
        protected final TypeSystem delegate;
        protected final ExecutionContext executionContext;

        protected MockJcrTypeSystem( JcrValueFactory valueFactory ) {
            this.executionContext = new ExecutionContext();
            this.valueFactory = valueFactory;
            this.delegate = this.executionContext.getValueFactories().getTypeSystem();
        }
View Full Code Here

        assertThat(parsers.getLanguages().contains(parser3.getLanguage()), is(true));
    }

    @Test( expected = IllegalArgumentException.class )
    public void shouldFailToParseUnknownLanguage() {
        TypeSystem typeSystem = new ExecutionContext().getValueFactories().getTypeSystem();
        parsers.parse(typeSystem, "unknown language", "This is a bogus query");
    }
View Full Code Here

    protected DB db;
    protected String propertyName = "indexedProperty";

    @Before
    public void beforeEach() {
        context = new ExecutionContext();
        db = DBMaker.newMemoryDB().make();
        serializers = MapDB.serializers(context.getValueFactories());
    }
View Full Code Here

            final int s = SAVE_NUMBER.getAndIncrement();
            if (s == MAX_SAVE_NUMBER) SAVE_NUMBER.set(1); // only the 100th
            int changes = 0;

            // There are at least some changes ...
            ExecutionContext context = getContext();
            String id = context.getId();
            String username = context.getSecurityContext().getUserName();
            NamespaceRegistry registry = context.getNamespaceRegistry();
            if (username == null) username = "<anonymous>";
            SAVE_LOGGER.trace("Save #{0} (part of transaction '{1}') by session {2}({3}) is persisting the following changes:",
                              s, txn, username, id);
            for (NodeKey key : firstNodesInOrder) {
                SessionNode node = changedNodes.get(key);
View Full Code Here

     */
    @GuardedBy( "lock" )
    protected ChangeSet persistChanges( Iterable<NodeKey> changedNodesInOrder,
                                        WorkspaceCache persistedCache ) {
        // Compute the save meta-info ...
        ExecutionContext context = context();
        String userId = context.getSecurityContext().getUserName();
        Map<String, String> userData = context.getData();
        final boolean acquireLock = false; // we already pre-locked all of the existing documents that we'll edit ...
        DateTime timestamp = context.getValueFactories().getDateFactory().create();
        String workspaceName = persistedCache.getWorkspaceName();
        String repositoryKey = persistedCache.getRepositoryKey();
        RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), repositoryKey, workspaceName,
                                                        sessionContext().journalId());

        // Get the documentStore ...
        DocumentStore documentStore = persistedCache.documentStore();
        DocumentTranslator translator = persistedCache.translator();
View Full Code Here

        RepositoryBuilder builder = new RepositoryBuilder();
        repository = builder.setGitDir(gitDir).readEnvironment().findGitDir().build();

        git = new Git(repository);

        context = new ExecutionContext();
        values = new Values(context.getValueFactories(), context.getBinaryStore());
    }
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.ExecutionContext

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.