例: LockHolders property (Agent - Java™)

次のビューアクションは、「Main Agent」という名前のエージェントのロック所有者を表示します。

import lotus.domino.*;
import java.util.Vector;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      Agent agent = db.getAgent("Main Agent");
      
      // Design locking must be enabled
      if (db.isDesignLockingEnabled()) {
        // Get and display lock holders
        Vector holders = agent.getLockHolders();
        if (holders.size() == 0)
          System.out.println("No lock holders");
        else
          for (int i = 0; i < holders.size(); i++)
            System.out.println(holders.elementAt(i));
      }
      else
        System.out.println("Design locking not enabled");

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}