You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
590 B
22 lines
590 B
package com.fr.design.env; |
|
|
|
import com.fr.base.Env; |
|
import com.fr.core.env.EnvConfig; |
|
import com.fr.core.env.impl.LocalEnvConfig; |
|
import com.fr.dav.LocalEnv; |
|
import com.fr.env.RemoteEnv; |
|
|
|
/** |
|
* 根据配置生成运行环境 |
|
*/ |
|
public class EnvGenerator { |
|
public static Env generate(EnvConfig config) { |
|
Env env = null; |
|
if (config instanceof LocalEnvConfig) { |
|
env = new LocalEnv((LocalEnvConfig)config); |
|
} else if (config instanceof RemoteEnvConfig) { |
|
env = new RemoteEnv((RemoteEnvConfig) config); |
|
} |
|
return env; |
|
} |
|
}
|
|
|