code: private void initRemoteCommands()
     {
        // register commands
        suspend = rpcService.registerCommand(new RemoteCommand()
        {
  
           public String getId()
           {
              return "org.exoplatform.services.jcr.impl.core.query.SearchManager-suspend-" + wsId + "-"
                 + (parentSearchManager == null);
           }
  
           public Serializable execute(Serializable[] args) throws Throwable
           {
              suspendLocally();
              return null;
           }
        });
  
        resume = rpcService.registerCommand(new RemoteCommand()
        {
  
           public String getId()
           {
              return "org.exoplatform.services.jcr.impl.core.query.SearchManager-resume-" + wsId + "-"
                 + (parentSearchManager == null);
           }
  
           public Serializable execute(Serializable[] args) throws Throwable
           {
              resumeLocally();
              return null;
           }
        });
  
        requestForResponsibleForResuming = rpcService.registerCommand(new RemoteCommand()
        {
  
           public String getId()
           {
              return "org.exoplatform.services.jcr.impl.core.query.SearchManager-requestForResponsibilityForResuming-"
                 + wsId + "-" + (parentSearchManager == null);
           }
  
           public Serializable execute(Serializable[] args) throws Throwable
           {
              return isResponsibleForResuming.get();
           }
        });
  
        changeIndexState = rpcService.registerCommand(new RemoteCommand()
        {
           public String getId()
           {
              return "org.exoplatform.services.jcr.impl.core.query.SearchManager-changeIndexerState-" + wsId + "-"
                 + (parentSearchManager == null);
           }
  
           public Serializable execute(Serializable[] args) throws Throwable
           {
              boolean isOnline = (Boolean)args[0];
              boolean allowQuery = (args.length == 2) ? (Boolean)args[1] : false;
              SearchManager.this.setOnline(isOnline, allowQuery, true);
              return null;
           }
        });
  
     }
docs: Register remote commands.