Package mage.interfaces

Examples of mage.interfaces.PluginException


          prev = c.getGamesPlayed();
        }
      } catch (EOFException e) {
        // do nothing
      } catch (IOException e) {
        throw new PluginException(e);
      } catch (ClassNotFoundException e) {
        throw new PluginException(e);
      } finally {
        if (ois != null) try { ois.close(); } catch (Exception e) {}
      }
     
      try {
        synchronized (this) {
          oos = new ObjectOutputStream(new FileOutputStream(data));
          CounterBean c = new CounterBean();
          c.setGamesPlayed(prev+1);
          oos.writeObject(c);
          oos.close();
        }
      } catch (IOException e) {
        throw new PluginException(e);
      } finally {
        if (oos != null) try { oos.close(); } catch (Exception e) {}
      }
    } else {
      log.error("Counter plugin: data file doesn't exist, please restart plugin.");
View Full Code Here


          return c.getGamesPlayed();
        }
      } catch (EOFException e) {
        return 0;
      } catch (IOException e) {
        throw new PluginException(e);
      } catch (ClassNotFoundException e) {
        throw new PluginException(e);
      } finally {
        if (ois != null) try { ois.close(); } catch (Exception e) {}
      }
    } else {
      log.error("Counter plugin: data file doesn't exist, please restart plugin.");
View Full Code Here

                    prev = c.getGamesPlayed();
                }
            } catch (EOFException e) {
                // do nothing
            } catch (IOException e) {
                throw new PluginException(e);
            } catch (ClassNotFoundException e) {
                throw new PluginException(e);
            } finally {
                if (ois != null) try { ois.close(); } catch (Exception e) {}
            }

            try {
                synchronized (this) {
                    oos = new ObjectOutputStream(new FileOutputStream(data));
                    CounterBean c = new CounterBean();
                    c.setGamesPlayed(prev+1);
                    oos.writeObject(c);
                    oos.close();
                }
            } catch (IOException e) {
                throw new PluginException(e);
            } finally {
                if (oos != null) try { oos.close(); } catch (Exception e) {}
            }
        } else {
            log.error("Counter plugin: data file doesn't exist, please restart plugin.");
View Full Code Here

                    return c == null ? 0 : c.getGamesPlayed();
                }
            } catch (EOFException e) {
                return 0;
            } catch (IOException e) {
                throw new PluginException(e);
            } catch (ClassNotFoundException e) {
                throw new PluginException(e);
            } finally {
                if (ois != null) try { ois.close(); } catch (Exception e) {}
            }
        } else {
            log.error("Counter plugin: data file doesn't exist, please restart plugin.");
View Full Code Here

TOP

Related Classes of mage.interfaces.PluginException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.