protected JcrSession( JcrSession original, boolean readOnly ) { // Most of the components can be reused from the original session ... this.repository = original.repository; this.context = original.context; this.sessionRegistry = original.sessionRegistry; this.valueFactory = original.valueFactory; this.sessionAttributes = original.sessionAttributes; this.workspace = original.workspace; this.hasCustomAuthorizationProvider = original.hasCustomAuthorizationProvider; // Create a new session cache and root node ... this.cache = repository.repositoryCache().createSession(context, this.workspace.getName(), readOnly); this.rootNode = new JcrRootNode(this, this.cache.getRootKey()); this.jcrNodes.put(this.rootNode.key(), this.rootNode); // Increment the statistics ... this.nanosCreated = System.nanoTime(); repository.statistics().increment(ValueMetric.SESSION_COUNT); acm = new AccessControlManagerImpl(this); this.mimeTypeDetectionEnabled = original.mimeTypeDetectionEnabled; }
protected JcrSession( JcrSession original, boolean readOnly ) { // Most of the components can be reused from the original session ... this.repository = original.repository; this.context = original.context; this.sessionRegistry = original.sessionRegistry; this.valueFactory = original.valueFactory; this.sessionAttributes = original.sessionAttributes; this.workspace = original.workspace; this.hasCustomAuthorizationProvider = original.hasCustomAuthorizationProvider; // Create a new session cache and root node ... this.cache = repository.repositoryCache().createSession(context, this.workspace.getName(), readOnly); this.rootNode = new JcrRootNode(this, this.cache.getRootKey()); this.jcrNodes.put(this.rootNode.key(), this.rootNode); // Increment the statistics ... this.nanosCreated = System.nanoTime(); repository.statistics().increment(ValueMetric.SESSION_COUNT); acm = new AccessControlManagerImpl(this); this.mimeTypeDetectionEnabled = original.mimeTypeDetectionEnabled; }
this.rootNode = new JcrRootNode(this, this.cache.getRootKey()); this.jcrNodes.put(this.rootNode.key(), this.rootNode); this.sessionAttributes = sessionAttributes != null ? sessionAttributes : Collections.<String, Object>emptyMap();
this.rootNode = new JcrRootNode(this, this.cache.getRootKey()); this.jcrNodes.put(this.rootNode.key(), this.rootNode); this.sessionAttributes = sessionAttributes != null ? sessionAttributes : Collections.<String, Object>emptyMap();