Package org.jboss.dna.graph

Examples of org.jboss.dna.graph.ExecutionContext$NullSecurityContext


     */
    public synchronized Session login( Credentials credentials,
                                       String workspaceName ) throws RepositoryException {
        // Ensure credentials are either null or provide a JAAS method
        Map<String, Object> sessionAttributes = new HashMap<String, Object>();
        ExecutionContext execContext = null;
        if (credentials == null) {
            Subject subject = Subject.getSubject(AccessController.getContext());
            if (subject != null) {
                execContext = executionContext.with(new JaasSecurityContext(subject));
            }
View Full Code Here


    @Override
    public void exportNode( Node node,
                            ContentHandler contentHandler,
                            boolean skipBinary,
                            boolean noRecurse ) throws RepositoryException, SAXException {
        ExecutionContext executionContext = session.getExecutionContext();

        // If this node is a special xmltext node, output it as raw content (see JCR 1.0 spec - section 6.4.2.3
        if (node.getParent() != null && isXmlTextNode(node)) {

            String xmlCharacters = getXmlCharacters(node);
            contentHandler.characters(xmlCharacters.toCharArray(), 0, xmlCharacters.length());

            return;
        }

        ValueFactories valueFactories = executionContext.getValueFactories();
        AttributesImpl atts = new AttributesImpl();

        // Build the attributes for this node's element
        PropertyIterator properties = node.getProperties();
        while (properties.hasNext()) {
View Full Code Here

        configuration = new JcrConfiguration();
    }

    @Test
    public void shouldAllowCreatingWithSpecifiedExecutionContext() {
        ExecutionContext newContext = new ExecutionContext();
        configuration = new JcrConfiguration(newContext);
        assertThat(configuration.getConfigurationDefinition().getContext(), is(sameInstance(newContext)));
    }
View Full Code Here

     *
     * @throws Exception
     */
    @BeforeClass
    public static void beforeAll() throws Exception {
        context = new ExecutionContext();

        // Create the node type manager ...
        context.getNamespaceRegistry().register(Vehicles.Lexicon.Namespace.PREFIX, Vehicles.Lexicon.Namespace.URI);
        repository = mock(JcrRepository.class);
        stub(repository.getExecutionContext()).toReturn(context);
View Full Code Here

        // Set up the source ...
        source = new InMemoryRepositorySource();
        source.setName(sourceName);

        // Set up the execution context ...
        context = new ExecutionContext();
        credentials = new SimpleCredentials("superuser", "superuser".toCharArray());

        // Stub out the connection factory ...
        connectionFactory = new RepositoryConnectionFactory() {
            /**
 
View Full Code Here

        source = new InMemoryRepositorySource();
        source.setName(workspaceName);
        source.setDefaultWorkspaceName(workspaceName);

        // Set up the execution context ...
        ExecutionContext context = new ExecutionContext();
        // Register the test namespace
        context.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX, TestLexicon.Namespace.URI);

        // Stub out the connection factory ...
        RepositoryConnectionFactory connectionFactory = new RepositoryConnectionFactory() {
            @SuppressWarnings( "synthetic-access" )
            public RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException {
View Full Code Here

    private JcrSession session;

    @Before
    public void before() {
        MockitoAnnotations.initMocks(this);
        executionContext = new ExecutionContext();
        registry = new JcrNamespaceRegistry(executionContext.getNamespaceRegistry(), session);
    }
View Full Code Here

    protected JcrRepository repository;

    @Before
    public void beforeEach() throws Exception {
        MockitoAnnotations.initMocks(this);
        context = new ExecutionContext();
        context.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX, TestLexicon.Namespace.URI);

        stub(repository.getExecutionContext()).toReturn(context);

        repoTypeManager = new RepositoryNodeTypeManager(repository, true);
View Full Code Here

        source = new InMemoryRepositorySource();
        source.setName(workspaceName);
        source.setDefaultWorkspaceName(workspaceName);

        // Set up the execution context ...
        context = new ExecutionContext();
        // Register the test namespace
        context.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX, TestLexicon.Namespace.URI);
        PathFactory pathFactory = context.getValueFactories().getPathFactory();

        // Set up the initial content ...
View Full Code Here

            }
            if (problems.hasErrors()) {
                throw new IllegalStateException("Problems starting JCR repository");
            }

            ExecutionContext executionContext = engine.getExecutionContext();
            executionContext.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX, TestLexicon.Namespace.URI);

            repository = engine.getRepository(REPOSITORY_SOURCE_NAME);

            // This needs to check configProps directly to avoid an infinite loop
            String skipImport = (String)configProps.get(DNA_SKIP_IMPORT);
            if (!Boolean.valueOf(skipImport)) {

                // Set up some sample nodes in the graph to match the expected test configuration
                Graph graph = Graph.create(repository.getRepositorySourceName(),
                                           engine.getRepositoryConnectionFactory(),
                                           executionContext);
                Path destinationPath = executionContext.getValueFactories().getPathFactory().createRootPath();

                InputStream xmlStream = getClass().getResourceAsStream("/tck/repositoryForTckTests.xml");
                graph.importXmlFrom(xmlStream).into(destinationPath);

                graph.createWorkspace().named("otherWorkspace");
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.ExecutionContext$NullSecurityContext

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.