Changeset 3439


Ignore:
Timestamp:
Jun 4, 2007, 9:22:07 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #613.

Location:
branches/2.3.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3.1/src/core/net/sf/basedb/core/PluginResponse.java

    r2854 r3439  
    2727import net.sf.basedb.core.plugin.ExportOutputStream;
    2828import net.sf.basedb.core.plugin.ImmediateDownloadExporter;
     29import net.sf.basedb.core.plugin.Plugin;
    2930import net.sf.basedb.core.plugin.Response;
    3031import net.sf.basedb.core.plugin.Request;
     
    149150      throw new PermissionDeniedException("Cannot export since response status is: " + getStatus());
    150151    }
    151     ImmediateDownloadExporter exporter = (ImmediateDownloadExporter)request.getPlugin();
    152     exporter.doExport(out, progress);
     152    Plugin plugin = request.getPlugin();
     153    try
     154    {
     155      ImmediateDownloadExporter exporter = (ImmediateDownloadExporter)plugin;
     156      exporter.doExport(out, progress);
     157    }
     158    finally
     159    {
     160      plugin.done();
     161    }
    153162  }
    154163 
  • branches/2.3.1/www/common/import/index.jsp

    r2978 r3439  
    109109      for (PluginConfiguration pluginConfig : configQuery.list(dc))
    110110      {
    111         InteractivePlugin ip = plugin.newInstance(InteractivePlugin.class, null, sc, pluginConfig, null);
     111        InteractivePlugin ip = null;
    112112        String contextMessage = null;
    113113        try
    114114        {
     115          ip = plugin.newInstance(InteractivePlugin.class, null, sc, pluginConfig, null);
    115116          contextMessage = ip.isInContext(context, currentItem);
    116117        }
     
    118119        {
    119120          contextMessage = t.getClass().getName() + ": " +  t.getMessage();
     121        }
     122        finally
     123        {
     124          if (ip != null) ip.done();
    120125        }
    121126        if (contextMessage == null)
     
    136141      else if (!plugin.requiresConfiguration())
    137142      {
    138         InteractivePlugin ip = plugin.newInstance(InteractivePlugin.class, null, sc, null, null);
     143        InteractivePlugin ip = null;
    139144        String contextMessage = null;
    140145        try
    141146        {
     147          ip = plugin.newInstance(InteractivePlugin.class, null, sc, null, null);
    142148          contextMessage = ip.isInContext(context, currentItem);
    143149        }
     
    145151        {
    146152          contextMessage = t.getClass().getName() + ": " +  t.getMessage();
     153        }
     154        finally
     155        {
     156          if (ip != null) ip.done();
    147157        }
    148158        if (contextMessage == null)
  • branches/2.3.1/www/common/plugin/index.jsp

    r2992 r3439  
    148148      for (PluginConfiguration pluginConfig : configQuery.list(dc))
    149149      {
    150         InteractivePlugin ip = plugin.newInstance(InteractivePlugin.class, null, sc, pluginConfig, null);
     150        InteractivePlugin ip = null;
    151151        String contextMessage = null;
    152152        try
    153153        {
     154          ip = plugin.newInstance(InteractivePlugin.class, null, sc, pluginConfig, null);
    154155          contextMessage = ip.isInContext(context, currentItem);
    155156        }
     
    157158        {
    158159          contextMessage = t.getClass().getName() + ": " +  t.getMessage();
     160        }
     161        finally
     162        {
     163          if (ip != null) ip.done();
    159164        }
    160165        if (contextMessage == null)
     
    174179      else if (!plugin.requiresConfiguration())
    175180      {
    176         InteractivePlugin ip = plugin.newInstance(InteractivePlugin.class, null, sc, null, null);
     181        InteractivePlugin ip = null;
    177182        String contextMessage = null;
    178183        try
    179184        {
     185          ip = plugin.newInstance(InteractivePlugin.class, null, sc, null, null);
    180186          contextMessage = ip.isInContext(context, currentItem);
    181187        }
     
    183189        {
    184190          contextMessage = t.getClass().getName() + ": " +  t.getMessage();
     191        }
     192        finally
     193        {
     194          if (ip != null) ip.done();
    185195        }
    186196        if (contextMessage == null)
Note: See TracChangeset for help on using the changeset viewer.