Package javax.resource

Examples of javax.resource.ResourceException


    }
    List<SaveResult> result;
      try {
        result = sfSoap.update(params, sh);
      } catch (InvalidFieldFault e) {
        throw new ResourceException(e);
      } catch (com.sforce.soap.partner.InvalidSObjectFault e) {
        throw new ResourceException(e);
      } catch (InvalidIdFault e) {
        throw new ResourceException(e);
      } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
        throw new ResourceException(e);
      }
    return analyzeResult(result);
  }
View Full Code Here


  }
 
  private int analyzeResult(List<SaveResult> results) throws ResourceException {
    for (SaveResult result : results) {
      if(!result.isSuccess()) {
        throw new ResourceException(result.getErrors().get(0).getMessage());
      }
    }
    return results.size();
  }
View Full Code Here

  public UpdatedResult getUpdated(String objectType, XMLGregorianCalendar startDate, XMLGregorianCalendar endDate) throws ResourceException {
      GetUpdatedResult updated;
      try {
        updated = sfSoap.getUpdated(objectType, startDate, endDate, sh);
      } catch (com.sforce.soap.partner.InvalidSObjectFault e) {
        throw new ResourceException(e);
      } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
        throw new ResourceException(e);
      }
      UpdatedResult result = new UpdatedResult();
      result.setLatestDateCovered(updated.getLatestDateCovered().toGregorianCalendar());
      result.setIDs(updated.getIds());
      return result;
View Full Code Here

      XMLGregorianCalendar endCalendar) throws ResourceException {
      GetDeletedResult deleted;
      try {
        deleted = sfSoap.getDeleted(objectName, startCalendar, endCalendar, sh);
      } catch (com.sforce.soap.partner.InvalidSObjectFault e) {
        throw new ResourceException(e);
      } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
        throw new ResourceException(e);
      }
      DeletedResult result = new DeletedResult();
      result.setLatestDateCovered(deleted.getLatestDateCovered().toGregorianCalendar());
      result.setEarliestDateAvailable(deleted.getEarliestDateAvailable().toGregorianCalendar());
      List<DeletedRecord> records = deleted.getDeletedRecords();
View Full Code Here

      }
      result.setSize(result.getRecords().size());
      result.setDone(true);
      return result;     
    } catch (InvalidFieldFault e) {
      throw new ResourceException(e);
    } catch (MalformedQueryFault e) {
      throw new ResourceException(e);
    } catch (com.sforce.soap.partner.InvalidSObjectFault e) {
      throw new ResourceException(e);
    } catch (InvalidIdFault e) {
      throw new ResourceException(e);
    } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
      throw new ResourceException(e);
    }
   
  }
View Full Code Here

  public DescribeGlobalResult getObjects() throws ResourceException {
    try {
      return sfSoap.describeGlobal(sh);
    } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
      throw new ResourceException(e);
    }
  }
View Full Code Here

  public DescribeSObjectResult getObjectMetaData(String objectName) throws ResourceException {
    try {
      return sfSoap.describeSObject(objectName, sh);
    } catch (com.sforce.soap.partner.InvalidSObjectFault e) {
      throw new ResourceException(e);
    } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
      throw new ResourceException(e);
    }
  }
View Full Code Here

  }

  @Override
  public void associateConnection(Object handle) throws ResourceException {
    if (!(handle instanceof WrappedConnection)) {
      throw new ResourceException("Wrong connection supplied to assosiate"); //$NON-NLS-1$
    }
    ((WrappedConnection)handle).setManagedConnection(this);
    synchronized (this.handles) {
      this.handles.add((WrappedConnection)handle);
    }
View Full Code Here

    }
  }
 
   Connection getConnection() throws ResourceException {
      if (this.physicalConnection == null)
         throw new ResourceException("Connection has been destroyed!!!"); //$NON-NLS-1$
      return this.physicalConnection;
  
View Full Code Here

 
    public static <T> T getInstance(Class<T> expectedType, String className, Collection ctorObjs, Class defaultClass) throws ResourceException {
      try {
        if (className == null) {
          if (defaultClass == null) {
            throw new ResourceException("Neither class name or default class specified to create an instance"); //$NON-NLS-1$
          }
          return expectedType.cast(defaultClass.newInstance());
        }
        return expectedType.cast(ReflectionHelper.create(className, ctorObjs, Thread.currentThread().getContextClassLoader()));
    } catch (TeiidException e) {
      throw new ResourceException(e);
    } catch (IllegalAccessException e) {
      throw new ResourceException(e);
    } catch(InstantiationException e) {
      throw new ResourceException(e);
    }     
    }
View Full Code Here

TOP

Related Classes of javax.resource.ResourceException

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.