camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhira...@apache.org
Subject [1/3] camel git commit: CAMEL-8517: Updated SalesforceSession to use volatile shared fields
Date Fri, 20 Mar 2015 20:43:15 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x 9d55b69a2 -> 74f9ea0be


CAMEL-8517: Updated SalesforceSession to use volatile shared fields


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f8004c80
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f8004c80
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f8004c80

Branch: refs/heads/camel-2.15.x
Commit: f8004c8014e621e45dbbcd8c4928f513a109d155
Parents: eeca81a
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Authored: Fri Mar 20 09:57:03 2015 -0700
Committer: Dhiraj Bokde <dhirajsb@yahoo.com>
Committed: Fri Mar 20 13:39:21 2015 -0700

----------------------------------------------------------------------
 .../component/salesforce/internal/SalesforceSession.java  | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f8004c80/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
index 5dcb68b..2364697 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
@@ -56,8 +56,8 @@ public class SalesforceSession implements Service {
     private final ObjectMapper objectMapper;
     private final Set<SalesforceSessionListener> listeners;
 
-    private String accessToken;
-    private String instanceUrl;
+    private volatile String accessToken;
+    private volatile String instanceUrl;
 
     public SalesforceSession(HttpClient httpClient, SalesforceLoginConfig config) {
         // validate parameters
@@ -198,7 +198,7 @@ public class SalesforceSession implements Service {
         return accessToken;
     }
 
-    public void logout() throws SalesforceException {
+    public synchronized void logout() throws SalesforceException {
         if (accessToken == null) {
             return;
         }
@@ -236,7 +236,7 @@ public class SalesforceSession implements Service {
                 throw new SalesforceException("Logout request TIMEOUT!", null);
 
             default:
-                throw new SalesforceException("Unknow status: " + done, null);
+                throw new SalesforceException("Unknown status: " + done, null);
             }
         } catch (SalesforceException e) {
             throw e;
@@ -247,7 +247,7 @@ public class SalesforceSession implements Service {
             // reset session
             accessToken = null;
             instanceUrl = null;
-            // notify all session listeners of the new access token and instance url
+            // notify all session listeners about logout
             for (SalesforceSessionListener listener : listeners) {
                 try {
                     listener.onLogout();


Mime
View raw message