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


Java Deactivator類代碼示例

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


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

示例1: registerDefaultDeactivator

import org.globus.util.deactivator.Deactivator; //導入依賴的package包/類
/**
 * Registers a default deactivation handler. It is used to shutdown the server without having a reference to the
 * server. <br>
 * Call Deactivate.deactivateAll() to shutdown all registered servers.
 */
public void registerDefaultDeactivator() {
    if (deactivator == null) {
        deactivator = new AbstractServerDeactivator(this);
    }
    Deactivator.registerDeactivation(deactivator);
}
 
開發者ID:fast-data-transfer,項目名稱:fdt,代碼行數:12,代碼來源:GSIBaseServer.java

示例2: registerDefaultDeactivator

import org.globus.util.deactivator.Deactivator; //導入依賴的package包/類
/**
    * Registers a default deactivation handler. It is used
    * to shutdown the server without having a reference to
    * the server. Call Deactivate.deactivateAll() to shutdown
    * all registered servers.
    */
   public void registerDefaultDeactivator() {
if (deactivator == null) {
    deactivator = new AbstractServerDeactivator(this);
}
Deactivator.registerDeactivation(deactivator);
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:13,代碼來源:BaseServer.java

示例3: 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

示例4: 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

示例5: unregisterDefaultDeactivator

import org.globus.util.deactivator.Deactivator; //導入依賴的package包/類
/**
 * Unregisters a default deactivation handler.
 */
public void unregisterDefaultDeactivator() {
    if (deactivator == null)
        return;
    Deactivator.unregisterDeactivation(deactivator);
}
 
開發者ID:fast-data-transfer,項目名稱:fdt,代碼行數:9,代碼來源:GSIBaseServer.java

示例6: 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

示例7: 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

示例8: unregisterDefaultDeactivator

import org.globus.util.deactivator.Deactivator; //導入依賴的package包/類
/**
    * Unregisters a default deactivation handler. 
    */
   public void unregisterDefaultDeactivator() {
if (deactivator == null) return;
Deactivator.unregisterDeactivation(deactivator);
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:8,代碼來源:BaseServer.java

示例9: 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類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。