Package org.nightlabs.jfire.trade

Examples of org.nightlabs.jfire.trade.TradeManagerRemote


  @Override
  protected Collection<Offer> retrieveJDOObjects(Set<OfferID> offerIDs,
      String[] fetchGroups, int maxFetchDepth, ProgressMonitor monitor)
      throws Exception
  {
    TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
    return tm.getOffers(offerIDs, fetchGroups, maxFetchDepth);
  }
View Full Code Here


    QueryCollection<? extends AbstractJDOQuery> queries,
    String[] fetchGroups,  int maxFetchDepth, ProgressMonitor monitor)
  {
    try
    {
      TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
      Set<OfferID> offerIDs = tm.getOfferIDs(queries);

      return getJDOObjects(null, offerIDs, fetchGroups, maxFetchDepth, monitor);
    }
    catch (Exception e) {
      throw new RuntimeException("Cannot fetch Offers via Queries.", e); //$NON-NLS-1$
View Full Code Here

  )
  {
    Offer offer;
    monitor.beginTask("Set offer expiry", 100);
    try {
      TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
      monitor.worked(20);
      offer = tm.setOfferExpiry(
          offerID,
          expiryTimestampUnfinalized, expiryTimestampUnfinalizedAutoManaged,
          expiryTimestampFinalized, expiryTimestampFinalizedAutoManaged,
          get, fetchGroups, maxFetchDepth
      );
View Full Code Here

  public void signalOffer(OfferID offerID, String jbpmTransitionName, ProgressMonitor monitor)
  {
    monitor.beginTask("Signal Offer", 100);
    try {
      TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
      monitor.worked(20);
      tm.signalOffer(offerID, jbpmTransitionName);
      monitor.worked(80);
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
      monitor.done();
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  protected Collection<LegalEntity> retrieveJDOObjects(
      Set<AnchorID> objectIDs, String[] fetchGroups, int maxFetchDepth,
      ProgressMonitor monitor) throws Exception {
    TradeManagerRemote tradeManager = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
    Collection<LegalEntity> legalEntities = tradeManager.getLegalEntities(objectIDs, fetchGroups, maxFetchDepth);

//    IStruct struct = StructLocalDAO.sharedInstance().getStructLocal(
//        Organisation.DEV_ORGANISATION_ID,
//        Person.class,
//        Person.STRUCT_SCOPE,
View Full Code Here

   * {@inheritDoc}
   */
  public LegalEntity storeJDOObject(LegalEntity jdoObject, boolean get,
      String[] fetchGroups, int maxFetchDepth, ProgressMonitor monitor) {
    try {
      TradeManagerRemote tradeManager = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
      LegalEntity le = tradeManager.storeLegalEntity(jdoObject, get, fetchGroups, maxFetchDepth);
      if (le != null)
        getCache().put(null, le, fetchGroups, maxFetchDepth);
      return le;
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

      OrganisationLegalEntity le = (OrganisationLegalEntity) getCache().get(null, objectID, fetchGroups, maxFetchDepth);
      if (le != null)
        return le;

      TradeManagerRemote tradeManager = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
      le = tradeManager.getOrganisationLegalEntity(organisationID, throwExceptionIfNotExistent, fetchGroups, maxFetchDepth);
      if (le != null) {
        getCache().put(null, objectID, le, fetchGroups, maxFetchDepth);
        getCache().put(null, le, fetchGroups, maxFetchDepth);
      }
      return le;
View Full Code Here

          AccountingManagerRemote am = JFireEjb3Factory.getRemoteBean(AccountingManagerRemote.class, SecurityReflector.getInitialContextProperties());
          Set<InvoiceID> invoiceIDs = CollectionUtil.castSet(articleContainerIDs);
          return am.getInvoices(invoiceIDs, fetchGroups, maxFetchDepth);
        }
        if (articleContainerID instanceof OfferID) {
          TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
          Set<OfferID> offerIDs = CollectionUtil.castSet(articleContainerIDs);
          return tm.getOffers(offerIDs, fetchGroups, maxFetchDepth);
        }
        if (articleContainerID instanceof OrderID) {
          TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
          Set<OrderID> orderIDs = CollectionUtil.castSet(articleContainerIDs);
          return tm.getOrders(orderIDs, fetchGroups, maxFetchDepth);
        }
        if (articleContainerID instanceof ReceptionNoteID) {
          StoreManagerRemote sm = JFireEjb3Factory.getRemoteBean(StoreManagerRemote.class, SecurityReflector.getInitialContextProperties());
          Set<ReceptionNoteID> receptionNoteIDs = CollectionUtil.castSet(articleContainerIDs);
          return sm.getReceptionNotes(receptionNoteIDs, fetchGroups, maxFetchDepth);
View Full Code Here

      QueryCollection<? extends AbstractArticleContainerQuery> queries,
      String[] fetchGroups,
      int maxFetchDepth, ProgressMonitor monitor)
  {
    try {
      TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
      Collection<ArticleContainerID> articleContainerIDs = tm.getArticleContainerIDs(queries);
      return CollectionUtil.castCollection(
        getJDOObjects(null, articleContainerIDs, fetchGroups, maxFetchDepth, monitor)
        );
    }
    catch (Throwable t) {
View Full Code Here

      QueryCollection<? extends AbstractArticleContainerQuery> queries,
      String[] fetchGroups, int maxFetchDepth, ProgressMonitor monitor)
  {
    try {
      monitor.beginTask("Load Delivery Date Information", 500);
      TradeManagerRemote tm = JFireEjb3Factory.getRemoteBean(TradeManagerRemote.class, SecurityReflector.getInitialContextProperties());
      Collection<ArticleContainerDeliveryDateDTO> dtos = tm.getArticleContainerDeliveryDateDTOs(queries);
      for (ArticleContainerDeliveryDateDTO dto : dtos) {
        ArticleContainer ac = getArticleContainer(dto.getArticleContainerID(), fetchGroups, maxFetchDepth, new SubProgressMonitor(monitor, 100 / dtos.size()));
        dto.setArticleContainer(ac);
        Collection<Article> articles = ArticleDAO.sharedInstance().getArticles(dto.getArticleIDs(), fetchGroups, maxFetchDepth, new SubProgressMonitor(monitor, 300 / dtos.size()));
        for (Article article : articles) {
View Full Code Here

TOP

Related Classes of org.nightlabs.jfire.trade.TradeManagerRemote

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.