Package org.gatein.wsrp.consumer

Examples of org.gatein.wsrp.consumer.ProducerInfo


   public void persistConsumer(WSRPConsumer consumer)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");

      ProducerInfo info = consumer.getProducerInfo();

      save(info, CONSUMER_WITH_ID + info.getId() + "' couldn't be persisted!");

      createConsumerFrom(info);
   }
View Full Code Here


      initConsumers(null);

      Iterator<ProducerInfo> producerInfos = getProducerInfosFromStorage();

      // load the configured producers
      ProducerInfo producerInfo;
      while (producerInfos.hasNext())
      {
         producerInfo = producerInfos.next();

         // need to set the registry after loading from DB since registry is not persisted.
         producerInfo.setRegistry(this);

         createConsumerFrom(producerInfo);
      }
   }
View Full Code Here

   protected void add(WSRPConsumer consumer)
   {
      String id = consumer.getProducerId();
      consumers.put(id, consumer);
      ProducerInfo info = consumer.getProducerInfo();
      keysToIds.put(info.getKey(), id);
   }
View Full Code Here

         }

         for (WSRPConsumer consumer : getConsumers())
         {

            ProducerInfo producerInfo = consumer.getProducerInfo();
            try
            {
               // try to activate the consumer
               activateConsumer(consumer);
            }
            catch (Exception e)
            {
               producerInfo.setActive(false);
               updateProducerInfo(producerInfo);
            }
         }
      }
   }
View Full Code Here

            }
         }
      }
      else if (invocation instanceof EventInvocation)
      {
         final ProducerInfo producerInfo = consumer.getProducerInfo();
         if (producerInfo.getSupportedOptions().contains(WSRP2Constants.OPTIONS_EVENTS))
         {
            handler = eventHandler;
         }
         else
         {
            // do something better here?
            return new ErrorResponse("Producer " + producerInfo.getId() + " doesn't support event processing.");
         }
      }
      else
      {
         throw new InvocationException("Unknown invocation type: " + invocation);
View Full Code Here

      {
         throw new ConsumerException(CONSUMER_WITH_ID + id + "' already exists!");
      }


      ProducerInfo info = new ProducerInfo(this);
      info.setId(id);
      info.setExpirationCacheSeconds(expirationCacheSeconds);
      info.getEndpointConfigurationInfo().setWsdlDefinitionURL(wsdlURL);

      save(info, "Couldn't create Consumer '" + id + "'");

      log.debug(CONSUMER_WITH_ID + id + "' created");
      return createConsumerFrom(info, true);
View Full Code Here

      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Destroying a Consumer");

      WSRPConsumer consumer = getConsumer(id);
      if (consumer != null)
      {
         ProducerInfo info = consumer.getProducerInfo();

         try
         {
            consumer.releaseSessions();
         }
         catch (PortletInvokerException e)
         {
            log.debug("releaseSessions failed when attempting to destroy " + CONSUMER_WITH_ID + id + "'");
         }

         // if the consumer is registered, deregister it
         if (info.isRegistered())
         {
            registerOrDeregisterConsumerWith(id, false);
         }

         deactivateConsumer(consumer);
View Full Code Here

   public void persistConsumer(WSRPConsumer consumer)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");

      ProducerInfo info = consumer.getProducerInfo();

      save(info, CONSUMER_WITH_ID + info.getId() + "' couldn't be persisted!");

      createConsumerFrom(info, true);
   }
View Full Code Here

      startOrStopConsumer(consumer, false, true);
   }

   public long getPersistedLastModifiedForProducerInfoWith(String id)
   {
      ProducerInfo producerInfo = loadProducerInfo(id);
      if (producerInfo == null)
      {
         return Long.MIN_VALUE;
      }
      else
      {
         return producerInfo.getLastModified();
      }
   }
View Full Code Here

      if (startConsumers)
      {
         for (WSRPConsumer consumer : consumerz)
         {
            final ProducerInfo info = consumer.getProducerInfo();
            if (info.isActive() && !consumer.isActive())
            {
               try
               {
                  consumer.refresh(false);
               }
               catch (Exception e)
               {
                  log.info("Couldn't activate consumer " + consumer.getProducerId());
                  info.setActiveAndSave(false);
               }
            }
         }
      }
View Full Code Here

TOP

Related Classes of org.gatein.wsrp.consumer.ProducerInfo

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.