private void initRemoteCommands(final RepositoryEntry config)
   {
      this.id = UUID.randomUUID().toString();
      registerNamespace = rpcService.registerCommand(new RemoteCommand()
      {

         public String getId()
         {
            return "org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl-registerNamespace-"
               + config.getName();
         }

         public Serializable execute(Serializable[] args) throws Throwable
         {
            if (!id.equals(args[0]))
            {
               try
               {
                  registerNamespace((String)args[1], (String)args[2], false);
               }
               catch (Exception e)
               {
                  LOG.warn("Could not register the namespace on other cluster nodes", e);
               }
            }
            return true;
         }
      });
      unregisterNamespace = rpcService.registerCommand(new RemoteCommand()
      {

         public String getId()
         {
            return "org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl-unregisterNamespace-"
               + config.getName();
         }

         public Serializable execute(Serializable[] args) throws Throwable
         {
            if (!id.equals(args[0]))
            {
               try
               {
                  unregisterNamespace((String)args[1], false);
               }
               catch (Exception e)
               {
                  LOG.warn("Could not unregister the namespace on other cluster nodes", e);
               }
            }
            return true;
         }
      });
   }
private void initRemoteCommands ( final RepositoryEntry config ) { this . id = UUID . randomUUID ( ) . toString ( ) ; registerNamespace = rpcService . registerCommand ( new RemoteCommand ( ) { public String getId ( ) { return "org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl-registerNamespace-" + config . getName ( ) ; } public Serializable execute ( Serializable [ ] args ) throws Throwable { if ( ! id . equals ( args [ 0 ] ) ) { try { registerNamespace ( ( String ) args [ 1 ] , ( String ) args [ 2 ] , false ) ; } catch ( Exception e ) { LOG . warn ( "Could not register the namespace on other cluster nodes" , e ) ; } } return true ; } } ) ; unregisterNamespace = rpcService . registerCommand ( new RemoteCommand ( ) { public String getId ( ) { return "org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl-unregisterNamespace-" + config . getName ( ) ; } public Serializable execute ( Serializable [ ] args ) throws Throwable { if ( ! id . equals ( args [ 0 ] ) ) { try { unregisterNamespace ( ( String ) args [ 1 ] , false ) ; } catch ( Exception e ) { LOG . warn ( "Could not unregister the namespace on other cluster nodes" , e ) ; } } return true ; } } ) ; }
Registers all the remote commands