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.gemini.cluster.client.handler.*;
  7. import com.techempower.log.*;
  8. /**
  9. * GhStore provides data entity services.
  10. *
  11. * Development history:
  12. * 2012-04-19 - mh - Created
  13. *
  14. * @author mhixson
  15. */
  16. public class GhStore
  17. extends EntityStore
  18. {
  19. //
  20. // Member variables.
  21. //
  22. //
  23. // Member methods.
  24. //
  25. /**
  26. * Constructor.
  27. */
  28. public GhStore(TechEmpowerApplication application, ConnectorFactory
  29. connectorFactory)
  30. {
  31. super(application, connectorFactory);
  32. }
  33. /**
  34. * Initializes the EntityStore.
  35. */
  36. @Override
  37. public void initialize()
  38. {
  39. getLog().debug("Registering Entity Store groups.", LogLevel.DEBUG);
  40. // Register entities.
  41. // Use EntityGroup rather than CacheGroup to ensure World entities are not cached.
  42. register(EntityGroup.of(World.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.