Shob Logo Última Atualização: 8 de dezembro de 2002 18:34 BRST

Tutorial - Referência gerada pelo shobc

   1:/*
   2:* Automatically generated class
   3:* Compiler version: br.shob-0.51-2002.09.04
   4:* Message protocol version: br.shob-1.0.1-2002.08.30
   5:*
   6:* File generated on: 09/30/2002 00:41 -0400
   7:*
   8:* http://shob.sourceforge.net/
   9:* http://www.jdom.org/
  10:*/
  11:
  12:package auction.core;
  13:
  14:
  15:import br.shob.*;
  16:import java.lang.reflect.*;
  17:
  18:public class OfferReference extends DefaultSharedReference implements auction.core.Offer {
  19:
  20:  public OfferReference(SharedSpace shob, String globalName) {
  21:    super(shob, globalName);
  22:  }
  23:
  24:  public java.lang.String getName()
  25:    throws ShobException {
  26:    try {// shared try
  27:        try {// call method try
  28:            Class[] argTypes = null;
  29:            Object[] args = null;
  30:
  31:            Object result = srCallMethod("getName", argTypes, args);
  32:            return (java.lang.String) result;
  33:        } catch (InvocationTargetException e) {
  34:            if (e.getTargetException() instanceof br.shob.ShobException) {
  35:                throw (br.shob.ShobException) e.getTargetException();
  36:            }
  37:            throw new ShobException(e);
  38:        }
  39:    } catch (InvocationException e) {
  40:      throw new ShobException(e);
  41:    }
  42:  }
  43:
  44:  public double getValue()
  45:    throws ShobException {
  46:    try {// shared try
  47:        try {// call method try
  48:            Class[] argTypes = null;
  49:            Object[] args = null;
  50:
  51:            Object result = srCallMethod("getValue", argTypes, args);
  52:            return ((Double)result).doubleValue();
  53:        } catch (InvocationTargetException e) {
  54:            if (e.getTargetException() instanceof br.shob.ShobException) {
  55:                throw (br.shob.ShobException) e.getTargetException();
  56:            }
  57:            throw new ShobException(e);
  58:        }
  59:    } catch (InvocationException e) {
  60:      throw new ShobException(e);
  61:    }
  62:  }
  63:
  64:  public java.lang.String getWinner()
  65:    throws ShobException {
  66:    try {// shared try
  67:        try {// call method try
  68:            Class[] argTypes = null;
  69:            Object[] args = null;
  70:
  71:            Object result = srCallMethod("getWinner", argTypes, args);
  72:            return (java.lang.String) result;
  73:        } catch (InvocationTargetException e) {
  74:            if (e.getTargetException() instanceof br.shob.ShobException) {
  75:                throw (br.shob.ShobException) e.getTargetException();
  76:            }
  77:            throw new ShobException(e);
  78:        }
  79:    } catch (InvocationException e) {
  80:      throw new ShobException(e);
  81:    }
  82:  }
  83:
  84:  public void doBid(double p1, java.lang.String p2)
  85:    throws ShobException,
  86:           auction.core.InvalidBidException {
  87:    try {// shared try
  88:        try {// call method try
  89:            srBeginTrans();
  90:            Class[] argTypes = new Class[] {                                          Double.TYPE,
  91:                                          java.lang.String.class};
  92:            Object[] args = new Object[] {                                        new Double(p1),
  93:                                        p2};
  94:
  95:            Object result = srCallMethod("doBid", argTypes, args);
  96:            srCommit();
  97:        } catch (InvocationTargetException e) {
  98:            srRollback();
  99:            if (e.getTargetException() instanceof auction.core.InvalidBidException) {
 100:                throw (auction.core.InvalidBidException) e.getTargetException();
 101:            }
 102:            else if (e.getTargetException() instanceof br.shob.ShobException) {
 103:                throw (br.shob.ShobException) e.getTargetException();
 104:            }
 105:            throw new ShobException(e);
 106:        }
 107:    } catch (AlreadyLockedException e) {
 108:      throw new ShobException(e);
 109:    } catch (NotLockedException e) {
 110:      throw new ShobException(e);
 111:    } catch (InvocationException e) {
 112:      throw new ShobException(e);
 113:    }
 114:  }
 115:
 116:}