Esempio n. 1
0
        /// <summary>
        /// Method for convenient testing of local connectors.
        /// </summary>
        public APIConfiguration CreateTestConfiguration(SafeType <Connector> clazz,
                                                        Configuration config)
        {
            LocalConnectorInfoImpl info = new LocalConnectorInfoImpl();

            info.ConnectorConfigurationClass = SafeType <Configuration> .Get(config);

            info.ConnectorClass          = (clazz);
            info.ConnectorDisplayNameKey = ("DUMMY_DISPLAY_NAME");
            info.ConnectorKey            = (
                new ConnectorKey(clazz.RawType.Name + ".bundle",
                                 "1.0",
                                 clazz.RawType.Name));
            info.Messages = (this.CreateDummyMessages());
            APIConfigurationImpl rv = new APIConfigurationImpl();

            rv.IsConnectorPoolingSupported = (
                IsConnectorPoolingSupported(clazz));
            ConfigurationPropertiesImpl properties =
                CSharpClassProperties.CreateConfigurationProperties(config);

            rv.ConfigurationProperties = (properties);
            rv.ConnectorInfo           = (info);
            rv.SupportedOperations     = (
                FrameworkUtil.GetDefaultSupportedOperations(clazz));
            info.DefaultAPIConfiguration = (
                rv);
            return(rv);
        }
Esempio n. 2
0
        CreateDefaultAPIConfiguration(LocalConnectorInfoImpl localInfo)
        {
            SafeType <Connector> connectorClass =
                localInfo.ConnectorClass;
            APIConfigurationImpl rv     = new APIConfigurationImpl();
            Configuration        config =
                localInfo.ConnectorConfigurationClass.CreateInstance();
            bool pooling = IsPoolingSupported(connectorClass);

            rv.IsConnectorPoolingSupported = pooling;
            rv.ConfigurationProperties     = (CSharpClassProperties.CreateConfigurationProperties(config));
            rv.ConnectorInfo       = (localInfo);
            rv.SupportedOperations = (FrameworkUtil.GetDefaultSupportedOperations(connectorClass));
            return(rv);
        }