当前位置: 首页>>代码示例>>Java>>正文


Java ServiceGroupRegistrationClient类代码示例

本文整理汇总了Java中org.globus.wsrf.impl.servicegroup.client.ServiceGroupRegistrationClient的典型用法代码示例。如果您正苦于以下问题:Java ServiceGroupRegistrationClient类的具体用法?Java ServiceGroupRegistrationClient怎么用?Java ServiceGroupRegistrationClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ServiceGroupRegistrationClient类属于org.globus.wsrf.impl.servicegroup.client包,在下文中一共展示了ServiceGroupRegistrationClient类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AdvertisementClient

import org.globus.wsrf.impl.servicegroup.client.ServiceGroupRegistrationClient; //导入依赖的package包/类
protected AdvertisementClient() {
    this.client = new ServiceGroupRegistrationClient();
    this.client.setClientCallback(new Callback());
   	System.out.println("Installing JVM shutdown hook to unregister.");
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
           	System.out.println("Running shutdown hook.");
            try {
                unregister();
            } catch (UnregistrationException e) {
           		System.err.println("Problem unregistering");
           		System.err.println(e);
            }
        }
    });
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:18,代码来源:AdvertisementClient.java

示例2: main

import org.globus.wsrf.impl.servicegroup.client.ServiceGroupRegistrationClient; //导入依赖的package包/类
public static void main(String[] args) throws RemoteResourcePropertyRetrievalException, QueryInvalidException,
    ResourcePropertyRetrievalException, InvalidConfigurationException, InterruptedException, IOException {

    for (int i = 0; i < args.length; i++) {
        String sourceURL = args[i];

        DiscoveryClient sourceClient = new DiscoveryClient(sourceURL);
        EndpointReferenceType[] allServices = sourceClient.getAllServices(true);
        System.out.println("Found " + allServices.length + " services in Index Service:" + sourceURL);

        for (EndpointReferenceType epr : allServices) {
            System.out.println("Processing service: " + epr.getAddress());

            try {
                File registrationFile = new File("resources/registrationTemplate.xml");
                if (registrationFile.exists() && registrationFile.canRead()) {

                    ServiceGroupRegistrationParameters params = ServiceGroupRegistrationClient
                        .readParams(registrationFile.getAbsolutePath());

                    params.setRegistrantEPR(epr);

                    for (int j = 0; j < MULTIPLIER; j++) {
                        // System.out.println("Registering for the " + (j+1)
                        // + " time.");
                        AdvertisementClient registrationClient = new AdvertisementClient(params);
                        registrationClient.register();
                    }

                    Thread.sleep((long) (1000 + (1000 * (10 * Math.random()))));

                } else {
                    System.out.println("Unable to read registration file:" + registrationFile);
                }
            } catch (Exception e) {
                System.err.println("Exception when trying to register service (" + epr + "): " + e.getMessage());
            }

        }
    }

    System.out.println("Type 'exit' to quit, and unregister services:");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String line = br.readLine();
    while (line != null) {
        if (line.equals("exit")) {
            System.out.println("Exiting.");
            System.exit(0);
        }
        line = br.readLine();
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:53,代码来源:MassRegistration.java


注:本文中的org.globus.wsrf.impl.servicegroup.client.ServiceGroupRegistrationClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。