jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1334962 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: GlobalContext.java RepositoryImpl.java SessionDelegate.java
Date Mon, 07 May 2012 11:47:15 GMT
Author: mduerig
Date: Mon May  7 11:47:15 2012
New Revision: 1334962

URL: http://svn.apache.org/viewvc?rev=1334962&view=rev
Log:
OAK-17: Modularisation and configuration concept
remove GlobalContext

Removed:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/GlobalContext.java
Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java?rev=1334962&r1=1334961&r2=1334962&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
Mon May  7 11:47:15 2012
@@ -40,11 +40,11 @@ public class RepositoryImpl implements R
      */
     private static final Logger log = LoggerFactory.getLogger(RepositoryImpl.class);
 
-    private final GlobalContext context;
     private final Descriptors descriptors = new Descriptors(new SimpleValueFactory());
+    private final ContentRepository contentRepository;
 
-    public RepositoryImpl(ContentRepository repository) {
-        this.context = new GlobalContext(this, repository);
+    public RepositoryImpl(ContentRepository contentRepository) {
+        this.contentRepository = contentRepository;
     }
 
     /**
@@ -119,10 +119,9 @@ public class RepositoryImpl implements R
     @Override
     public Session login(Credentials credentials, String workspaceName) throws RepositoryException
{
         // TODO: needs complete refactoring
-        ContentRepository contentRepository = context.getInstance(ContentRepository.class);
         try {
             ContentSession contentSession = contentRepository.login(credentials, workspaceName);
-            return new SessionDelegate(context, contentSession).getSession();
+            return new SessionDelegate(this, contentSession).getSession();
         } catch (LoginException e) {
             throw new javax.jcr.LoginException(e.getMessage());
         }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java?rev=1334962&r1=1334961&r2=1334962&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
Mon May  7 11:47:15 2012
@@ -16,19 +16,6 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
-import java.io.IOException;
-
-import javax.jcr.ItemExistsException;
-import javax.jcr.NamespaceRegistry;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.Workspace;
-import javax.jcr.lock.LockManager;
-import javax.jcr.nodetype.NodeTypeManager;
-import javax.jcr.version.VersionManager;
-
 import org.apache.jackrabbit.oak.api.AuthInfo;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -45,12 +32,24 @@ import org.apache.jackrabbit.oak.namepat
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.ItemExistsException;
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+import javax.jcr.lock.LockManager;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.version.VersionManager;
+import java.io.IOException;
+
 public class SessionDelegate {
     static final Logger log = LoggerFactory.getLogger(SessionDelegate.class);
 
     private final NameMapper nameMapper = new SessionNameMapper();
     private final NamePathMapper namePathMapper = new NamePathMapperImpl(nameMapper);
-    private final GlobalContext context;
+    private final Repository repository;
     private final ContentSession contentSession;
     private final ValueFactoryImpl valueFactory;
     private final NamespaceRegistry nsRegistry;
@@ -60,10 +59,8 @@ public class SessionDelegate {
     private boolean isAlive = true;
     private Root root;
 
-    SessionDelegate(GlobalContext context, ContentSession contentSession)
-            throws RepositoryException {
-
-        this.context = context;
+    SessionDelegate(Repository repository, ContentSession contentSession) throws RepositoryException
{
+        this.repository = repository;
         this.contentSession = contentSession;
         this.valueFactory = new ValueFactoryImpl(contentSession.getCoreValueFactory(), namePathMapper);
         this.nsRegistry = new NamespaceRegistryImpl(contentSession);
@@ -73,7 +70,7 @@ public class SessionDelegate {
     }
 
     public Repository getRepository() {
-        return context.getInstance(Repository.class);
+        return repository;
     }
 
     public Session getSession() {



Mime
View raw message