Package com.google.code.twig.annotation

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


        // store task information
        DateTime timestamp = DateTime.now().plus(delay);
        GaeTask storedTask = new GaeTask(task.getName(),
            agentId, timestamp.toString());
        ObjectDatastore datastore = new AnnotationObjectDatastore();
        datastore.store(storedTask);
       
        return task.getName();     
      } catch (MalformedURLException e) {
        e.printStackTrace();
      }
View Full Code Here


   */
  private boolean saveToDatastore () {
    try {
      ObjectDatastore datastore = new AnnotationObjectDatastore();
      KeyValue entity = new KeyValue(getAgentId(), properties);
      datastore.store(entity);
      return true;
    } catch (IOException e) {
      e.printStackTrace();
    }

View Full Code Here

  public void onMessage(@Name("message") Message message) throws Exception {
    // store the message in the inbox
    message.setAgent(getFirstUrl());
    message.setBox("inbox");
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    datastore.store(message);
   
    // trigger receive event (not necessary)
    String event = "receive";
    ObjectNode params = JOM.createObjectNode();
    params.put("message", JOM.getInstance().convertValue(message, ObjectNode.class));
View Full Code Here

    // store the message in the outbox
    message.setAgent(getFirstUrl());
    message.setBox("outbox");
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    datastore.store(message);
   
    // send the message to all recipients
    Set<String> to = message.getTo();
    if (to != null) {
      for (String url : to) {
View Full Code Here

    registration.setUsername(username);
    registration.setEmail(email);
   
    // store the registration
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    datastore.store(registration);
   
    // load the registration again, to ensure its indexes are updated
    // TODO: does this actually work?...
    datastore.refresh(registration);
   
View Full Code Here

        datastore.delete(meta);
      }
     
      // store new registration
      meta = new AgentMetaData(type, id);
      datastore.store(meta);
     
      try {
        trigger("create", toInfo(meta));
      }
      catch (Exception e) {}
View Full Code Here

        datastore.delete(meta);
      }
     
      // store new registration
      meta = new AgentMetaData(agent.getClass().getName(), agent.getId());
      datastore.store(meta);
     
      try {
        trigger("register", toInfo(meta));
      }
      catch (Exception e) {}
View Full Code Here

        // store task information
        DateTime timestamp = DateTime.now().plus(delay);
        GaeTask storedTask = new GaeTask(task.getName(),
            agentId, timestamp.toString());
        ObjectDatastore datastore = new AnnotationObjectDatastore();
        datastore.store(storedTask);
       
        return task.getName();     
      } catch (MalformedURLException e) {
        e.printStackTrace();
      }
View Full Code Here

   */
  private boolean saveToDatastore () {
    try {
      ObjectDatastore datastore = new AnnotationObjectDatastore();
      KeyValue entity = new KeyValue(agentId, properties);
      datastore.store(entity);
      return true;
    } catch (IOException e) {
      e.printStackTrace();
    }

View Full Code Here

public class DatastoreRequestLogger implements RequestLogger {
  @Override
  public void log(AgentDetailRecord record) {
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    datastore.store(record);
  }
}
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.