Package net.helipilot50.stocktrade.framework

Examples of net.helipilot50.stocktrade.framework.UsageException


        TransactionStack currentTransactions = _transactionStorage.get();
        if (currentTransactions.shouldIgnoreEndTransaction()) {
          return;
        }
        if (currentTransactions.empty()) {
            throw new UsageException("endTransaction called when not in a transaction");
        }
        TransactionData transactionData = (TransactionData)currentTransactions.peek();
        if (transactionData.rolledBack) {
            rollbackTransaction();
        }
View Full Code Here


     * @param pError
     */
    public static void abortNested(boolean pRaiseException, RuntimeException pError) {
        LightweightStack<TransactionData> currentTransactions = _transactionStorage.get();
        if (currentTransactions.empty()) {
            throw new UsageException("endTransaction called when not in a transaction");
        }
        TransactionData transactionData = (TransactionData)currentTransactions.peek();
        if (transactionData.getType() == TransactionType.NESTED) {
          // A nested transaction either commits or rolls back based on the scope of the
          // outer transaction. So it doesn't really matter if we commit it or roll it back
View Full Code Here

     * @param pError
     */
    public static void abort(boolean pRaiseException, RuntimeException pError) {
        LightweightStack<TransactionData> currentTransactions = _transactionStorage.get();
        if (currentTransactions.empty()) {
            throw new UsageException("abort called when not in a transaction");
        }
        while (!currentTransactions.isEmpty()) {
          TransactionMgr.rollbackTransaction();
        }
        // TF:27/04/2008:Also abort any distributed transactions we're partaking in.
View Full Code Here

     * a single transaction
     */
    public static void commit() {
        LightweightStack<TransactionData> currentTransactions = _transactionStorage.get();
        if (currentTransactions.empty()) {
            throw new UsageException("commit called when not in a transaction");
        }
        while (!currentTransactions.isEmpty()) {
          TransactionMgr.endTransaction();
        }
        // There's no need to complete the remote transactions, this should have been taken
View Full Code Here

     * In this case, the commitNested method is equivalent to commit.
     */
    public static void commitNested() {
        LightweightStack<TransactionData> currentTransactions = _transactionStorage.get();
        if (currentTransactions.empty()) {
            throw new UsageException("commitNested called when not in a transaction");
        }
        TransactionData transactionData = (TransactionData)currentTransactions.peek();
        if (transactionData.getType() == TransactionType.NESTED) {
          // A nested transaction either commits or rolls back based on the scope of the
          // outer transaction. So it doesn't really matter if we commit it or roll it back
View Full Code Here

     * In this case, the commitDependent method is equivalent to commit.
     */
    public static void commitDependent() {
        LightweightStack<TransactionData> currentTransactions = _transactionStorage.get();
        if (currentTransactions.empty()) {
            throw new UsageException("commitNested called when not in a transaction");
        }
        TransactionData transactionData = (TransactionData)currentTransactions.peek();
        if (transactionData.getType() == TransactionType.DEPENDENT) {
          // Use endTransaction to do the work for us, we know the state is consistent
          TransactionMgr.endTransaction();
View Full Code Here

//      TransactionMgr.beginDependentTransaction();
      TransactionMgr.beginDependentTransaction();

      try {
        if (true) {
          UsageException err = new UsageException();
          throw err;
        };
        TransactionMgr.commitDependent();
      }
      catch (Throwable x) {
View Full Code Here

              // TF:17/03/2009:To control the port this server listens on, use the following line:
              // exporter.setServicePort(serverPort);
              exporter.setRegistry(registry);
              exporter.afterPropertiesSet();
          } catch (RemoteException e) {
              UsageException errorVar = new UsageException("Cannot export object to RMI at ["  + port + "]" , e);
              ErrorMgr.addError(errorVar);
              exporter = null;
              throw errorVar;
          }
      }
View Full Code Here

      }
    }

    public AppContextHolder invoke(String objectId, String methodId, Object[] args, Map<String, Object>appContext) throws Throwable {
        if (!objectId.equals(objectName)) {
            UsageException errorVar = new UsageException("Expecting object id " + objectName + ", received " + objectId);
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
        Method invokedMethod = MethodMapper.getMethod(this.wrappedObject.getClass(), methodId);
        _log.debug("Invoking method " + invokedMethod + " on server");
View Full Code Here

     * @param pDataValue
     */
    public void getDataValue(int pColumnID, DataValue pDataValue) {
      // CraigM:25/09/2008 - Null check
      if (pDataValue == null) {
        throw new UsageException("The DataValue object specified for column "+pColumnID+" was null");
      }
      try {
          Class<?> classType = pDataValue.getClass();
        if (this.metaData == null)
          this.metaData = this.resultSet.getMetaData();
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.framework.UsageException

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.