Show
Ignore:
Timestamp:
03/05/10 20:55:42 (2 years ago)
Author:
romain.reuillon
Message:

Changed name of plugin

Location:
trunk/openmole/core/org.openmole.core.commons.backgroundexecutor/src/main/java/org/openmole/core/commons
Files:
3 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/openmole/core/org.openmole.core.commons.backgroundexecutor/src/main/java/org/openmole/core/commons/backgroundexecutor/internal/BackgroundExecutor.java

    r3149 r3153  
    1 package org.openmole.core.transfermonitor.internal; 
     1package org.openmole.core.commons.backgroundexecutor.internal; 
    22 
    33 
    4 import org.openmole.core.workflow.model.file.ITransferable; 
    5 import org.openmole.core.transfermonitor.ITransferMonitor; 
    6 import org.openmole.core.transfermonitor.IBackgroundExecution; 
     4import org.openmole.core.commons.backgroundexecutor.ITransferable; 
     5import org.openmole.core.commons.backgroundexecutor.IBackgroundExecutor; 
     6import org.openmole.core.commons.backgroundexecutor.IBackgroundExecution; 
    77 
    8 public class TransfertMonitor implements ITransferMonitor { 
    9  
    10  
    11     //Map<ITransferable, Transfert> transferts = new WeakHashMap<ITransferable, Transfert>(); 
    12     /*private Transfert getTransfert(ITransferable transferable) { 
    13     return transferts.get(transferable); 
    14     } 
    15  
    16     private boolean containsTransfert(ITransferable transferable) { 
    17     return  transferts.containsKey(transferable); 
    18     } 
     8public class BackgroundExecutor implements IBackgroundExecutor { 
    199 
    2010 
    2111    @Override 
    22     public Throwable getFailureCause(ITransferable transferable) { 
    23     Transfert transfert = getTransfert(transferable); 
    24     if(transfert == null) return null; 
    25     return transfert.getFailureCause(); 
    26     }*/ 
    27     @Override 
    28     public IBackgroundExecution createTransfert(ITransferable transferable) { 
    29         return new Transfert(transferable); 
     12    public IBackgroundExecution createBackgroundExecution(ITransferable transferable) { 
     13        return new BackgroundExecution(transferable); 
    3014    } 
    3115 
    32     /*private Transfert createAndGetTransfert(ITransferable transferable) { 
    33     Transfert transfert = new Transfert(transferable); 
    34  
    35     transferts.put(transferable, transfert); 
    36  
    37     return transfert; 
    38     } 
    39  
    40     @Override 
    41     public boolean transfertFailed(ITransferable transferable) { 
    42     Transfert transfert = getTransfert(transferable); 
    43     if(transfert == null) return false; 
    44     return transfert.hasFailed(); 
    45     } 
    46  
    47     @Override 
    48     public boolean transfertStarted(ITransferable transferable) { 
    49     Transfert transfert = getTransfert(transferable); 
    50     if(transfert == null) return false; 
    51     return transfert.isStarted(); 
    52     } 
    53  
    54     @Override 
    55     public boolean transfertSuccessFull(ITransferable transferable) { 
    56     Transfert transfert = getTransfert(transferable); 
    57     if(transfert == null) return false; 
    58     return transfert.isSucessFull(); 
    59     } 
    60  
    61  
    62     @Override 
    63     public synchronized boolean transfertIsSucessFullStartUploadIfNecessaryExceptionIfFailed (ITransferable transferable) throws IOException { 
    64     Transfert transfert = getTransfert(transferable); 
    65  
    66     if(transfert == null) { 
    67     transfert = createAndGetTransfert(transferable); 
    68     transfert.start(); 
    69     } 
    70  
    71  
    72     //Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.INFO, transfert.isSucessFull()  + " "+ transferable.toString()); 
    73  
    74     boolean ret = transfert.isSucessFullStartUploadIfNecessaryExceptionIfFailed(); 
    75     return ret; 
    76     }*/ 
     16    
    7717} 

logo cemagref

logo iscpif

logo lifegrid

logo region auvergne

logo patres project