How to Unshare a TeaObject

It is a good practice to unshare a shared object after the purpose for sharing it is complete.

Below is an example of how to unshare a TeaObject after it has been shared:

@TeaOperation(name = "unsharePerson", description = "Unshare a Person object") 
public void unsharePerson() throws IOException {    
  // Person implements TeaObject and has objectTypeName="Person" in this instance 
  // the key="John"    
final Person person = new Person("John", "Public John Person");    
  //teaAgentServer is an instance of com.tibco.tea.agent.server.TeaAgentServer or 
  // com.tibco.tea.agent.server.TeaAgentServlet    
final TeaPersistence persistence = teaAgentServer.getPersistence();    
persistence.unshare(person); 
}