Package net.helipilot50.stocktrade.framework.remoting

Examples of net.helipilot50.stocktrade.framework.remoting.RemoteInvocationResultWrapper


     * will be thrown.
     * @param pForce whether non-empty rows should be deleted or not.
     */
    public void deleteRow(GridField pField, int pPosition, boolean pForce) {
        if (pPosition < 0 || pPosition >= rows) {
            UsageException errorVar = new UsageException("pPosition must be in the range (0->" + (rows-1));
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
        int count = pField.getComponentCount();
        // Disable the collapse-on-delete feature temporarily, otherwise the logic becomes more
View Full Code Here


        case Constants.CA_LEFT:
        case Constants.CA_RIGHT:
            this.colAlignment = pAlignment;
            break;
        default:
            UsageException errorVar = new UsageException("Column alignment passed invalid value of " + pAlignment);
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
    }
View Full Code Here

        case Constants.RA_TOP:
        case Constants.RA_BOTTOM:
            this.rowAlignment = pAlignment;
            break;
        default:
            UsageException errorVar = new UsageException("Row alignment passed invalid value of " + pAlignment);
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
    }
View Full Code Here

                if (gbc.row == -1 || gbc.column == -1) {
                    gbc.row = 0;
                    gbc.column = 0;
                }
                else if (gbc.row < 0 || gbc.column < 0) {
                    UsageException errorVar = new UsageException("gridx and gridy should be >= 0, not row = " + gbc.row + ", column = " + gbc.column);
                    ErrorMgr.addError(errorVar);
                    throw errorVar;
                }
                else if (gbc.row >= rows || gbc.column >= columns) {
                  // TF:28/04/2008:if ignoreCollapse is true, we're doing the initial insert. In this case we don't
                  // have the rows and columns necessarily set, so we need to add the components in by expanding the grid
                  if (ignoreCollapse) {
                    // TF:09/05/2008:JIRA JCT-545:Since this is the initial insert, we must obey the
                    // constraints as posted. This means that we'll get the correct row and column
                    // even if a row or column appears empty when this element is inserted (because
                    // another element might be inserted later to make the empty row/column populated)
//                    if (isCollapsed()) {
//                      if (gbc.row >= rows) {
//                        gbc.row = rows;
//                      }
//                      if (gbc.column >= columns) {
//                        gbc.column = columns;
//                      }
//                    }
                    for (int i = rows; i <= gbc.row; i++) {
                      rowWeights.add(i, new Integer(0));
                    }
                    for (int i = columns; i <= gbc.column; i++) {
                      columnWeights.add(i, new Integer(0));
                    }
                    rows = Math.max(rows, gbc.row + 1);
                    columns = Math.max(columns, gbc.column + 1);
                  }
                  else {
                      // Using the replace policy, we never insert a column outside the grid
                    // TF:10/08/2008:JCT-582:If the grid field is empty, we allow the replace
                    if (parent.getComponentCount() == 0) {
                      fallThroughToExpand = true;
                    }
                    else {
                      return false;
                    }
                  }
                }
                if (!fallThroughToExpand) {
                  JComponent comp = parent.getChildInCell(gbc.row + 1, gbc.column + 1);
                  if (comp != null) {
                      parent.remove(comp);
                  }
                  break;
                }
               
        case Constants.IP_EXPAND:
            // If the row or column is -1, we shuffle everything up and across
            if (gbc.row == -1 || gbc.column == -1) {
                gbc.row = 0;
                gbc.column = 0;
                for (Component thisChild : parent.getComponents()) {
                    if (thisChild != newOne) {
                        GridCell effective = findConstraints(thisChild);
                        effective.row++;
                        effective.column++;
                    }
                }
                rows++;
                columns++;
                rowWeights.add(0, new Integer(0));
                columnWeights.add(0, new Integer(0));
            }
            else if (gbc.column < 0 || gbc.row < 0) {
                UsageException errorVar = new UsageException("gridx and gridy should be >= 0, not gridx = " + gbc.column + ", gridy = " + gbc.row);
                ErrorMgr.addError(errorVar);
                throw errorVar;
            }
            else if (gbc.column >= columns || gbc.row >= rows) {
                // If we need to collapse the columns, update the value passed so that it's the
View Full Code Here

              // There's one other possibility -- it just hasn't been injected yet. (eg if
              // the client accesses the database directly)
              result = (DBConnectionManager)ServiceObjectRegistry.getService(dataSourceName, DBConnectionManager.class);
              result.setDataSourceName(dataSourceName);
              if (result == null) {
                  throw new UsageException("Data source " + dataSourceName + " has not been injected into the DBConnectionMgr");
              }
          }
        }
        return result;
    }
View Full Code Here

   * @return a DBDatabaseDesc object which describes a collection of database
   *         tables.
   */
    public DBDatabaseDesc getDatabaseDesc(String tableNamePattern, int info){
      if ((info & Constants.DB_IN_COLUMNINFO) == 0) {
        throw new UsageException("You must specify DB_IN_COLUMNINFO in the info parameter if you specify either DB_IN_KEYINFO or DB_IN_FOREIGNKEYINFO.",
            SP_ER_PARAMETERERROR, SP_ER_USER, UsageException.qq_Resolver.cMESSAGE_REASONCODE_SEVERITY);
    }
        Connection connection = null;
        try {
            connection = this.getConnection();
View Full Code Here

            ResultSet rs = connection.getMetaData().getTables(null, null, pName, null);
            while (rs.next()) {
                tableNames.add(new TextData(rs.getString(3)));
            }
        } catch (SQLException e) {
            throw new UsageException(e);
        } finally {
            releaseConnection(connection);
        }
        return tableNames;
    }
View Full Code Here

            currentTransactions.get(0).currentInvoker = null;
          }
        return new RemoteInvocationResult(e.exception);
      }
      else if (result.getValue() instanceof RemoteInvocationResultWrapper) {
        RemoteInvocationResultWrapper wrapper = (RemoteInvocationResultWrapper)result.getValue();
        Boolean wasAborted = (Boolean)wrapper.getAttribute(WAS_ABORTED);
          LightweightStack<TransactionData> currentTransactions = _transactionStorage.get();
        if (wasAborted != null && wasAborted.booleanValue()) {
          // The remote transaction will have already rolled back, so don't bother with it
              if (!currentTransactions.empty()) {
              TransactionMgr.abortRemoteTransaction(currentTransactions.get(0));
View Full Code Here

        }
        }
        else {
          preProcessAttributeConsumers(bean, invocation);

            RemoteInvocationResultWrapper wrapper = new RemoteInvocationResultWrapper(invocation.invoke(targetObject));
            result = wrapper;

            postProcessAttributeProviders(invocation, wrapper, bean, targetObject);
        }
View Full Code Here

            if (invocation != null) {
                  String methodName = invocation.getMethodName();
                  preProcessAttributeConsumers(bean, invocation);
                      if (methodName.equals(COMMIT_TXN)) {
                    TransactionMgr.commitTransaction();
                    result = new RemoteInvocationResultWrapper("Commit successful");
                    terminateThread = true;
                  }
                  else if (methodName.equals(ROLLBACK_TXN)) {
                    TransactionMgr.rollbackTransaction();
                    result = new RemoteInvocationResultWrapper("Rollback successful");
                    terminateThread = true;
                  }
                  else if (methodName.equals(ABORT_TXN)) {
                    TransactionMgr.abort();
                    result = new RemoteInvocationResultWrapper("Abort successful");
                    terminateThread = true;
                  }
                  else {
                result = new RemoteInvocationResultWrapper(invocation.invoke(targetObject));
                  }
                      wasAborted = TransactionMgr.isAborted();
                      postProcessAttributeProviders(invocation, result, bean, targetObject);
                  // We also need to add an attribute which says if the distributed transaction
                  // was aborted or not. If it was, then we can kill this thread after we've returned
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.framework.remoting.RemoteInvocationResultWrapper

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.