[dna-commits] DNA SVN: r139 - trunk/docs/examples/gettingstarted/sequencers/src/main/java/org/jboss/example/dna/sequencers.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Fri May 9 19:00:40 EDT 2008


Author: rhauch
Date: 2008-05-09 19:00:40 -0400 (Fri, 09 May 2008)
New Revision: 139

Modified:
   trunk/docs/examples/gettingstarted/sequencers/src/main/java/org/jboss/example/dna/sequencers/SequencingClient.java
Log:
Changed the example application to be more clear.

Modified: trunk/docs/examples/gettingstarted/sequencers/src/main/java/org/jboss/example/dna/sequencers/SequencingClient.java
===================================================================
--- trunk/docs/examples/gettingstarted/sequencers/src/main/java/org/jboss/example/dna/sequencers/SequencingClient.java	2008-05-09 23:00:12 UTC (rev 138)
+++ trunk/docs/examples/gettingstarted/sequencers/src/main/java/org/jboss/example/dna/sequencers/SequencingClient.java	2008-05-09 23:00:40 UTC (rev 139)
@@ -49,6 +49,7 @@
 import org.jboss.dna.repository.util.JcrTools;
 import org.jboss.dna.repository.util.SessionFactory;
 import org.jboss.dna.repository.util.SimpleExecutionContext;
+import org.jboss.dna.repository.util.SimpleSessionFactory;
 
 /**
  * @author Randall Hauch
@@ -64,7 +65,7 @@
 
     public static void main( String[] args ) throws Exception {
         SequencingClient client = new SequencingClient();
-        client.setRepositoryInformation(DEFAULT_REPOSITORY_NAME, DEFAULT_WORKSPACE_NAME, "jsmith", "secret".toCharArray());
+        client.setRepositoryInformation(DEFAULT_REPOSITORY_NAME, DEFAULT_WORKSPACE_NAME, DEFAULT_USERNAME, DEFAULT_PASSWORD);
         client.setUserInterface(new ConsoleInput(client));
     }
 
@@ -197,13 +198,13 @@
             // for the DNA services which knows about the JCR repositories, workspaces, and credentials used to
             // establish sessions to these workspaces. This example uses the SimpleExecutionContext, but there is
             // implementation for use with JCR repositories registered in JNDI.
-            SimpleExecutionContext executionContext = new SimpleExecutionContext();
-            executionContext.registerRepository(this.repositoryName, this.repository);
+            SimpleSessionFactory sessionFactory = new SimpleSessionFactory();
+            sessionFactory.registerRepository(this.repositoryName, this.repository);
             if (this.username != null) {
                 Credentials credentials = new SimpleCredentials(this.username, this.password);
-                executionContext.registerCredentials(this.repositoryName + "/" + this.workspaceName, credentials);
+                sessionFactory.registerCredentials(this.repositoryName + "/" + this.workspaceName, credentials);
             }
-            this.executionContext = executionContext;
+            this.executionContext = new SimpleExecutionContext(sessionFactory);
 
             // Create the sequencing service, passing in the execution context ...
             this.sequencingService = new SequencingService();




More information about the dna-commits mailing list