Package simtools.data

Examples of simtools.data.DataSourceCollection$Container


                     mappedName = "java:comp/UserTransaction";
                  }
               }
               else if (TimerService.class.getName().equals(envRef.getType()))
               {
                  final Container ic = (Container) container;
                  InjectorFactory<?> factory = new InjectorFactory<TimerServicePropertyInjector>()
                  {
                     public TimerServicePropertyInjector create(BeanProperty property)
                     {
                        return new TimerServicePropertyInjector(property, ic);
View Full Code Here


                     mappedName = "java:comp/UserTransaction";
                  }
               }
               else if (resType.equals(TimerService.class))
               {
                  final Container ic = (Container) container;
                  InjectorFactory<?> factory = new InjectorFactory<TimerServicePropertyInjector>()
                  {
                     public TimerServicePropertyInjector create(BeanProperty property)
                     {
                        return new TimerServicePropertyInjector(property, ic);
View Full Code Here

      }
      // search everywhere
      Iterator containers = Ejb3Registry.getContainers().iterator();
      while (containers.hasNext())
      {
         Container container = (Container)containers.next();
         EJBContainer ejbContainer = (EJBContainer) container;
         if (ejbContainer == rtnContainer) continue;
         if (ProxyFactoryHelper.publishesInterface(container, businessIntf))
         {
            if (rtnContainer != null)
View Full Code Here

   public static final String PARTITION_NAME = "PARTITION_NAME";
  
   public Object invoke(Invocation invocation) throws Throwable
   {
      Container localContainer = findLocalContainer(invocation);
      if (localContainer != null)
      {
         return invokeLocal(invocation, localContainer);
      }
      return invocation.invokeNext();
View Full Code Here

   private Container findLocalContainer(Invocation invocation)
   {
      String guid = (String)invocation.getMetaData(IS_LOCAL, GUID);
      String partitionName = (String) invocation.getMetaData(PARTITION_NAME, PARTITION_NAME);
     
      Container container = null;
      try
      {
         container = Ejb3Registry.findContainer(guid);
         if (container == null)
         {
View Full Code Here

        return factory.createLocator(field);
    }

    private Object decorateContainer(final ClassLoader loader, final Field field) {
        final WebElement wrappedElement = proxyForLocator(loader, createLocator(field));
        final Container container = containerFactory.create((Class<? extends Container>) field.getType(), wrappedElement);

        PageFactory.initElements(new ExtendedFieldDecorator(wrappedElement), container);
        return container;
    }
View Full Code Here

    dscId = dscId.substring(marker.length());

    // Try to get data source from pool
    // If conflicts with other data source collections, consider the fisrt DataSourceCollectionAnimator
    DataSourceCollection existingDsc=null;
    if (pool != null){
      try {
        existingDsc = pool.getCollectionForDataSourceId(id);
      } catch (DuplicateIdException e) {
        //  Eliminates the collections that are not TimeStamped
        for (Iterator it = e.conflicts.iterator(); it.hasNext();) {
          DataSourceCollection d = (DataSourceCollection) it.next();
          if (!(d instanceof DataSourceCollectionAnimator)){
            it.remove();
            continue;
          }
        }
        if (e.conflicts.size() == 0)
          existingDsc = null;

        else if (e.conflicts.size() > 0)
          existingDsc = (DataSourceCollectionAnimator) e.conflicts.get(0);
      }
    }

    if ( (existingDsc!=null) &&  (existingDsc instanceof DataSourceCollectionAnimator)){
      if (chooseUseCollection(existingDsc, dscId, id)==YES_OPTION)
        return existingDsc.get(id);
    }


    // Otherwise create a new collection
    long period = ((Long)(((Object[])optionalInformation)[1])).longValue();
    boolean autostop = ((Boolean)(((Object[])optionalInformation)[2])).booleanValue();
    Object realOption = ((Object[])optionalInformation)[3];

    DataSourcePool poolToSearch = pool;
    if (pool==null) poolToSearch=DataSourcePool.global;

    // Do not add the result in the datapool yet, but rather add this object on success
    DataSource ds = poolToSearch.provide(id,dscId,realOption,false);
    if (ds==null) return null;

    if (ds instanceof EmptyDataSource){
      DefaultEmptyDataSource emptyDs = new DefaultEmptyDataSource(id, marker + dscId, optionalInformation);
      EmptyDataSourcePool.global.addEmptyDaSource(id, emptyDs);
          return emptyDs;
    }
   
    if (ds instanceof BufferedDataSource) ds = ((BufferedDataSource)ds).dataSource;
    if (!(ds instanceof CollectiveDataSource)) return null;
    DataSourceCollection dsc = ((CollectiveDataSource)ds).getCollection();
    int i = ((CollectiveDataSource)ds).getPosition();

    DataSourceCollectionAnimator dsca = new DataSourceCollectionAnimator(dsc);
    dsca.setPeriod(period);
    dsca.setAutoStop(autostop);
View Full Code Here

                  else{
                      add(ds, dataInfo.timeReference, dataInfo.isRelative, dataInfo.offset, dataInfo.initialDate);
                  }

              } else// merge all collection
                  DataSourceCollection dsc = SynchronousMergeDataSourceInformation.creationCollectionFromDataSource(ds);
                  if (dsc != null){
                      if (dsc instanceof TimeStampedDataSourceCollection){
                          add((TimeStampedDataSourceCollection)dsc, dataInfo.offset, dataInfo.initialDate);
                      }else{
                          add(dsc, dataInfo.timeReference,dataInfo.isRelative,  dataInfo.offset, dataInfo.initialDate);  
View Full Code Here

  public DataSource provide(String id, String dscId, Object optionalInformation, DataSourcePool pool){
    if ((id==null) || (dscId==null) || !(dscId.startsWith(JSAsynchronousMergeDSCollection.ID_MARKER) || dscId.startsWith(JSSynchronousMergeDSCollection.ID_MARKER)))
      return null;

    DataSource foundDS = null;
    DataSourceCollection adsc = null;
   
    MergeDataException.mergeDataErrors.clear();   // clear merge errors list
    try {
     
      if (dscId.startsWith(JSAsynchronousMergeDSCollection.ID_MARKER))
        adsc = new JSAsynchronousMergeDSCollection((AsynchronousMergeDSCollectionInformation)optionalInformation);
      else
        adsc = new JSSynchronousMergeDSCollection((SynchronousMergeDSCollectionInformation)optionalInformation);

      if ((adsc==null) || !(adsc instanceof DataSourceCollection)){
        return null;
      }
      for (int i = 0; i < adsc.size(); ++i) {
        if (id.equals( adsc.getInformation(i).id)) {
          foundDS = (DataSource) adsc.get(i);
          break;
        }
      }
    } catch (Exception e) {} 
View Full Code Here

                      add((TimeStampedDataSource)ds,  dataInfo.offset, dataInfo.initialDate);
                  else{
                      add(ds, dataInfo.timeReference, dataInfo.isRelative, dataInfo.offset, dataInfo.initialDate);
                  }
              }else// merge all collection
                  DataSourceCollection dsc = AsynchronousMergeDataSourceInformation.creationCollectionFromDataSource(ds);
                  if (dsc instanceof TimeStampedDataSourceCollection){
                      add((TimeStampedDataSourceCollection)dsc, dataInfo.offset, dataInfo.initialDate);
                  }else{

                      add(dsc, dataInfo.timeReference,  dataInfo.isRelative, dataInfo.offset,  dataInfo.initialDate)
View Full Code Here

TOP

Related Classes of simtools.data.DataSourceCollection$Container

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.