Package org.gatein.wsrp.consumer

Examples of org.gatein.wsrp.consumer.ProducerInfo


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


      ProducerInfo info = new ProducerInfo();
      info.setId(id);
      info.setRegistry(this);
      info.setExpirationCacheSeconds(expirationCacheSeconds);

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

      log.info(CONSUMER_WITH_ID + id + "' created");
      return createConsumerFrom(info);
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);
         }

         deactivateConsumerWith(id);
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);
   }
View Full Code Here

      consumers = new TreeMap<String, WSRPConsumer>();

      Iterator producerInfos = getAllProducerInfos();

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

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

         createConsumerFrom(producerInfo);

         try
         {
            // if the producer is marked as active, activate it fo' real! :)
            if (producerInfo.isActive())
            {
               activateConsumerWith(producerInfo.getId());
            }
         }
         catch (Exception e)
         {
            producerInfo.setActive(false);
            updateProducerInfo(producerInfo);
         }

      }
   }
View Full Code Here

      if (DEBUG)
      {
         System.out.println("newchild service " + localName);
      }

      ProducerInfo prodInfo = consumer.getProducerInfo();

      if ("endpoint-config".equals(localName) || "endpoint-wsdl-url".equals(localName))
      {
         return prodInfo.getEndpointConfigurationInfo();
      }
      else if ("registration-data".equals(localName))
      {
         return new RegistrationInfo(prodInfo);
      }
View Full Code Here

   }

   public void addChild(SortedMap<String, WSRPConsumer> consumers, WSRPConsumer consumer, UnmarshallingContext nav, String nsURI,
                        String localName)
   {
      ProducerInfo info = consumer.getProducerInfo();

      if (DEBUG)
      {
         System.out.println("adding consumer " + info.getId() + " to deployment - localName: " + localName);
      }

      String id = consumer.getProducerId();
      consumers.put(id, consumer);
      log.info("Added consumer for producer '" + id + "' from xml configuration.");


      // update the producer info once the whole information is known
      try
      {
         consumerRegistry.updateProducerInfo(info);
      }
      catch (Exception e)
      {
         // if we couldn't update the info, remove it from the list of service to be activated
         consumers.remove(id);
         log.info("Couldn't update the ProducerInfo for Consumer '" + info.getId() + "'", e);
      }
   }
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

   public void setId(String id)
   {
      if (consumer != null)
      {
         // renaming scenario
         ProducerInfo info = getProducerInfo();
         String oldId = info.getId();

         // need to check that the new id is valid
         if (isOldAndNewDifferent(oldId, id))
         {
            id = checkAndReturnValueIfValid(id, "edit-cons-form:id");
            if (id != null)
            {
               info.setId(id);

               // properly update the registry after change of id
               getRegistry().updateProducerInfo(info);

               // we're not using modifyIfNeeded here to avoid double equality check, so we need to set modified manually
View Full Code Here

      return getProducerInfo().isRegistrationRequired();
   }

   public boolean isRegistrationCheckNeeded()
   {
      ProducerInfo info = getProducerInfo();
      if (info.isRefreshNeeded(true))
      {
         RegistrationInfo regInfo = info.getRegistrationInfo();
         if (regInfo == null)
         {
            return true;
         }
         else
View Full Code Here

      }
   }

   public boolean isDisplayExpectedNeeded()
   {
      ProducerInfo producerInfo = getProducerInfo();

      // only show expected registration info if it is different from the one we currently have
      return producerInfo.isModifyRegistrationRequired() && !producerInfo.getRegistrationInfo().equals(producerInfo.getExpectedRegistrationInfo());
   }
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.