Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2013-2014 by Cisco Systems, Inc. All rights reserved.
  
  package com.cisco.oss.foundation.directory;
  
ServiceDirectory client class. Applications obtain the instance of LookupManager/RegistrationManager/ServiceDirectoryConfig from this class.

Author(s):
zuxiang
 
 public class ServiceDirectory {

The ServiceDirectory enable property name, indicating whether ServiceDirectory enabled for directory service.
 
 	public static final String SD_API_SERVICE_DIRECTORY_ENABLED_PROPERTY = "service.directory.enabled";

Default value to enable ServiceDirectory for directory service.
 
 	public static final boolean SD_API_SERVICE_DIRECTORY_ENABLED_DEFAULT = true;

Singleton, private constructor.
 
 	private ServiceDirectory(){
 	}

Get the LookupManager.

Returns:
the implementation instance of LookupManager.
Throws:
com.cisco.oss.foundation.directory.exception.ServiceException
 
 	public static LookupManager getLookupManager() throws ServiceException {
 		return getImpl().getLookupManager();
 	}

Get the RegistrationManager.

Returns:
the implementation instance of RegistrationManager.
Throws:
com.cisco.oss.foundation.directory.exception.ServiceException
 
 	}

Get the ServiceDirectoryConfig.

Returns:
the ServiceDirectoryConfig of the SD API.
 
 	}

Re-initialize the ServiceDirectoryManagerFactory. It allows applications to change the ServiceDirectoryManagerFactory in the runtime.

Parameters:
factory the ServiceDirectoryManagerFactory which generates LookupManager and RegistrationManager.
 
 	}

Check whether ServiceDirectory is enabled for the directory service. The value comes from the SD API configuration property "service.directory.enabled". By default the ServiceDirectory is enabled.

Returns:
true if the ServiceDirectory is enabled.
 
 	public static boolean isEnabled(){
 	}

Shutdown the ServiceDirectory. Be careful to invoke this method, it used to help gc in shutdown the jvm. The whole ServiceDirectory shutdown, it cannot be used unless restart the jvm and reload the ServiceDirectory class. The methods throw SERVICE_DIRECTORY_IS_SHUTDOWN error.
	public static void shutdown(){
	}

Get the ServiceDirectory implementation.

Returns:
the ServiceDirectoryImpl instance.
	private static ServiceDirectoryImpl getImpl() {
		return ServiceDirectoryImpl.getInstance();
	}
New to GrepCode? Check out our FAQ X