Examples of ConfigMap


Examples of flex.messaging.config.ConfigMap

    /**
     *  Handle JMS specific configuration.
     */
    private void jms(ConfigMap properties)
    {
        ConfigMap jms = properties.getPropertyAsMap(JMS, null);
        if (jms != null)
        {
            String destType = jms.getPropertyAsString(DESTINATION_TYPE, defaultDestinationType);
            settings.setDestinationType(destType);

            String msgType = jms.getPropertyAsString(MESSAGE_TYPE, null);
            settings.setMessageType(msgType);

            String factory = jms.getPropertyAsString(CONNECTION_FACTORY, null);
            settings.setConnectionFactory(factory);

            ConfigMap connectionCredentials = jms.getPropertyAsMap(CONNECTION_CREDENTIALS, null);
            if (connectionCredentials != null)
            {
                String username = connectionCredentials.getPropertyAsString(USERNAME, null);
                settings.setConnectionUsername(username);               
                String password = connectionCredentials.getPropertyAsString(PASSWORD, null);               
                settings.setConnectionPassword(password);
            }
           
            ConfigMap deliverySettings = jms.getPropertyAsMap(DELIVERY_SETTINGS, null);
            if (deliverySettings != null)
            {
                // Get the default delivery settings.
                DeliverySettings ds = settings.getDeliverySettings();

                String mode = deliverySettings.getPropertyAsString(MODE, JMSConfigConstants.defaultMode);
                ds.setMode(mode);
               
                long receiveIntervalMillis = deliverySettings.getPropertyAsLong(SYNC_RECEIVE_INTERVAL_MILLIS, defaultSyncReceiveIntervalMillis);
                ds.setSyncReceiveIntervalMillis(receiveIntervalMillis);
               
                long receiveWaitMillis = deliverySettings.getPropertyAsLong(SYNC_RECEIVE_WAIT_MILLIS, defaultSyncReceiveWaitMillis);
                ds.setSyncReceiveWaitMillis(receiveWaitMillis);               
            }
           
            String destJNDI = jms.getPropertyAsString(DESTINATION_JNDI_NAME, null);
            settings.setDestinationJNDIName(destJNDI);

            String dest = jms.getPropertyAsString(DESTINATION_NAME, null);
            if (dest != null && Log.isWarn())
                Log.getLogger(LOG_CATEGORY).warn("The <destination-name> configuration option is deprecated and non-functional. Please remove this from your configuration file.");

            boolean durable = getDestination() instanceof MessageDestination ?
                ((MessageDestination) getDestination()).getServerSettings().isDurable() : false;
            settings.setDurableConsumers(durable);

            String deliveryMode = jms.getPropertyAsString(DELIVERY_MODE, null);
            settings.setDeliveryMode(deliveryMode);

            boolean preserveJMSHeaders = jms.getPropertyAsBoolean(PRESERVE_JMS_HEADERS, settings.isPreserveJMSHeaders());
            settings.setPreserveJMSHeaders(preserveJMSHeaders);
           
            String defPriority = jms.getPropertyAsString(MESSAGE_PRIORITY, null);
            if (defPriority != null && !defPriority.equalsIgnoreCase(DEFAULT_PRIORITY))
            {
                int priority = jms.getPropertyAsInt(MESSAGE_PRIORITY, settings.getMessagePriority());
                settings.setMessagePriority(priority);                   
            }
                       
            String ackMode = jms.getPropertyAsString(ACKNOWLEDGE_MODE, defaultAcknowledgeMode);
            settings.setAcknowledgeMode(ackMode);

            boolean transMode = jms.getPropertyAsBoolean(TRANSACTION_MODE, false);
            if (transMode && Log.isWarn())
                Log.getLogger(LOG_CATEGORY).warn("The <transacted-sessions> configuration option is deprecated and non-functional. Please remove this from your configuration file.");
             
            int maxProducers = jms.getPropertyAsInt(MAX_PRODUCERS, defaultMaxProducers);
            settings.setMaxProducers(maxProducers);

            // Retrieve any JNDI initial context environment properties.
            ConfigMap env = jms.getPropertyAsMap(INITIAL_CONTEXT_ENVIRONMENT, null);
            if (env != null)
            {
                List props = env.getPropertyAsList(PROPERTY, null);
                if (props != null)
                {
                    Class contextClass = Context.class;
                    Hashtable envProps = new Hashtable();
                    for (Iterator iter = props.iterator(); iter.hasNext();)
                    {
                        Object prop = iter.next();
                        if (prop instanceof ConfigMap)
                        {
                            ConfigMap pair = (ConfigMap)prop;
                            String name = pair.getProperty(NAME);
                            String value = pair.getProperty(VALUE);
                            if (name == null || value == null)
                            {
                                // A <property> element for the <initial-context-environment> settings for the ''{0}'' destination does not specify both <name> and <value> subelements.                               
                                MessageException messageEx = new MessageException();
                                messageEx.setMessage(MISSING_NAME_OR_VALUE, new Object[] {getDestination().getId()});
View Full Code Here

Examples of flex.messaging.config.ConfigMap

       
        // Number of minutes a client can remain idle before the server times the connection out.
        int idleTimeoutMinutes = properties.getPropertyAsInt(IDLE_TIMEOUT_MINUTES, DEFAULT_IDLE_TIMEOUT_MINUTES);
        setIdleTimeoutMinutes(idleTimeoutMinutes);
       
        ConfigMap userAgents = properties.getPropertyAsMap(USER_AGENT_SETTINGS, null);
        if (userAgents != null)
        {
            List userAgent = userAgents.getPropertyAsList(USER_AGENT, null);
            if (userAgent != null)
            {
                for (Iterator iter = userAgent.iterator(); iter.hasNext();)
                {
                    ConfigMap agent = (ConfigMap)iter.next();
                    String matchOn = agent.getPropertyAsString(MATCH_ON, null);
                    int kickstartBytes = agent.getPropertyAsInt(KICKSTART_BYTES, 0);
                    int connectionsPerSession = agent.getPropertyAsInt(MAX_STREAMING_CONNECTIONS_PER_SESSION, DEFAULT_CONNECTIONS_PER_SESSION);
                    if (matchOn != null)
                    {
                        UserAgentSettings ua = UserAgentSettings.getAgent(matchOn);
                        ua.setKickstartBytes(kickstartBytes);
                        ua.setMaxStreamingConnectionsPerSession(connectionsPerSession);
View Full Code Here

Examples of flex.messaging.config.ConfigMap

     * @param properties Properties to be used while creating the <code>FactoryInstance</code>.
     */
    private FactoryInstance createFactoryInstance(ConfigMap properties)
    {  
        if (properties == null)
            properties = new ConfigMap();
       
        properties.put(FlexFactory.SOURCE, source);
        properties.put(FlexFactory.SCOPE, scope);
        FactoryInstance factoryInstance = getFactory().createFactoryInstance(getId(), properties);
        return factoryInstance;
View Full Code Here

Examples of flex.messaging.config.ConfigMap

     * and additional <code>BaseHTTPEndpoint</code> specific properties under
     * "properties" key.
     */
    public ConfigMap describeEndpoint()
    {
        ConfigMap endpointConfig = super.describeEndpoint();

        boolean createdProperties = false;
        ConfigMap properties = endpointConfig.getPropertyAsMap("properties", null);
       
        if (properties == null)
        {
            properties = new ConfigMap();
            createdProperties = true;
        }
       
        if (pollingEnabled)
        {
            ConfigMap pollingEnabled = new ConfigMap();
            // Adding as a value rather than attribute to the parent
            pollingEnabled.addProperty("", "true");           
            properties.addProperty(POLLING_ENABLED, pollingEnabled);
        }       
               
        if (pollingIntervalMillis > -1)
        {
            ConfigMap pollingInterval = new ConfigMap();
            // Adding as a value rather than attribute to the parent
            pollingInterval.addProperty("", String.valueOf(pollingIntervalMillis));
            properties.addProperty(POLLING_INTERVAL_MILLIS, pollingInterval);
        }
       
        if (piggybackingEnabled)
        {
            ConfigMap piggybackingEnabled = new ConfigMap();
            // Adding as a value rather than attribute to the parent
            piggybackingEnabled.addProperty("", String.valueOf(piggybackingEnabled));
            properties.addProperty(ConfigurationConstants.PIGGYBACKING_ENABLED_ELEMENT, piggybackingEnabled);
        }
       
        if (createdProperties && properties.size() > 0)
            endpointConfig.addProperty(ConfigurationConstants.PROPERTIES_ELEMENT, properties);
View Full Code Here

Examples of flex.messaging.config.ConfigMap

     * and additional <code>BaseHTTPEndpoint</code> specific properties under
     * "properties" key.
     */
    public ConfigMap describeEndpoint()
    {
        ConfigMap endpointConfig = super.describeEndpoint();

        boolean createdProperties = false;
        ConfigMap properties = endpointConfig.getPropertyAsMap("properties", null);

        if (properties == null)
        {
            properties = new ConfigMap();
            createdProperties = true;
        }

        if (loginAfterDisconnect)
        {
            ConfigMap loginAfterDisconnect = new ConfigMap();
            // Adding as a value rather than attribute to the parent
            loginAfterDisconnect.addProperty("", "true");           
            properties.addProperty(ConfigurationConstants.LOGIN_AFTER_DISCONNECT_ELEMENT, loginAfterDisconnect);
        }                      

        if (createdProperties && properties.size() > 0)
            endpointConfig.addProperty("properties", properties);
View Full Code Here

Examples of info.archinnov.achilles.internal.utils.ConfigMap

     *
     * @return PersistenceManagerFactory
     */
    public PersistenceManagerFactory buildPersistenceManagerFactory() {
        TypedMap parameters = buildConfigMap();
        ConfigMap achillesParameters = buildAchillesConfigMap();
        String keyspace = achillesParameters.getTyped(KEYSPACE_NAME);
        final CassandraEmbeddedServer embeddedServer = new CassandraEmbeddedServer(parameters, achillesParameters);
        return embeddedServer.getPersistenceManagerFactory(keyspace);
    }
View Full Code Here

Examples of org.jibeframework.core.app.config.ConfigMap

    }
  }

  @SuppressWarnings("unchecked")
  public void fireEvent(Object source, String id, String event, Object... data) {
    ConfigMap handlers = (ConfigMap) configService.getConfig("core.binding");
    Event eventData = new Event(source, data);
    if (handlers.containsKey(id)) {
      Map map = (Map) handlers.get(id);
      if (map.containsKey(event)) {
        invoke((String) map.get(event), eventData);
      }
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigMap

        return config;
    }

    private static ConfigMap getDefaultParserModuleConfig()
    {
        ConfigMap config = new ConfigMap();
        config.addConfigValue("class", String.class);
        config.addConfigValue("enabled", Boolean.class, false, true);
        config.addConfigValue("processors", Map.class);
        return config;
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigMap

        }
    }

    private void setupModule(String name, IModule module, Map<String, Object> rawConfig) throws ConfigException
    {
        ConfigMap moduleConfig = module.getModuleConfig();
        if (moduleConfig != null)
        {
            module.getModuleConfig().parse(name, rawConfig);
        }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigMap

        System.out.println("--------------------");
        System.out.println();
        for (String className : AVAILABLE_PROCESSORS)
        {
            IProcessor module = factory.create(className);
            ConfigMap config = getDefaultProcessorModuleConfig().merge(module.getModuleConfig());
            String usage = "  - params: " + config.getDescription("    ");

            ConfigMap processParamsConfig = module.getProcessParamsConfig();
            String usage2 = "";
            if (processParamsConfig != null && !processParamsConfig.isEmpty())
            {
                usage2 = "  - parser params: " + processParamsConfig.getDescription("    ");
            }

            System.out.format("* %s - %s%n%s%s%n", className, module.getModuleDescription(), usage, usage2);
        }

        System.out.println("Available parsers");
        System.out.println("-----------------");
        System.out.println();
        for (String className : AVAILABLE_PARSERS)
        {
            IParser module = factory.create(className);
            ConfigMap config = getDefaultParserModuleConfig().merge(module.getModuleConfig());
            String usage = "  - params: " + config.getDescription("    ");

            System.out.format("* %s - %s%n%s%n", className, module.getModuleDescription(), usage);
        }
    }
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.