Package com.google.code.twig.annotation

Examples of com.google.code.twig.annotation.AnnotationObjectDatastore.load()


      Queue queue = QueueFactory.getDefaultQueue();
      queue.deleteTask(id);
     
      // remove stored task
      ObjectDatastore datastore = new AnnotationObjectDatastore();
      GaeTask storedTask = datastore.load(GaeTask.class, id);
      if (storedTask != null) {
        datastore.delete(storedTask);
      }     
    }
   
View Full Code Here


   */
  @SuppressWarnings("unchecked")
  private boolean loadFromDatastore () {
    try {
      ObjectDatastore datastore = new AnnotationObjectDatastore();
      KeyValue entity = datastore.load(KeyValue.class, getAgentId());
     
      @SuppressWarnings("rawtypes")
      Class<? extends HashMap> MAP_OBJECT_CLASS =
        (new HashMap<String, Serializable>()).getClass();
     
View Full Code Here

   * Delete the entity from the Datastore
   * @param entity
   */
  private void deleteFromDatastore () {
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    KeyValue entity = datastore.load(KeyValue.class, getAgentId());
    if (entity != null) {
      datastore.delete(entity);
    }
  }
 
View Full Code Here

      getAgentFactory().createAgent(type, id)
   
      ObjectDatastore datastore = new AnnotationObjectDatastore();
     
      // remove any old registration
      AgentMetaData meta = datastore.load(AgentMetaData.class, id);
      if (meta != null) {
        datastore.delete(meta);
      }
     
      // store new registration
View Full Code Here

    Agent agent = factory.getAgent(id);
    if (agent != null) {
      ObjectDatastore datastore = new AnnotationObjectDatastore();
     
      // remove any old registration
      AgentMetaData meta = datastore.load(AgentMetaData.class, id);
      if (meta != null) {
        datastore.delete(meta);
      }
     
      // store new registration
View Full Code Here

   * @param id
   * @throws Exception
   */
  public void unregister(@Name("id") String id) throws Exception {
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    AgentMetaData meta = datastore.load(AgentMetaData.class, id);
    if (meta != null) {
      try {
        trigger("unregister", toInfo(meta));
        datastore.delete(meta);
      }
View Full Code Here

   * @return
   * @throws Exception
   */
  public void delete(@Name("id") String id) throws Exception {
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    AgentMetaData meta = datastore.load(AgentMetaData.class, id);
    if (meta != null) {
      try {
        trigger("delete", toInfo(meta));
      }
      catch (Exception e) {}
View Full Code Here

   * @return info
   * @throws Exception
   */
  public Map<String, Object> get(@Name("id") String id) throws Exception {
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    AgentMetaData meta = datastore.load(AgentMetaData.class, id);
    if (meta != null) {
      return toInfo(meta);
    }
    else {
      Agent agent = getAgentFactory().getAgent(id);
View Full Code Here

      Queue queue = QueueFactory.getDefaultQueue();
      queue.deleteTask(id);
     
      // remove stored task
      ObjectDatastore datastore = new AnnotationObjectDatastore();
      GaeTask storedTask = datastore.load(GaeTask.class, id);
      if (storedTask != null) {
        datastore.delete(storedTask);
      }     
    }
   
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  private boolean loadFromDatastore () {
    try {
      ObjectDatastore datastore = new AnnotationObjectDatastore();
      KeyValue entity = datastore.load(KeyValue.class, agentId);
     
      @SuppressWarnings("rawtypes")
      Class<? extends HashMap> MAP_OBJECT_CLASS =
        (new HashMap<String, Object>()).getClass();
     
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.