GhStore.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package hello;
  2. import hello.home.entity.*;
  3. import com.techempower.*;
  4. import com.techempower.cache.*;
  5. import com.techempower.data.*;
  6. import com.techempower.log.*;
  7. /**
  8. * GhStore provides data entity services.
  9. *
  10. * Development history:
  11. * 2012-04-19 - mh - Created
  12. *
  13. * @author mhixson
  14. */
  15. public class GhStore
  16. extends EntityStore
  17. {
  18. //
  19. // Member variables.
  20. //
  21. //
  22. // Member methods.
  23. //
  24. /**
  25. * Constructor.
  26. */
  27. public GhStore(TechEmpowerApplication application, ConnectorFactory
  28. connectorFactory)
  29. {
  30. super(application, connectorFactory);
  31. }
  32. /**
  33. * Initializes the EntityStore.
  34. */
  35. @Override
  36. public void initialize()
  37. {
  38. getLog().debug("Registering Entity Store groups.", LogLevel.DEBUG);
  39. // Register entities.
  40. // Use EntityGroup rather than CacheGroup to ensure World entities are not cached.
  41. register(EntityGroup.of(World.class));
  42. register(EntityGroup.of(Fortune.class));
  43. // Register relationships.
  44. // We have no relationships in this application.
  45. // Add handlers for clustering.
  46. // We're not using clustering in this application.
  47. /*
  48. GhApplication application = (GhApplication)super.getApplication();
  49. if (application.getClusterClient().isEnabled())
  50. {
  51. CacheHandler cacheHandler = new CacheHandler(application);
  52. application.getClusterClient().addHandler(cacheHandler);
  53. this.addListener(cacheHandler);
  54. CachedRelationHandler cachedRelationHandler = new CachedRelationHandler(application);
  55. application.getClusterClient().addHandler(cachedRelationHandler);
  56. for (CachedRelation<?, ?> relation : this.getRelations())
  57. {
  58. relation.addListener(cachedRelationHandler);
  59. }
  60. }
  61. */
  62. }
  63. } // End GhStore.