You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ma...@apache.org on 2013/09/05 11:26:48 UTC

git commit: Deleted RegistryManager.java.back file

Updated Branches:
  refs/heads/master d8b2b5b5c -> 1264c5a1a


Deleted RegistryManager.java.back file


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/1264c5a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/1264c5a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/1264c5a1

Branch: refs/heads/master
Commit: 1264c5a1a7bd48893fb89459ad3761583a6cfab8
Parents: d8b2b5b
Author: Manula Thantriwatte <ma...@wso2.com>
Authored: Thu Sep 5 14:56:06 2013 +0530
Committer: Manula Thantriwatte <ma...@wso2.com>
Committed: Thu Sep 5 14:56:06 2013 +0530

----------------------------------------------------------------------
 .../registry/RegistryManager.java.back          | 96 --------------------
 1 file changed, 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1264c5a1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/registry/RegistryManager.java.back
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/registry/RegistryManager.java.back b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/registry/RegistryManager.java.back
deleted file mode 100644
index 3ab6681..0000000
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/registry/RegistryManager.java.back
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.wso2.carbon.stratos.cloud.controller.registry;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.registry.core.Registry;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.stratos.cloud.controller.exception.CloudControllerException;
-import org.wso2.carbon.stratos.cloud.controller.persist.Serializer;
-import org.wso2.carbon.stratos.cloud.controller.util.CloudControllerConstants;
-import org.wso2.carbon.stratos.cloud.controller.util.CloudControllerServiceReferenceHolder;
-
-/**
- *
- */
-public class RegistryManager {
-	private final static Log log = LogFactory.getLog(RegistryManager.class);
-	private static Registry registryService = CloudControllerServiceReferenceHolder.getInstance().getRegistry();
-	private static RegistryManager registryManager;
-	
-	public static RegistryManager getInstance() {
-
-		if (registryManager == null) {
-			synchronized(RegistryManager.class){
-				if (registryManager == null) {
-					if(registryService == null){
-						log.warn("Registry Service is null. Hence unable to fetch data from registry.");
-						return registryManager;
-					}
-					registryManager = new RegistryManager();
-				}
-			}
-		}
-
-		return registryManager;
-	}
-	
-	private RegistryManager() {
-		try {
-			if (!registryService.resourceExists(CloudControllerConstants.CLOUD_CONTROLLER_RESOURCE)) {
-				registryService.put(CloudControllerConstants.CLOUD_CONTROLLER_RESOURCE,
-				                    registryService.newCollection());
-			}
-		} catch (RegistryException e) {
-			String msg =
-			             "Failed to create the registry resource " +
-			                     CloudControllerConstants.CLOUD_CONTROLLER_RESOURCE;
-			log.error(msg, e);
-			throw new CloudControllerException(msg, e);
-		}
-	}
-
-	/**
-     * Persist a node id in the local registry.
-     * @param nodeId node id to be persisted.
-     */
-	public void persist(Object dataObj) throws RegistryException {
-		try {
-
-			registryService.beginTransaction();
-			
-			Resource nodeResource = registryService.newResource();
-
-			nodeResource.setContent(Serializer.serializeToByteArray(dataObj));
-
-			registryService.put(CloudControllerConstants.CLOUD_CONTROLLER_RESOURCE+ CloudControllerConstants.DATA_RESOURCE, nodeResource);
-			
-			registryService.commitTransaction();
-			
-		} catch (Exception e) {
-			String msg = "Failed to persist the cloud controller data in registry.";
-			log.error(msg, e);
-			throw new CloudControllerException(msg, e);
-			
-		} finally{
-			registryService.rollbackTransaction();
-			
-		}
-	}
-	
-	public Object retrieve(){
-		
-		try {
-	        Resource resource = registryService.get(CloudControllerConstants.CLOUD_CONTROLLER_RESOURCE+ CloudControllerConstants.DATA_RESOURCE);
-	        
-	        return resource.getContent();
-	        
-        } catch (RegistryException e) {
-        	String msg = "Failed to retrieve cloud controller data from registry.";
-			log.error(msg, e);
-			throw new CloudControllerException(msg, e);
-        }
-		
-	}
-
-}