final public void declareResources(final UUID dataService,final String[] resource){
  if (dataService == null)   throw new IllegalArgumentException();
  if (resource == null)   throw new IllegalArgumentException();
  if (!lock.isHeldByCurrentThread())   throw new IllegalMonitorStateException();
  if (readOnly)   throw new IllegalStateException(ERR_READ_ONLY);
  if (!isActive())   throw new IllegalStateException(ERR_NOT_ACTIVE);
  dataServices.add(dataService);
  resources.addAll(Arrays.asList(resource));
  if (log.isInfoEnabled())   log.info("dataService=" + dataService + ", resource="+ Arrays.toString(resource));
}

final public void declareResources ( final UUID dataService , final String [ ] resource ) { if ( dataService == null ) throw new IllegalArgumentException ( ) ; if ( resource == null ) throw new IllegalArgumentException ( ) ; if ( ! lock . isHeldByCurrentThread ( ) ) throw new IllegalMonitorStateException ( ) ; if ( readOnly ) throw new IllegalStateException ( ERR_READ_ONLY ) ; if ( ! isActive ( ) ) throw new IllegalStateException ( ERR_NOT_ACTIVE ) ; dataServices . add ( dataService ) ; resources . addAll ( Arrays . asList ( resource ) ) ; if ( log . isInfoEnabled ( ) ) log . info ( "dataService=" + dataService + ", resource=" + Arrays . toString ( resource ) ) ; }
declares resources on a data service instance on which the transaction will write .
