Revision 1160 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/ToolsLocator.java

View differences:

ToolsLocator.java
29 29
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
30 30
import org.gvsig.tools.extensionpoint.impl.DefaultExtensionPointManager;
31 31
import org.gvsig.tools.i18n.I18nManager;
32
import org.gvsig.tools.identitymanagement.SimpleIdentityManager;
32 33
import org.gvsig.tools.locator.AbstractLocator;
33 34
import org.gvsig.tools.locator.Locator;
34 35
import org.gvsig.tools.locator.LocatorException;
......
99 100

  
100 101
	private static final String PACKAGE_MANAGER_DESCRIPTION =
101 102
			"Default Package Manager";
103

  
104
        public static final String IDENTITY_MANAGER_NAME =
105
			"org.gvsig.tools.identity.manager";
106

  
107
	private static final String IDENTITY_MANAGER_DESCRIPTION =
108
			"Default Identiyty Manager";
102 109
	/**
103 110
	 * Unique instance.
104 111
	 */
......
463 470
		return (PackageManager) getInstance().get(PACKAGE_MANAGER_NAME);
464 471
	}
465 472

  
473
	/**
474
	 * Registers the Class implementing the {@link SimpleIdentityManager} interface.
475
	 * 
476
	 * @param clazz
477
	 *            implementing the {@link SimpleIdentityManager} interface
478
	 */
479
	public static void registerIdentityManager(Class clazz) {
480
		getInstance().register(IDENTITY_MANAGER_NAME,
481
				IDENTITY_MANAGER_DESCRIPTION, clazz);
482
	}
483
	/**
484
	 * Registers the default Class implementing the {@link SimpleIdentityManager} interface.
485
	 * 
486
	 * @param clazz
487
	 *            implementing the {@link SimpleIdentityManager} interface
488
	 */
489
	public static void registerDefaultIdentityManager(Class clazz) {
490
		getInstance().registerDefault(IDENTITY_MANAGER_NAME,
491
				IDENTITY_MANAGER_DESCRIPTION, clazz);
492
	}
493

  
494
	/**
495
	 * Return a reference to {@link SimpleIdentityManager}.
496
	 * 
497
	 * @return a reference to {@link SimpleIdentityManager}
498
	 * @throws LocatorException
499
	 *             if there is no access to the class or the class cannot be
500
	 *             instantiated
501
	 * @see Locator#get(String)
502
	 */
503
	public static SimpleIdentityManager getIdentityManager()
504
			throws LocatorException {
505
		return (SimpleIdentityManager) getInstance().get(IDENTITY_MANAGER_NAME);
506
	}
507

  
466 508
}

Also available in: Unified diff