Search in sources :

Example 1 with PlatformDotNetConfiguration

use of org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration in project ignite by apache.

the class PlatformDotNetConfigurationClosure method apply0.

/** {@inheritDoc} */
@SuppressWarnings("deprecation")
@Override
protected void apply0(IgniteConfiguration igniteCfg) {
    // 3. Validate and copy Interop configuration setting environment pointer along the way.
    PlatformConfiguration interopCfg = igniteCfg.getPlatformConfiguration();
    if (interopCfg != null && !(interopCfg instanceof PlatformDotNetConfiguration))
        throw new IgniteException("Illegal platform configuration (must be of type " + PlatformDotNetConfiguration.class.getName() + "): " + interopCfg.getClass().getName());
    PlatformDotNetConfiguration dotNetCfg = interopCfg != null ? (PlatformDotNetConfiguration) interopCfg : null;
    if (dotNetCfg == null)
        dotNetCfg = new PlatformDotNetConfiguration();
    memMgr = new PlatformMemoryManagerImpl(gate, 1024);
    PlatformLogger userLogger = null;
    if (igniteCfg.getGridLogger() instanceof PlatformLogger) {
        userLogger = (PlatformLogger) igniteCfg.getGridLogger();
        userLogger.setGateway(gate);
    }
    PlatformDotNetConfigurationEx dotNetCfg0 = new PlatformDotNetConfigurationEx(dotNetCfg, gate, memMgr, userLogger);
    igniteCfg.setPlatformConfiguration(dotNetCfg0);
    // Set Ignite home so that marshaller context works.
    String ggHome = igniteCfg.getIgniteHome();
    if (ggHome != null)
        U.setIgniteHome(ggHome);
    // 4. Callback to .Net.
    prepare(igniteCfg, dotNetCfg0);
    // Make sure binary config is right.
    setBinaryConfiguration(igniteCfg, dotNetCfg0);
}
Also used : PlatformConfiguration(org.apache.ignite.configuration.PlatformConfiguration) PlatformDotNetConfiguration(org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration) IgniteException(org.apache.ignite.IgniteException) PlatformMemoryManagerImpl(org.apache.ignite.internal.processors.platform.memory.PlatformMemoryManagerImpl) PlatformLogger(org.apache.ignite.internal.logger.platform.PlatformLogger)

Aggregations

IgniteException (org.apache.ignite.IgniteException)1 PlatformConfiguration (org.apache.ignite.configuration.PlatformConfiguration)1 PlatformLogger (org.apache.ignite.internal.logger.platform.PlatformLogger)1 PlatformMemoryManagerImpl (org.apache.ignite.internal.processors.platform.memory.PlatformMemoryManagerImpl)1 PlatformDotNetConfiguration (org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration)1