Created
October 8, 2010 06:19
-
-
Save brianhsu/616429 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package xmlimport; | |
| import java.util.Properties; | |
| import ftp.FINJFTP; | |
| import props.PropsServiceProvider; | |
| public class DoSwapServerIndex { | |
| public static void main(String[] args) { | |
| DoSwapServerIndex doSwapLuceneIndex = new DoSwapServerIndex(); | |
| doSwapLuceneIndex.swapLuceneIndex(); | |
| } | |
| private void swapLuceneIndex() { | |
| final PropsServiceProvider propsServiceProvider1 = new PropsServiceProvider( | |
| "props/ServiceProvider.properties"); | |
| final PropsServiceProvider propsServiceProvider2 = new PropsServiceProvider( | |
| "props/server115.properties"); | |
| Properties prosp = new Properties(); | |
| prosp = propsServiceProvider1.getProperties(); | |
| Properties pro115 = new Properties(); | |
| pro115 = propsServiceProvider2.getProperties(); | |
| new Thread(new SwapIndexThread(pro115, "XXX.XXX.XXX.XXX")).start(); | |
| new Thread(new SwapIndexThread(prosp, "XXX.XXX.XXX.XXX")).start(); | |
| new Thread(new SwapIndexThread(prosp, "XXX.XXX.XXX.XXX")).start(); | |
| // [2010-07-05-XXX]182專用知識網目前用不到Lucene | |
| // new Thread(new SwapIndexThread(prosp, "XXX.XXX.XXX.XX")).start(); | |
| } | |
| // ========Class End======== | |
| } | |
| class SwapIndexThread implements Runnable { | |
| String server = null; | |
| Properties properties = null; | |
| SwapIndexThread(Properties pro, String server) { | |
| this.properties = pro; | |
| this.server = server; | |
| } | |
| public void run() { | |
| FINJFTP ftp = new FINJFTP(this.properties, this.server); | |
| ftp.swapIndex(server); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment