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
meta = new AgentMetaData(type, id);
datastore.store(meta);
try {
trigger("create", toInfo(meta));
}