當前位置: 首頁>>代碼示例>>Java>>正文


Java Deactivator.deactivateAll方法代碼示例

本文整理匯總了Java中org.globus.util.deactivator.Deactivator.deactivateAll方法的典型用法代碼示例。如果您正苦於以下問題:Java Deactivator.deactivateAll方法的具體用法?Java Deactivator.deactivateAll怎麽用?Java Deactivator.deactivateAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.globus.util.deactivator.Deactivator的用法示例。


在下文中一共展示了Deactivator.deactivateAll方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import org.globus.util.deactivator.Deactivator; //導入方法依賴的package包/類
public static void main(String argv[]) {

	if (argv.length < 4) {
	    System.out.println("Usage: java MultiUserGramTest" +
			       " contact dir proxy1 proxy2");
	    System.exit(-1);
	}

	String contact = argv[0];
	String dir     = argv[1];

	GSSCredential proxy1, proxy2;
	GramJob job1, job2;
	Thread t1, t2;

	proxy1 = load(argv[2]);
	proxy2 = load(argv[3]);

	MultiUserGramTest test = new MultiUserGramTest();

	job1 = createJob(proxy1, test, dir, 0);
	job2 = createJob(proxy2, test, dir, 1);
    
	t1 = submit(contact, job1);
	t2 = submit(contact, job2);
    
	System.out.println("wait for job completion.");
	while(true) {
	    try {
		Thread.sleep(1000);
	    } catch (InterruptedException e) {}
	    if ( (job1.getStatus() == GramJob.STATUS_DONE || 
		  job1.getStatus() == GramJob.STATUS_FAILED) &&
		 (job2.getStatus() == GramJob.STATUS_DONE || 
		  job2.getStatus() == GramJob.STATUS_FAILED) ) break;
	}
	Deactivator.deactivateAll();
    }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:39,代碼來源:MultiUserGramTest.java

示例2: main

import org.globus.util.deactivator.Deactivator; //導入方法依賴的package包/類
public static void main(String [] args) {
   
String contact = null;

if (args.length == 0) {
    System.err.println("Usage: java GramTest [resource manager]");
    System.exit(1);
}

contact = args[0];

System.out.println("TEST 1 : " + test1(contact, true));
System.out.println();
System.out.println("TEST 2 : " + test1(contact, false));
       System.out.println();
System.out.println("TEST 3 : " + test3(contact));
System.out.println();
System.out.println("TEST 4 : " + test2(contact));
System.out.println();
System.out.println("TEST 5 : " + test4(contact));
System.out.println();
System.out.println("TEST 6 : " + test5(contact));
System.out.println();

try {
    while ( Gram.getActiveJobs() != 0 ) {
	Thread.sleep(2000);
    }
} catch(Exception e) {}

       Deactivator.deactivateAll();
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:33,代碼來源:Gram15Test.java

示例3: exit

import org.globus.util.deactivator.Deactivator; //導入方法依賴的package包/類
private static void exit(int err) {
logger.debug("Exiting...");
Deactivator.deactivateAll();
System.exit(err);
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:6,代碼來源:GlobusRun.java

示例4: multiRun

import org.globus.util.deactivator.Deactivator; //導入方法依賴的package包/類
private static void multiRun(RslNode rslTree, int options) {
if ( (options & GLOBUSRUN_ARG_BATCH) != 0 ) {
    System.err.println("Error: Batch mode (-b) not supported for multi-request");
    exit(1);
}

MultiJobListener listener = new MultiJobListener(quiet);

       List jobs = rslTree.getSpecifications();
       Iterator iter = jobs.iterator();
       RslNode node;
       NameOpValue nv;
String rmc;
String rsl;
       while( iter.hasNext() ) {
           node = (RslNode)iter.next();
    rsl = node.toRSL(true);
    nv = node.getParam("resourceManagerContact");
           if (nv == null) {
               System.err.println("Error: No resource manager contact for job.");
	continue;
           } else {
               Object obj = nv.getFirstValue();
               if (obj instanceof Value) {
	    rmc = ((Value)obj).getValue();
	    multiRunSub(rsl, rmc, options, listener);
               }
           }
}

logger.debug("Waiting for jobs to complete...");
synchronized(listener) {
    try {
	listener.wait();
    } catch(InterruptedException e) {
    }
}

logger.debug("Exiting...");
Deactivator.deactivateAll();
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:42,代碼來源:GlobusRun.java

示例5: main

import org.globus.util.deactivator.Deactivator; //導入方法依賴的package包/類
public static void main(String [] args) {

	RemoteGassServer s = null;

	int port       = 0;
	boolean secure = true;
	String host    = null;
	
	for (int i = 0; i < args.length; i++) {
	    if (args[i].equals("-h")) {
		host = args[++i];
	    } else if (args[i].equals("-p")) {
		port = Integer.parseInt(args[++i]);
	    } else if (args[i].equalsIgnoreCase("-i")) {
		secure = false;
	    } else {
		System.err.println("Unknown command: " + args[i]);
		System.exit(1);
	    }
	}
	
	try {
	    s = new RemoteGassServer(secure, port);
	    
	    s.setOptions( USER_EXPAND_ENABLE | 
			  TILDE_EXPAND_ENABLE | 
			  LINE_BUFFER_ENABLE | 
			  GassServer.READ_ENABLE | 
			  GassServer.WRITE_ENABLE );
	    
	    s.start(host);
	    
	    System.out.println("Remote gass server url: " + s.getURL());
	    
	    Thread.sleep(10000);
	    
	    System.out.println("Shutting down...");
	    
	} catch(Exception e) {
	    e.printStackTrace();
	} finally {
	    if (s != null) s.shutdown();
	}
	
	System.out.println("Done");
	Deactivator.deactivateAll();
    }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:48,代碼來源:RemoteGassServer.java


注:本文中的org.globus.util.deactivator.Deactivator.deactivateAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。