KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > capabilities > AbstractCapabilitiesFactory


1 /*
2  * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tc.capabilities;
6
7 import com.tc.util.factory.AbstractFactory;
8
9 public abstract class AbstractCapabilitiesFactory extends AbstractFactory {
10   private static Capabilities capabilitiesManager;
11   private static String JavaDoc FACTORY_SERVICE_ID = "com.tc.capabilities.CapabilitiesFactory";
12   private static Class JavaDoc STANDARD_CAPABILITIES_FACTORY_CLASS = StandardCapabilitiesFactory.class;
13   
14   public static AbstractCapabilitiesFactory getFactory() {
15     return (AbstractCapabilitiesFactory)getFactory(FACTORY_SERVICE_ID, STANDARD_CAPABILITIES_FACTORY_CLASS);
16   }
17
18   public abstract Capabilities createCapabilitiesManager();
19   
20   public static Capabilities getCapabilitiesManager() {
21     if(capabilitiesManager == null) {
22       capabilitiesManager = getFactory().createCapabilitiesManager();
23     }
24     return capabilitiesManager;
25   }
26 }
27
Popular Tags