Examples of Properties


Examples of org.apache.openejb.junit.jee.config.Properties

                properties.load(is);
            }
        }

        final Properties annotationConfig = clazz.getAnnotation(Properties.class);
        if (annotationConfig != null) {
            for (final Property property : annotationConfig.value()) {
                properties.put(property.key(), property.value());
            }
        }

        if (!properties.containsKey(Context.INITIAL_CONTEXT_FACTORY)) {
View Full Code Here

Examples of org.apache.pluto.portalImpl.util.Properties

            context = aConfig.getServletContext ();

        if (context != null)
            context.log ("ServiceManager: Loading services...");

        Properties props = new Properties ();

        try
        {
            props.load (context.getResourceAsStream (aServiceConfigFile));
        }
        catch (IOException exc)
        {
            if (context != null)
                context.log ("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
            throw new Exception("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
        }

        int numAll = 0;
        int numSuccessful = 0;

        for (Iterator iter = props.names (); iter.hasNext (); )
        {
            String serviceBaseName = (String) iter.next ();

            numAll++;

            // ty to get hold of the base service

            Class serviceBase;

            try
            {
                serviceBase = Class.forName (serviceBaseName);
            }
            catch (ClassNotFoundException exc)
            {
                if (context != null)
                    context.log ("ServiceManager: A service with name " + serviceBaseName + " cannot be found.");

                continue;
            }

            String serviceImplName = props.getString (serviceBaseName);

            Class serviceImpl = null;

            Service service = null;

            try
            {
                serviceImpl = Class.forName (serviceImplName);

                service = (Service) serviceImpl.newInstance ();

                Properties serviceProps = new Properties ();

                try
                {
                    InputStream is = null;

                    is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceImpl) + ".properties");

                    if (is == null)
                        is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceBase) + ".properties");

                    if (is != null)
                        serviceProps.load (is);
                }
                catch (IOException exc)
                {
                    // ignore -- we go without properties then
                }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.type.messaging.Properties

                header.setTtl(UnsignedInteger.valueOf(deliveryProps.getTtl()));
            }
            sections.add(header);
        }

        Properties props = new Properties();

        /*
            TODO: the current properties are not currently set:

            absoluteExpiryTime
            creationTime
            groupId
            groupSequence
            replyToGroupId
            to
        */

        if(msgProps != null)
        {
            if(msgProps.hasContentEncoding())
            {
                props.setContentEncoding(Symbol.valueOf(msgProps.getContentEncoding()));
            }

            if(msgProps.hasCorrelationId())
            {
                props.setCorrelationId(msgProps.getCorrelationId());
            }

            if(msgProps.hasMessageId())
            {
                props.setMessageId(msgProps.getMessageId());
            }
            if(msgProps.hasReplyTo())
            {
                props.setReplyTo(msgProps.getReplyTo().getExchange()+"/"+msgProps.getReplyTo().getRoutingKey());
            }
            if(msgProps.hasContentType())
            {
                props.setContentType(Symbol.valueOf(msgProps.getContentType()));

                // Modify the content type when we are dealing with java object messages produced by the Qpid 0.x client
                if(props.getContentType() == Symbol.valueOf("application/java-object-stream"))
                {
                    props.setContentType(Symbol.valueOf("application/x-java-serialized-object"));
                }
            }

            props.setSubject(serverMessage.getRoutingKey());

            if(msgProps.hasUserId())
            {
                props.setUserId(new Binary(msgProps.getUserId()));
            }

            sections.add(props);

            if(msgProps.getApplicationHeaders() != null)
View Full Code Here

Examples of org.apache.qpid.proton.amqp.messaging.Properties

         Integer size = message.getIntProperty(PROTON_MESSAGE_SIZE_SS);

         Header header = populateHeader(message, deliveryCount);
         DeliveryAnnotations deliveryAnnotations = populateDeliveryAnnotations(message);
         MessageAnnotations messageAnnotations = populateMessageAnnotations(message);
         Properties props = populateProperties(message);
         ApplicationProperties applicationProperties = populateApplicationProperties(message);
         Section section = populateBody(message);
         Footer footer = populateFooter(message);
         Set<SimpleString> propertyNames = message.getPropertyNames();
         for (SimpleString propertyName : propertyNames)
View Full Code Here

Examples of org.apache.stratos.cloud.controller.stub.pojo.Properties

        this.partitionAlgo = value;
    }
   
    public void setPartitions(Partition[] partitions) {
        this.partitions = partitions;
        partitions[0].setProperties(new Properties());
    }
View Full Code Here

Examples of org.apache.stratos.cloud.controller.util.xsd.Properties

    private static Properties setRegisterServiceProperties(Policy policy, int tenantId, String alias) {
     
      DecimalFormat df = new DecimalFormat("##.##");
        df.setParseBigDecimal(true);

        Properties properties = new Properties();
        List<Property> allProperties = new ArrayList<Property>();
        // min_app_instances
        Property property = new Property();
        property.setName("min_app_instances");
        property.setValue(df.format(policy.getMinAppInstances()));
        allProperties.add(property);
       
       
     // max_app_instances
        property = new Property();
        property.setName("max_app_instances");
        property.setValue(df.format(policy.getMaxAppInstances()));
        allProperties.add(property);
       
        // max_requests_per_second
        property = new Property();
        property.setName("max_requests_per_second");
        property.setValue(df.format(policy.getMaxRequestsPerSecond()));
        allProperties.add(property);
       
        // alarming_upper_rate
        property = new Property();
        property.setName("alarming_upper_rate");
        property.setValue(df.format(policy.getAlarmingUpperRate()));
        allProperties.add(property);
       
     // alarming_lower_rate
        property = new Property();
        property.setName("alarming_lower_rate");
        property.setValue(df.format(policy.getAlarmingLowerRate()));
        allProperties.add(property);
       
        // scale_down_factor
        property = new Property();
        property.setName("scale_down_factor");
        property.setValue(df.format(policy.getScaleDownFactor()));
        allProperties.add(property);
       
     // rounds_to_average
        property = new Property();
        property.setName("rounds_to_average");
        property.setValue(df.format(policy.getRoundsToAverage()));
        allProperties.add(property);
       
       // tenant id
        property = new Property();
        property.setName("tenant_id");
        property.setValue(String.valueOf(tenantId));
        allProperties.add(property);
       
        // alias
        property = new Property();
        property.setName("alias");
        property.setValue(String.valueOf(alias));
        allProperties.add(property);
       
        properties.setProperties(allProperties.toArray(new Property[allProperties.size()]));
        return properties;
    }
View Full Code Here

Examples of org.apache.wicket.resource.Properties

        ResourceNameIterator iter = newResourceNameIterator(path, locale, style, variation);
        while (iter.hasNext())
        {
          String newPath = iter.next();

          Properties props = propertiesFactory.load(clazz, newPath);
          if (props != null)
          {
            // Lookup the value
            String value = props.getString(key);
            if (value != null)
            {
              return value;
            }
          }
View Full Code Here

Examples of org.apache.ws.resource.discovery.xml.PropertiesDocument.Properties

      Agent agent2 = agents[1];

      Assert.assertNotNull( agent1.getProperties(  ) );
      Assert.assertNotNull( agent2.getProperties(  ) );

      Properties agent1Props = agent1.getProperties(  );

      Assert.assertNotNull( agent1Props );

      Property[] propArry = agent1Props.getPropertyArray(  );

      Assert.assertNotNull( propArry );
      Assert.assertEquals( propArry.length, 3 );

      Property prop1 = propArry[0];
View Full Code Here

Examples of org.chromattic.api.annotations.Properties

      }
    }

    // Property map
    for (PropertyInfo propertyInfo : info.getProperties(Properties.class)) {
      Properties propertyAnnotation = propertyInfo.getAnnotation(Properties.class);
      if (propertyInfo instanceof MapPropertyInfo) {
        MapPropertyInfo mapPropertyInfo = (MapPropertyInfo)propertyInfo;
        PropertyMapMapping simpleMapping = new PropertyMapMapping();
        PropertyMapping<PropertyMapMapping> propertyMapping = new PropertyMapping<PropertyMapMapping>(mapPropertyInfo, simpleMapping);
        propertyMappings.add(propertyMapping);
View Full Code Here

Examples of org.dmlite.model.component.property.Properties

   *            domain model
   */
  public Concept(IDomainModel domainModel) {
    super(domainModel);
    // internal child neighbors only
    properties = new Properties(this);
    neighbors = new Neighbors(this);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.